2

Database OverviewI want to display a map in offline mode (without Internet connectivity), so I have imported OSM data into my PostgreSQL database using osm2pgsql installer. I went through various links and tutorials and now I am currently using this link: https://sharpmap.codeplex.com/wikipage?title=Add%20a%20PostGIS%20layer

When I run this code using SharpMap, it gives the error of "geometry column not found" in the table. I am stuck as i don't know what should I enter as "tablename" and "idColumn" in the above reference link code and particularly WHY?

Can anyone guide me?

1
  • 1
    Welcome to gis.stackexchange! Please edit the title of your question to include enough information for future visitors to be able to find this thread when looking for the same problem.
    – underdark
    Oct 4 '16 at 16:41
1

You should use the constructor that takes connectionString, tableName, objectIdColumn, geometryColumn.

So your code should look like this:

C#
var p = new SharpMap.Data.Providers.PostGIS(connectionString, "plant_osm_polygon", "way", "osm_id");

If you don't provide the name of the geometry column (in your case: "way"), the PostGIS provider attempts to query the geometry column name from the geometry_columns view. That seems to fail somehow.

1
  • I have attached the snapshot of my database in my question..The above error has been resolved.. I am not sure which table and column should be passed in order to load complete map from the database as i a beginner in this field..Please guide me through this.. Thanks
    – Shreee
    Oct 4 '16 at 12:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.