2

I have a shapefile with 3D linestrings. I want to convert this to 2D multilinestrings

I tried:-

ogr2ogr -t_srs EPSG:4326  Road_wgs84_2d_mlt.shp Road_wgs84.shp -nlt PROMOTE_TO_MULTI -dim 2 -progress

But this:-

ogrinfo -so -al Road_wgs84_2d_mlt.shp

Gives me:-

OGRFeature(Road_wgs84_2d_mlt1):0
  ID (String) = D291A5DD-66FA-4764-87F9-80D9FB8A83F5
  DISTNAME (String) = (null)
  ROADNUMBER (String) = B9097
  CLASSIFICA (String) = B Road
  DRAWLEVEL (String) = 0
  OVERRIDE (String) = F
  FEATCODE (Integer) = 15743
  LINESTRING (-3.444786910479451 56.164060208744381   52.480434944853187,-3.446986978754905 56.164483742630381 52.48251925688237)

As you can see the -nlt flag has not promoted the linestring to multilinestring. What am I doing wrong?

I have also tried -nlt MULTILINESTRING with the same result

1

Shapefile driver http://www.gdal.org/drv_shapefile.html has own layer creation option SHPT=type for setting the geometrytype. Shapefiles do not make difference between linestrings and multilinestrings, nor between polygons and multipolygons. What you can do is to drop the Z coordinate by defining the corresponding 2D shapetype:

ogr2ogr -t_srs EPSG:4326  Road_wgs84_2d_mlt.shp Road_wgs84.shp -lco SHPT=ARC -progress

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.