Overview
If your organization has a PostgreSQL database with PostGIS, the "Import from Shapefile" tool will allow you to import a shapefile zip containing the following files and extensions:
- Myshapefile.zip
- ‘- shapefile.shp
- ‘- shapefile.shx
- ‘- shapefile.dbf
Uploading a File ID
Refer to: Uploading a file to the files endpoint
Getting Started
- On the top navigation menu, click Data, and then under "More Imports", select "Import from Shapefile."
Import from Shapefile
Enter the following parameters:
- File ID = The file id recently uploaded to S3. The file must be in a .zip format.
- Postgres Database = The name of your destination database (e.g. Redshift-General)
- Postgres_Database_Credential = Your database credential
- Database Name = Set the default option 'dev'
- Spatial Reference System Identifier = A spatial reference identifier (SRID) is a unique identifier associated with a specific coordinate system, tolerance, and resolution.
- Destination Schema/Table = The output location for your shapefile (e.g. test_schema.test_table)
Please note: The schema must already exist, but the table will be newly created once the job completes successfully.
Frequently Asked Questions
1. What happens if the SRID has not been added to the Postgres database?
Reach out to support@civisanalytics.com and the support team will be able to manually add the SRID. For reference, here are steps required:
- Check if your database already supports that srid by running the following in the query pane:
SELECT 1 FROM spatial_ref_sys
WHERE srid=<srid_you_want>;
- If the query has zero results, Civis will need to add the srid to the spatial_ref_sys table. You can find the appropriate command by going to https://epsg.io/<srid_you_want> then clicking "Postgis" under the "Export" header. The command should look something like this:
INSERT into spatial_ref_sys (srid, auth_name, auth_srid, proj4text, srtext)
values ( 102747, 'ESRI', 102747, '+proj=lcc +lat_1=36.76666666666667 +lat_2=
37.96666666666667 +lat_0=36.33333333333334 +lon_0=-78.5 +x_0=3499999.999999999
+y_0=1000000 +datum=NAD83 +units=us-ft +no_defs ',
'PROJCS["NAD_1983_StatePlane_Virginia_South_FIPS_4502_Feet",
GEOGCS["GCS_North_American_1983",DATUM["North_American_Datum_1983",
SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],
UNIT["Degree",0.017453292519943295]],PROJECTION["Lambert_Conformal_Conic_2SP"],
PARAMETER["False_Easting",11482916.66666666],PARAMETER["False_Northing",
3280833.333333333],PARAMETER["Central_Meridian",-78.5],
PARAMETER["Standard_Parallel_1",36.76666666666667],
PARAMETER["Standard_Parallel_2",37.96666666666667],
PARAMETER["Latitude_Of_Origin",36.33333333333334],
UNIT["Foot_US",0.30480060960121924],AUTHORITY["EPSG","102747"]]');
Comments
0 comments
Please sign in to leave a comment.