[postgis-users] GML > PostGIS

Peter Brewer p.brewer at cornell.edu
Wed Jan 7 11:41:40 PST 2009


Sorry everyone - please ignore my previous emails.  It appears I need to 
RTFM... well the most recent manual at least!

For the record ogr2ogr *can* now convert simple features GML into 
PostGIS.  I even found a helpful tutorial to assist: 
http://cse-mjmcl.cse.bris.ac.uk/blog/2006/05/27/1148737394599.html

Why is it that you can Google a topic for hours, then only find the 
answer 10mins after posting to a mailing list?

Many thanks

Peter


Peter Brewer wrote:
> Martin,
>
> Thanks for the prompt reply.
>
> The schema is being developed and is open to suggestions.  At the 
> moment we are keeping it ultra simple and just specifying the 
> following element in the relevant locations:
>
> ....snip....
> <xs:element name="locationGeometry">
> <xs:complexType>
> <xs:choice>
> <xs:element ref="gml:Point"/>
> <xs:element ref="gml:Polygon"/>
> </xs:choice>
> </xs:complexType>
> </xs:element>
> ....snip....
>
> The full schema is at: http://tridas.org/1.0/tridas.xsd
>
> I know it would be pretty simple to parse gml:Point and gml:Polygon 
> myself, but I'd rather not reinvent the wheel.  Besides, I imagine 
> that in the future we'll extend the schema to support full SF-GML so I 
> was hoping someone would have already written a SF-GML>PostGIS converter.
>
> Best wishes
>
> Peter
>
>
> Martin Davis wrote:
>> Do you have a fixed schema?  Can you post an example GML document?
>>
>> Peter Brewer wrote:
>>> Hi All,
>>>
>>> I'm writing a webservice that reads and writes (amongst other things)
>>> location data to/from a Postgres/PostGIS database.
>>>
>>> Outputting the data as GML from the database is easy using the asGML()
>>> PostGIS function.  What I'm pondering over is how to write data to the
>>> database when sent by the user in GML format.
>>>
>>> GDAL/OGR doesn't seem to allow GML > PostGIS conversion.  Any ideas how
>>> I can do this?  I'm restricting users to the 'Simple Features' 
>>> subset of
>>> GML so I only need to be able to write points, lines and polygons to 
>>> the
>>> database.  Am I really stuck with parsing the GML myself and writing
>>> PostGIS SQL statements?  It doesn't seem enormously difficult so I'm
>>> wondering why there isn't a library to do this already.
>>>
>>> Any help or pointers much appreciated
>>>
>>> Cheers
>>>
>>> Peter
>>>
>>> _______________________________________________
>>> postgis-users mailing list
>>> postgis-users at postgis.refractions.net
>>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>>>
>>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users




More information about the postgis-users mailing list