0

This is my first time trying to convert a VMAP to a shapefile and the examples online aren't as straightforward to me.

Any guidance?

  • Can you explain what VMAP is and point to an example? Why do you want a shapefile and can that substantially represent the source? What does ogrinfo report on the source data? – mdsumner Jun 11 '14 at 20:59
  • First thing to check is if your GDAL is build to support the driver gdal.org/drv_ogdi.html. However, lots of VMAP data are available already in shapefile format. But if your aim is to study the driver and GDAL then you probably must compile GDAL with OGDI yourself. – user30184 Jun 12 '14 at 7:17
1

Try to use ogr with python.

Step 1: Open you VMAP file using QgsVectorLayer

vlayer = QgsVectorLayer(<VMAP location>+"|layername=<VMAP filename>", <newLayeName>, "ogr")

if you get True after you run this line it means the VMAP was properly loaded.

Step 2: convert the vlayer to Shapefile

vlayerToShape = QgsVectorFilleWriter.writeasVectorFormat(vlayer, "myShapeFile.shp", "CP1250", QGSCoordinateReferenceSystem(), "ESRI Shapefile")
if vlayerToShape  == QgsVectorFilleWriter.NoError:
      print "The conversion was successful!"
  • if you want to use GDAL - ogr2ogr try this: ogr2ogr -f "ESRI Shapefile" toShapeFile.shp <location where is VMAP>|layername=<VMAP file name> – Marian Jul 23 '15 at 16:23

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.