I'm completely new to PostgreSQL and PostGIS. I finally got both installed and have the PostGIS extension installed. I'm running the PostGIS shapefile import manager. I select my shapefile and click import. It says shapefile import completed but I do not see it in the file in the database. Any thoughts?
-
What parameters did you use, a screen shot may be appropriate? Do you have, or have you given, permission to the tool to 'see' the database? RDBMS is not like filesystem data, there's so much more to it, for example did you create a new database using the PostGIS template?– Michael StimsonMar 11, 2015 at 4:28
-
tinypic.com/r/znvt3l/8 tinypic.com/r/znvt3l/8 tinypic.com/r/n3x7v5/8 tinypic.com/r/o8rmgl/8 here are the screenshots in sequential order.– Christopher HarrodMar 11, 2015 at 4:50
-
It is best to edit and insert the image into your question, many users may be unable to go to web hosting sites due to I.T. restrictions.– Michael StimsonMar 11, 2015 at 5:02
-
DO NOT IMPORT INTO TEMPLATE_POSTGIS use that template to create a live database. Do you have PGAdminIII?– Michael StimsonMar 11, 2015 at 5:04
-
I created that template myself. I don't know what you mean by creating a live database. I tried creating a newdatabase and added the postgis extensions to it. I then tried to import again and it didn't show.– Christopher HarrodMar 11, 2015 at 5:08
1 Answer
Using PGAdminIII create a database using the template_postgis as a template, this copies all the triggers, functions and tables into a new database. Right click on the databases symbol and select 'new database':
Then you can import data into it. It is probably best to not use the pg_admin user but if you're the only one seeing the database that should be fine. Have a read of Roles and Privileges to see about creating a 'user' or users identity(s).
If you don't have template_postgis in your database then perhaps you can create it (or here) but I found it best (easier) to uninstall and reinstall PostGIS.
-
Hey Michael, Thanks for the help. I installed postgis again and it created a sample database with 7 extensions. I then followed your instructions above. The new database looked identical to the sample database. I then tried to import the shapefile with no luck again. It said it succeeded but it doesn't show up in the tree. alkdjslsjd! Mar 11, 2015 at 5:35
-
Are you looking in the public schema? DB=>Schemas=>public=>tables. Perhaps it doesn't like SRID=0 but that doesn't seem likely, not every spatial reference is a SRID. Confirm that you're connecting with PGAdmin as the same user (postgres), it might be there but you may not be able to see it. Also it might help if you have a postgres schema... there was something about that but I don't remember if it's a SDE or PostGIS requirement. Mar 11, 2015 at 5:47
-
Both answers are correct above. The shp files were importing but I wasn't looking in the right place. I needed to be in DB=>Schemas=>public=>tables. Thanks Michael Mar 12, 2015 at 5:35