Skip to content

Commit f1226cf

Browse files
committed
update
1 parent d1b8666 commit f1226cf

File tree

4 files changed

+40
-0
lines changed

4 files changed

+40
-0
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.pmtiles
2+
*.csv
3+

Makefile

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
get:
2+
curl -o data.csv https://data.sfgov.org/api/views/3mea-di5p/rows.csv?date=20231114&accessType=DOWNLOAD
3+
generate:
4+
ruby generate.rb | tippecanoe -f -o a.pmtiles --minimum-zoom=3 --maximum-zoom=13 \
5+
--base-zoom=13 --drop-densest-as-needed
6+

README.md

+7
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,10 @@ Base addresses from San Francisco's Enterprise Addressing System (EAS)
44
# Source
55
- [Addresses - Enterprise Addressing System from DataSF](https://data.sfgov.org/Geographic-Locations-and-Boundaries/Addresses-Enterprise-Addressing-System/3mea-di5p)
66
- [Direct Link to Source Data](https://data.sfgov.org/api/views/3mea-di5p/rows.csv?date=20231114&accessType=DOWNLOAD)
7+
8+
# Releases
9+
## 1st release
10+
CID: QmYsNiPd72agz3s9FdfihZFiRUVUaPYMHqV9FiizyMDgQ9
11+
12+
[PMTiles Viewer](https://protomaps.github.io/PMTiles/?url=https%3A%2F%2Fsmb.optgeo.org%2Fipfs%2FQmYsNiPd72agz3s9FdfihZFiRUVUaPYMHqV9FiizyMDgQ9#map=11.37/37.7688/-122.4424)
13+

generate.rb

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
require 'csv'
2+
require 'json'
3+
4+
PATH = 'data.csv'
5+
6+
CSV.foreach(PATH, :headers => true) {|r|
7+
f = {
8+
:type => :Feature,
9+
:properties => r.to_hash,
10+
:tippecanoe => {
11+
:layer => :address
12+
}
13+
}
14+
f[:properties].delete('point')
15+
f[:geometry] = {
16+
:type => :Point,
17+
:coordinates => [
18+
f[:properties].delete('Longitude').to_f,
19+
f[:properties].delete('Latitude').to_f
20+
]
21+
}
22+
print "#{JSON.dump(f)}\n"
23+
}
24+

0 commit comments

Comments
 (0)