Opened 18 years ago

Closed 9 years ago

#1048 closed enhancement (wontfix)

Make ogr2ogr extract subelements of feature element

Reported by: jorn@… Owned by: warmerdam
Priority: high Milestone:
Component: OGR_SRS Version: unspecified
Severity: minor Keywords:
Cc:

Description (last modified by Even Rouault)

Only direct childs of the <feature> element is
extracted to PostGIS. Is it possible to implement so that all childs and
sub-elements are extracted.

Two solutions:

<date>
  <year>2005</year>
  <month>December</month>
  <day>25</day>
</date>

would appear in the result as attributes:
date_year: 2005
date_month: December
date_day: 25

Or XML subelements as separate tables and foreign keys:


<gml:featureMember>
                <ais:feature>
                        <ais:MMSI>123456</ais:MMSI>
                        <ais:callsign>"CallMe"</ais:callsign>
                        <ais:name>"MS Ship</ais:name>
                        <ais:IMONumber>65432d1</ais:IMONumber>
                        <ais:length>75.3</ais:length>
                        <ais:beam>35.</ais:beam>
                        <ais:wesselType>cargo</ais:wesselType>
                        <ais:antennaLocation>aft of bow</ais:antennaLocation>
                        <ais:draught>3.2</ais:draught>
                        <ais:hazardousCargo>none</ais:hazardousCargo>
                        <ais:destination>Rotterdam</ais:destination>
                        <ais:expectedTimeOfArrival>2005-08-13T15:00:00</ais:
expectedTimeOfArrival>
                        <ais:extraInfo>none</ais:extraInfo>
                        <ais:trackProperty>
                                <ais:track>
                                        <ais:objectStatus>
                                                <gml:pos srsName="LL-WGS84">17.0 
69.0</gml:pos>
                                                <ais:time>2005-08-13T04:37:15</
ais:time>
                                                <ais:speedOverGround>11.</ais:
speedOverGround>
                                                <ais:courseOverGround>17.3</ais:
courseOverGround>
                                                <ais:heading>16.0</ais:heading>
                                                <ais:bearing>15.3</ais:bearing>
                                                <ais:rateOfTurn>2.14</ais:
rateOfTurn>
                                                <ais:
navigationalStatus>underway</ais:navigationalStatus>
                                                <ais:safetyMessage>none</ais:
safetyMessage>
                                                <ais:dataSource>AIS transp. sys. 
x</ais:dataSource>
                                        </ais:objectStatus>
                                        <ais:objectStatus>
                                                <gml:pos>17.5 69.5</gml:pos>
                                                <ais:time>2005-08-13T04:38:00</
ais:time>
                                                <ais:speedOverGround>11.</ais:
speedOverGround>
                                                <ais:courseOverGround>17.3</ais:
courseOverGround>
                                        </ais:objectStatus>
                                </ais:track>
                        </ais:trackProperty>
                        <ais:time>1967-08-13T17:39:15</ais:time>
                        <ais:dataSource>Kystverket</ais:dataSource>
                        </ais:feature>
        </gml:featureMember>

would in PostGIS result in the following tables:
ais:feature
ais:trackProperty with foreign key (fk) to ais:feature
ais:track with fk to ais:trackPropery
ais:objectStatus with fk to ais:track

Change History (1)

comment:1 by Even Rouault, 9 years ago

Description: modified (diff)
Resolution: wontfix
Status: newclosed

This is more complex than that. Would require having support for complex feature types. The GML driver has also improved in ways where with playing with .gfs file the workaround solution can probably be applied.

Note: See TracTickets for help on using tickets.