Geographic Information Systems Asked on December 3, 2021
I’m trying to import the Census State Boundaries from the census data site although I get errors in the geom
data every time I import in the same rows.
I’ve tried shp2pgsql
and ogr2ogr
shp2pgsql -I -d -e /Users/cj/Projects/geospacial_data/cb_2019_us_state_500k/cb_2019_us_state_500k.shp public.state | psql -h localhost -d my_db -U cj
and this
ogr2ogr -f "ESRI Shapefile" /Users/cj/Projects/geospacial_data/cb_2019_us_state_500k/cb_2019_us_state_500k.shp PG:"host=localhost user=cj dbname=mydb" "state"
The errors show up here in the geom
column (in the screenshot) showing the loaded size. Are these errors just part of the file? or am I doing something wrong? This seems to crop up when I do Counties and zip codes as well.
I’m running
Prefer ogr2ogr
over shp2pgsql
because the former has many built-in validations for the supported data sources and destinations.
The Census State Boundary SHP dataset claimed to be of type POLYGON but contained at least one row of MULTIPOLYGON geometry.
Use the following command to import the Census State Boundary SHP dataset into PostgreSQL (assuming that you had priorly enabled the PostGIS extension on the target database):
ogr2ogr -f "PostgreSQL" PG:"host=localhost user=cj dbname=mydb" -nln state -nlt multipolygon cb_2019_us_state_500k.shp
Answered by Ralph Tee on December 3, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP