[gdal-dev] Shapefile OGR question/concern

Christiaan Janssen cjanssen at iavo-rs.com
Wed Mar 12 18:03:01 EDT 2008


I understand the need for the first and last point but what I don't understand is why it is not handled appropriately (in my opinion) per format. If KML only wants 4 points for a rectangle and other formats want 5 (first and last point the same) why doesn't the import/export function build the shape to an internal standard (ie have everything load in with the first point repeated at the end). I tried importing a shapefile into an OGRDataset and then exported it out to KML only to have Google Earth hang on the resultant KML file. This obviosuly implies that I would have to implement vector format specific implementations, is there a reason for this?  
   
Christiaan
      _____  

  From: Nikos Alexandris [mailto:nikos.alexandris at felis.uni-freiburg.de]
To: Christiaan Janssen [mailto:cjanssen at iavo-rs.com]
Cc: gdal-dev at lists.osgeo.org [mailto:gdal-dev at lists.osgeo.org]
Sent: Wed, 12 Mar 2008 16:09:45 -0400
Subject: Re: [gdal-dev] Shapefile OGR question/concern


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?

      
   
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20080312/f4da47d4/attachment.html


More information about the gdal-dev mailing list