[postgis-users] ESRI Geodatabases, relationship classes and PostGIS

Ragi Y. Burhum ragi at burhum.com
Tue Jul 29 16:10:50 PDT 2008


On Tue, Jul 29, 2008 at 12:01 PM,
<postgis-users-request at postgis.refractions.net> wrote:
>
> Message: 20
> Date: Tue, 29 Jul 2008 09:47:22 -0700
> From: "Juan Declet" <reguerete at gmail.com>
> Subject: Re: [postgis-users] ESRI Geodatabases, relationship classes
>        and PostGIS
> To: "PostGIS Users Discussion" <postgis-users at postgis.refractions.net>
> Message-ID:
>        <c566dff90807290947q48e44807j57efb6e50712d80d at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Can anyone suggest a workaround? I am trying to implement relationship
> classes from a Personal Geodatabase into PostGIS. What about if I created
> the relationship classes natively in the PostGIS database server? The issue
> then would be getting ArcMap to recognize the relationship classes and
> enforce them via editing. I know this is more of an ArcGIS question, but am
> lookin for the input of experienced PostGIS users.

You are working with 2 different abstractions... one at the ArcObjects
level, and the other one at the RDBMS. Don't get them confused.

If your intent is to simply enforce the cardinality constraint, go
ahead and create the relationship at the PostgreSQL level. As long as
you are doing non-versioning editing, your ArcMap save operation will
be done within a transaction... if an RDBMS error is raised (and you
will get one if you violate the contraint you created) that
transaction will be rolled back and you will get the RDBMS message in
ArcMap. Be mindful that during the edit session you will not see the
error until ArcMap flushes its edit session (during a save, search,
etc).

If your intent is to have ArcMap recognize the relationship, for
example, to be able to navigate it through the object inspector, you
are going to need to insert the right entries in the GDB_*
(GDB_Relationships, GDB_ObjectClasses, etc) tables. The easiest bet is
to create the relationship through ArcCatalog once and check the
entries it created in those GDB metadata tables so you know how it
works.

>
> On Tue, Jul 29, 2008 at 9:34 AM, Lee Hachadoorian <
> lee.hachadoorian at gmail.com> wrote:
>
>> Yes, ArcCatalog creates a standard Access database table, but enforces
>> the creation of a unique index called OBJECTID (which is not, however,
>> actually a primary key).

Ha ha.. that is debatable :-)

>> So what Regina describes should work.
>>
>> There's an ogr2ogr cheatsheet at BostonGIS
>> (http://www.bostongis.com/?content_name=ogr_cheatsheet).
>>
>> I'm not sure about the relationship classes question, although my
>> suspicion is that the conversion works table-by-table on data (spatial
>> and non-spatial) only.  Since the relationship classes are not stored
>> in the feature class or non-spatial table itself (they are stored in a
>> table called GDB_RelClasses), I suspect that ogr2ogr will not do
>> anything to convert them.  Can someone confirm?
>>
>> --
>> Lee Hachadoorian
>> PhD Student, Geography
>> Program in Earth & Environmental Sciences
>> CUNY Graduate Center

My two cents,

- Ragi Yaser Burhum



More information about the postgis-users mailing list