[Gdal-dev] Converting S-57 to GML and then parsing the GML document
avdimisglobal at yahoo.co.uk
avdimisglobal at yahoo.co.uk
Mon Jun 27 10:57:37 EDT 2005
Hi Guys (and Girls)
I have several S-57 ENC charts. I have converted one of them to GML using:
ogr2ogr –f “GML” test.gml test.000
The result is a 6 MB file containing features, which I presume to be
correct.
I then parsed this GML and drew all the features to a PNG file. This is
where the problem comes in. It seems that some of the coordinates in the GML
document is incorrect. Some of the coordinates are not inside the area
defined by:
<gml:boundedBy>
<gml:Box>
<gml:coord><gml:X>-180</gml:X><gml:Y>15</gml:Y></gml:coord>
<gml:coord><gml:X>-116.5</gml:X><gml:Y>71.5</gml:Y></gml:coord>
</gml:Box>
</gml:boundedBy>
Also I don't know in what projection this is. I presume this to be WGS84 as
the result I get when ignoring some coordinates and removing everything like
Aids to Navigations etc look similar to what the original S-57 ENC looked
like.
It seems that all the points are fine. The problem comes in with the lines
and polygons.
In this feature:
<gml:featureMember>
<Line fid="0">
<RCID>57</RCID>
<PRIM>2</PRIM>
<GRUP>2</GRUP>
<OBJL>30</OBJL>
<RVER>1</RVER>
<AGEN>550</AGEN>
<FIDN>134252534</FIDN>
<FIDS>2478</FIDS>
<LNAM>0226080087F609AE</LNAM>
<ogr:geometryProperty><gml:LineString><gml:coordinates>-139.299815,69.518647
-139.382691,69.53233400000001 -139.422843,69.53669100000001
-139.483763,69.53959500000001 -139.541914,69.53814300000001
-139.573759,69.53862700000001 -139.595911,69.54298300000001
-139.620833,69.551692 -139.645755,69.558463 -139.681753,69.562331
-139.719135,69.566682 -139.753749,69.575864 -139.804977,69.584559
-139.840975,69.58842300000001 -139.871435,69.59035400000001
-139.904664,69.596148 -139.946201,69.602904 -139.998723,69.608375
-140.027889,69.606765 -140.149729,69.599526 -140.227263,69.596148
-140.329719,69.59035400000001 -140.398947,69.58794
-140.432175,69.58890599999999 -140.490094,69.59194100000001
-140.578705,69.596769 -140.6867,69.606421
-140.809924,69.619444</gml:coordinates></gml:LineString></ogr:geometryProper
ty>
</Line>
</gml:featureMember>
I would draw a line between point 1 & 2 and then between 2 & 3. Some of the
coordinates are out of the box. If I ignore them everything looks fine. If I
use them, I have lines all over the place.
I have a similar problem with the polygons.
I'm using PHP to do it all, and had problems with the line being too long. I
then added a check to drop all coordinates that does not have at least a
lat/long. Some points have a third parameter - I presume this to be the Z
value but am not quite sure what it is for.
It would be greatly appreciated if someone could shed a bit of light on the
subject and help me out. I can provide the S-57 ENC and the GML (both are in
the region of 6MB). I also have a screenshot of the S-57 chart and my own
attempt in PNG format. They look similar but we specifically want the
traffic separation schemes and buoys on the charts and also indicating sea,
deep water, rivers and bridges.
One other thing - When viewing the original S-57 ENC it shows the names of
cities, ports buildings etc. In the GML this is nowhere to be found. Is
there a specific reason for this?
Regards
Albert
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.8.2/29 - Release Date: 2005/06/27
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.8.2/29 - Release Date: 2005/06/27
More information about the Gdal-dev
mailing list