[gdal-dev] Shapefile OGR question/concern

Nikos Alexandris nikos.alexandris at felis.uni-freiburg.de
Wed Mar 12 16:09:45 EDT 2008


On Wed, 2008-03-12 at 21:05 +0100, Nikos Alexandris wrote:
> On Wed, 2008-03-12 at 15:48 -0400, Christiaan Janssen wrote:
> > Hi all,
> > I'm having an issue with the Shapefile driver within OGR. When
> > exporting data from an OGRDataset to a shapefile I'm required to add
> > an additional "closing point" (ie repeat the first point at the end)
> > for the resultant shapefile to be correctly recognized in other
> > viewers (I realize the shapefile spec calls for this). The problem is
> > that other formats do not require this closing point (eg KML) and
> > adding the additional point results in additional point being written
> > to the outputted file, not what I would believe to be correct. It
> > would seem then that depending on my output I would have to reformat
> > my data, seemling defeating the purpose of having an interfaced method
> > library like OGR. Am I incorrect in my assumption and/or is there
> > another intended way to do this correctly. 
> 
> I am sure that you will get "better" replies to this from the Experts.
> But I'll give it a shot since I had a similar issue.
> 
> The "closing point" has to be there in case you are dealing with closed
> polygons (areas). Without it (in other words without first and last
> point identical) polygons are not really "closed" and therefore
> topologically not "clean".
> 
> Non-topological formats like ESRI Shapefiles can live with that and
> therefore cleaning is highly recommended.
> 
> .
> 
> Some weeks ago I was trying to import KML's polygons into GRASS the data
> appeared broken (open polygons, missing lines (?) and even a centroid
> falling outside an area (?))

I hope I added more questions (rather than answering) so I understand
all this bymyself ;-P

Any KML experts?



More information about the gdal-dev mailing list