mirror of
				https://github.com/zyphlar/sonoma-import.git
				synced 2024-03-08 15:07:48 +00:00 
			
		
		
		
	Merge download scripts
This commit is contained in:
		
							parent
							
								
									a599776919
								
							
						
					
					
						commit
						13059f15fa
					
				
							
								
								
									
										22
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										22
									
								
								README.md
									
									
									
									
									
								
							@ -32,9 +32,19 @@ Here are sample screenshots of Sonoma County, Santa Rosa, the City of Sonoma, an
 | 
			
		||||
- https://gis-sonomacounty.hub.arcgis.com/datasets/0f5982c3582d4de0b811e68d7f0bff8f
 | 
			
		||||
- http://download.geofabrik.de/north-america/us/california/norcal-latest.osm.pbf
 | 
			
		||||
 | 
			
		||||
osm2pgsql -d openstreetmap -c --prefix son --slim --extra-attributes --hstore --latlong norcal-latest.osm.pbf -U openstreetmap -W -H localhost -P 5432
 | 
			
		||||
Script:
 | 
			
		||||
```
 | 
			
		||||
cd original_data
 | 
			
		||||
wget https://opendata.arcgis.com/datasets/2202c1cd6708441f987ca5552f2d9659_0.zip
 | 
			
		||||
unzip 2202c1cd6708441f987ca5552f2d9659_0.zip
 | 
			
		||||
rm 2202c1cd6708441f987ca5552f2d9659_0.zip
 | 
			
		||||
 | 
			
		||||
Otherwise osm2pgsql should create tables like `son_polygon` for later.
 | 
			
		||||
wget https://opendata.arcgis.com/datasets/0f5982c3582d4de0b811e68d7f0bff8f_0.zip
 | 
			
		||||
unzip 0f5982c3582d4de0b811e68d7f0bff8f_0.zip
 | 
			
		||||
rm 0f5982c3582d4de0b811e68d7f0bff8f_0.zip
 | 
			
		||||
 | 
			
		||||
wget http://download.geofabrik.de/north-america/us/california/norcal-latest.osm.pbf
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
## Prerequisites
 | 
			
		||||
 | 
			
		||||
@ -59,11 +69,13 @@ Debian (shp2pgsql is included in postgis)
 | 
			
		||||
- Run the following SQL as a superuser (postgres) inside the `openstreetmap` database to enable the PostGIS and hstore extensions: `CREATE EXTENSION postgis; CREATE EXTENSION hstore;`
 | 
			
		||||
- Unzip the `original_data` and open a shell in that folder.
 | 
			
		||||
- Here we are assuming that the county data uses a WGS84 aka EPSG:4326 geographical projection, which was true as of last check and is also what OSM uses.
 | 
			
		||||
- Run from your shell: `shp2pgsql -s 4326 -I Parcels__Public_.shp | psql -d openstreetmap -U postgres -W`
 | 
			
		||||
- `shp2pgsql -s 4326 -I Sonoma_County_Building_Outlines.shp | psql -d openstreetmap -U postgres -W`
 | 
			
		||||
- `shp2pgsql -s 4326 -I osm-buildings-01-03.shp | psql -d openstreetmap -U postgres -W`
 | 
			
		||||
- Run from your shell: `shp2pgsql -s 4326 -I Parcels__Public_.shp | psql -d openstreetmap -U openstreetmap -W`
 | 
			
		||||
- `shp2pgsql -s 4326 -I Sonoma_County_Building_Outlines.shp | psql -d openstreetmap -U openstreetmap -W`
 | 
			
		||||
- `shp2pgsql -s 4326 -I osm-buildings-01-03.shp | psql -d openstreetmap -U openstreetmap -W`
 | 
			
		||||
- `osm2pgsql -d openstreetmap -c --prefix son --slim --extra-attributes --hstore --latlong norcal-latest.osm.pbf -U openstreetmap -W -H localhost -P 5432`
 | 
			
		||||
 | 
			
		||||
Now all the data is in Postgres. For processing and conflation, read through and execute `conflation.sql` as per your comfort level.
 | 
			
		||||
osm2pgsql should create tables like `son_polygon` for later.
 | 
			
		||||
 | 
			
		||||
## Exporting and uploading
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user