PostGIS Support

GeoBobGeoBob Global Mapper UserPosts: 26Trusted User
edited September 2012 in Technical Support
I am enjoying upgrades to GM in v14 beta. However, I am having a bit of trouble with reading PostGIS files. GM can read data imported from the 'public' schema consistently, but its pretty hit and miss with other schemas. The database seems fine as I can read/write thsoe schema with QGIS with no problems. The schema has the correct owner and a valid SRID. I note if the latter is missing, GM cannot read the data but that is OK.

I am using PostGIS 2.0 with PostgesSQL 9.1. Data (shapefiles) loaded with newest GUI loader.

Any thoughts?

Thanx

Bob S.
Calgary, AB

Comments

  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited September 2012
    Bob,

    I've let the developer in charge of the PostGIS support about this. He should take a look at it Tuesday (Monday is a holiday in the US).

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    http://www.globalmapper.com
  • HendersonHenderson Global Mapper User Posts: 26Trusted User
    edited September 2012
    Hi Bob, I am just getting rolling with GM with PostGIS. I have a shapefile loaded into postgis and am able to view it with QGIS. Is there a trick to viewing it with Global Mapper (default local install of most recent PostGres / Post GIS). Thanks.
  • GeoBobGeoBob Global Mapper User Posts: 26Trusted User
    edited September 2012
    Henderson

    If I understand your question, GM won't know what the most recently accessed PostGIS dataset is. You will have to enter the server (localhost in my case), database name, user & password. That seems to work fro me OK providing your data is in the 'public' schema. I am having trouble with reading from other schema (aka tables).

    Cheers
    Bob S.
  • SeldomSeldom Global Mapper User Posts: 46Trusted User
    edited September 2012
    I'm also interested in connecting PostGIS tables to GM. I've got two maps with tables called inside and outside. When I import shapefiles I can connect GM to the database. Both tables show up as single instances. I check the check boxes, and the maps load in GM. But after I use PostGIS to add columns and manipulate values the two connections multiply to maybe 4 for each table and all the connections give unknown error messages.
  • SeldomSeldom Global Mapper User Posts: 46Trusted User
    edited September 2012
    I'm also interested in connecting PostGIS tables to GM. I've got two maps with tables called inside and outside. When I import shapefiles I can connect GM to the database. Both tables show up as single instances. I check the check boxes, and the maps load in GM. But after I use PostGIS to add columns and manipulate values the two connections multiply to maybe 4 for each table and all the connections give "unknown error" messages. Apologies for double post. It would be really nice if this forum permitted deletion of posts or permitted a longer editing time than 5 minutes.
  • bmg_bobbmg_bob Global Mapper Programmer Posts: 1,776
    edited September 2012
    GeoBob wrote: »
    I am enjoying upgrades to GM in v14 beta. However, I am having a bit of trouble with reading PostGIS files. GM can read data imported from the 'public' schema consistently, but its pretty hit and miss with other schemas. The database seems fine as I can read/write thsoe schema with QGIS with no problems. The schema has the correct owner and a valid SRID. I note if the latter is missing, GM cannot read the data but that is OK.

    Hi Bob,

    Please clarify for me exactly what result you get when you try to read a table from a schema other than "public"? Is there an error message?

    Thanks,

    Bob
    Global Mapper Programmer
  • bmg_bobbmg_bob Global Mapper Programmer Posts: 1,776
    edited September 2012
    Hi,
    Seldom wrote: »
    But after I use PostGIS to add columns and manipulate values the two connections multiply to maybe 4 for each table and all the connections give unknown error messages.

    I need a little more information about what you did that produced this result. I don't understand, what you mean by "...used PostGIS to add add columns and manipulate data..." Did you use another tool, or was this done in Global Mapper? If you used Global Mapper, please tell me what steps I need to perform in order to recreate the problem.

    Thank you,

    Bob
    Global Mapper Programmer
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited September 2012
    There a new v14.0 beta installer at the links below with a PostGIS fix from bmg_bob:

    32-bit: http://www.globalmapper.com/downloads/global_mapper14_setup.exe
    64-bit: http://www.globalmapper.com/downloads/global_mapper14_setup_64bit.exe

    I'll let him fill in the details.

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    http://www.globalmapper.com
  • bmg_bobbmg_bob Global Mapper Programmer Posts: 1,776
    edited September 2012
    I fixed 2 problems:

    1) Attempting to load a PostGIS table that was not in the "public" schema produced an error message. I believe this was the error reported by GeoBob above.

    2) If you import a PostGIS table, then export it back to PostGIS, the export failed. This happened whether or not I added new attributes to the layer. With the fix, if you add new attributes to a feature, and then export back to PostGIS, the exported table will include the new attribute. This may be the problem reported by Seldom.

    Thank you for your feedback.

    Cheers,

    Bob
    Blue Marble Programmer
  • SeldomSeldom Global Mapper User Posts: 46Trusted User
    edited September 2012
    bmg_bob wrote: »
    Hi,


    Bob,
    I need a little more information about what you did that produced this result. I don't understand, what you mean by "...used PostGIS to add add columns and manipulate data..." Did you use another tool, or was this done in Global Mapper? If you used Global Mapper, please tell me what steps I need to perform in order to recreate the problem.

    Thank you,

    Bob
    Global Mapper Programmer

    I used PostGreSQL scripts to add columns to tables that I was originally able to open in GM. After running the scripts I saw multiple instances of the same tables, none of which would open in GM.
    Thanks,
    Hilton
  • bmg_bobbmg_bob Global Mapper Programmer Posts: 1,776
    edited September 2012
    Hi Hilton,
    Seldom wrote: »
    I used PostGreSQL scripts to add columns to tables that I was originally able to open in GM. After running the scripts I saw multiple instances of the same tables, none of which would open in GM.

    Can you upload the script you used to the forum as an attachment so I can see what types of columns you added? I might be able to use it to update one of the tables in my test database to see if I can reproduce the problem.

    Thank you.

    Cheers,

    Bob
  • GeoBobGeoBob Global Mapper User Posts: 26Trusted User
    edited September 2012
    Bob

    As far as I can see you fixed my problem with only reading 'public' schema.

    Thanks! :)

    Bob S.
    Calgary, AB
  • SeldomSeldom Global Mapper User Posts: 46Trusted User
    edited September 2012
    bmg_bob wrote: »
    Hi Hilton,



    Can you upload the script you used to the forum as an attachment so I can see what types of columns you added? I might be able to use it to update one of the tables in my test database to see if I can reproduce the problem.

    Thank you.

    Cheers,

    Bob

    Here it is. The uploader kept giving me an "invalid file" message, but it's pretty short.
    SELECT 
      * 
    FROM 
      public.inside, 
      public.outside
    WHERE -- This WHERE Statement really speeds things up.
    inside.gid = outside.gid; 
    
    ALTER TABLE inside ADD COLUMN simplified geometry;
    ALTER TABLE inside ADD COLUMN outsideStartpoint geometry;
    ALTER TABLE inside ADD COLUMN outsideEndpoint geometry;
    ALTER TABLE inside ADD COLUMN insideStartpoint geometry;
    ALTER TABLE inside ADD COLUMN insideEndpoint geometry;
    --ALTER TABLE inside ADD COLUMN new_line geometry;
    --ALTER TABLE inside ADD COLUMN numpoints integer;
    --ALTER TABLE inside ADD COLUMN distance real;
    

    Thanks,
    Hilton
  • metallometallo Global Mapper User Posts: 23Trusted User
    edited September 2012
    postgis seems to have pretty decent raster deployment now, is there any chance we'll see raster export with postgis databases soon?
  • bmg_bobbmg_bob Global Mapper Programmer Posts: 1,776
    edited September 2012
    Hi,
    metallo wrote: »
    postgis seems to have pretty decent raster deployment now, is there any chance we'll see raster export with postgis databases soon?

    I have added an item to our task list (#10892) covering the import and export of PostGIS rasters.

    Cheers,

    Bob
    Blue Marble Geographics
    Global Mapper Programmer
  • bmg_bobbmg_bob Global Mapper Programmer Posts: 1,776
    edited September 2012
    Hilton,

    Thanks for the information. It appears that you are adding additional geometry columns to the database. I will see if that might be causing problems in Global Mapper.

    Cheers,

    Bob
    Blue Marble Geographics
    Global Mapper Programmer
Sign In or Register to comment.