8

Does anyone know if MapInfo and QGIS will support inheritance in a PostgreSQL/PostGIS database?

I would like to make use of inheritance but need to make sure the software I use will work with them.

From the book PostGIS in Action I have found the following, but am unsure if MapInfo or QGIS will be supported or not:

Inheritance works seamlessly with OpenJump, GeoServer, and MapServer. Any tool that polls the standard PostgreSQL metadata should end up treating parent tables like any other.

EDIT

I have had a look at the Paris example in Chapter 3 of PostGIS in action. I have a parent table called paris, and 3 child tables called paris_linestrings, paris_polygons and paris_points. These show up as follows on the Add PostGIS table dialog (I don't have any lines in the linestrings table yet, so that's why the paris table doesn't show lines yet) :

alt text

In MapInfo, the tables show up in the list when opening a DBMS table. I can't get them to map as I haven't set up the MapCatalog and added the relevant data to each table to allow MapInfo to show the spatial data. But I can open the tables in a browser view and see the attribute data and it seems to be correct.

All I need to do now is set up some triggers to put the correct spatial type into the correct child table when added to the parent.

1
  • hi, it has REALLY been a while but I was researching on the subject of having layers in geoserver which correspond to parent and child (inheritance) tables in postgis respectively, and I read in your question that Inheritance works seamlessly with OpenJump, GeoServer, and MapServer. Any tool that polls the standard PostgreSQL metadata should end up treating parent tables like any other. I was wondering if you could, after all this time, give me some pointers on the matter. I am trying to get geoserver to "notice" the inheritance relation, do u know of any resource that might help? Commented Jan 26, 2018 at 19:34

2 Answers 2

6

It works seamlessly in QGIS too.

7
  • Thanks for the confirmation about QGIS. May be going with QGIS instead of MapInfo for this project then.
    – James S
    Commented Jan 11, 2011 at 16:02
  • May I ask how you're planning to use inheritance? I just tried it for the first time. Interesting, but I think I'd like it better if the data itself was somehow inherited too by the child-tables (and not just the column definitions).
    – underdark
    Commented Jan 11, 2011 at 19:50
  • 2
    I am planning on creating a parent table with all of my attributes fields in it, and then a geometry column which will accept any geometries. I am then going to create 3 child tables (one for point, one for polyline and one for polygon) and put constraints on the geometry columns of the child tables so they only accept the correct type of geometry. I will add other specific fields to the child tables like area, length etc.
    – James S
    Commented Jan 12, 2011 at 8:51
  • This is a very interesting. I might have to give it a go sometime.
    – Nathan W
    Commented Jan 12, 2011 at 12:43
  • I will update how I get on. I was given the idea by reading PostGIS in action. It seems to make sense in my situation for most of my data. Hopefully it works. I still haven't worked out whether MapInfo can cope with tables with inheritance though.
    – James S
    Commented Jan 12, 2011 at 12:59
4

I know this is an old question but I just wanted to add my thought to it.

MapInfo Pro can't open a spatial table from a database like PostgreSQL/POSTGIS unless the table has been made mappable, that is it has to be registered in the MapInfo.MapInfo_MapCatalog.

This catalog is used by MapInfo Pro to figure out how to show the table in a map, for instance which symbology to use, what coordinate system and more.

4
  • This may explain why I am having a similar issue with SQL Server. How can the MapInfo.Mapinfo_MapCatalog be updated to see the geom properties of data thats uploaded using OGR2OGR or other systems apart from EasyLoader? See gis.stackexchange.com/questions/424547/…
    – GeorgeC
    Commented Feb 24, 2022 at 4:07
  • 1
    You can use Make DBMS Table Mappable from within MapInfo Pro to register the table in the MapCatalog, or you can manually update the MapCatalog or use a script to do it Commented Feb 24, 2022 at 10:28
  • I am designing a spatial database and I wanted to ask if it is a good idea to use inheritance to store objects that share certain attributes, but whose geometry differs since some are points, lines and others are polygons? Commented Oct 10, 2023 at 19:57
  • @JavierAguilar, you should ask this as a separate question Commented Oct 11, 2023 at 11:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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