[Proj] ogr2ogr to convert KML files into ESRI Shapefiles?

Eric Miller EMiller at dfg.ca.gov
Thu Mar 3 08:09:47 PST 2011


Shapefiles are written with one geometry type.   I suspect there are
additional options for ogr2ogr to specify the geometry type for the
shapefile.  If you want both point and line features, you'll probably
need two shapefiles.  You might want to read
http://gdal.org/ogr/drv_shapefile.html and
http://trac.osgeo.org/gdal/wiki/FAQVector#HowdoItranslateamixedgeometryfiletoshapefileformat
.
-- 

Eric G. Miller
Staff Programmer
CA Dept. of Fish & Game


>>> On 3/3/2011 at 3:50 AM, Roger Oberholtzer <roger at opq.se> wrote:
> As the subject says, I am trying to convert  KML files into ESRI
> Shapefiles. I use a command like this:
> 
> 	ogr2ogr -f "ESRI Shapefile" rst31_tyid2_2.shp rst31_tyid2_2.kml
> 
> I get the following error:
> 
> ERROR 1: Attempt to write non-point (LINESTRING) geometry to point 
> shapefile.
> ERROR 1: Terminating translation prematurely after failed
> translation of layer DATA from RST (use -skipfailures to skip
errors)
> 
> Indeed the kml file does have a <linestring/> component. It is a
path
> defined by WGS84 latitudes, longitudes and altitudes. I'm sensing
this
> is a problem for shapefiles. Is there a reasonable solution?
> 
> 
> Yours sincerely,
> 
> Roger Oberholtzer
> 
> OPQ Systems / Ramböll RST
> 
> Office: Int +46 10-615 60 20
> Mobile: Int +46 70-815 1696
> roger.oberholtzer at ramboll.se 
> ________________________________________
> 
> Ramböll Sverige AB
> Krukmakargatan 21
> P.O. Box 17009
> SE-104 62 Stockholm, Sweden
> www.rambollrst.se 
> 
> _______________________________________________
> Proj mailing list
> Proj at lists.maptools.org 
> http://lists.maptools.org/mailman/listinfo/proj




More information about the Proj mailing list