Shapefile Export
nickgoodliff
Global Mapper UserTrusted User
I'm exporting some layers as shapefiles, which I do 3 times to get the lines, areas and points. Only the points export produces a .dbf file - any reason why this could be? Here is my code (C#):
GlobalMapperDLL.GM_ExportVectorEx(storagePath + "_Areas.shp",
GlobalMapperDLL.GM_VectorExportFormat_t32.GM_Export_Shapefile,
IntPtr.Zero,
ref ExportRect,
GlobalMapperDLL.GM_VectorExportFlags_t32.GM_VectorExportFlags_ExportAreas,
IntPtr.Zero,
"");
GlobalMapperDLL.GM_ExportVectorEx(storagePath + "_Lines.shp",
GlobalMapperDLL.GM_VectorExportFormat_t32.GM_Export_Shapefile,
IntPtr.Zero,
ref ExportRect,
GlobalMapperDLL.GM_VectorExportFlags_t32.GM_VectorExportFlags_ExportLines,
IntPtr.Zero,
"");
GlobalMapperDLL.GM_ExportVectorEx(storagePath + "_Points.shp",
GlobalMapperDLL.GM_VectorExportFormat_t32.GM_Export_Shapefile,
IntPtr.Zero,
ref ExportRect,
GlobalMapperDLL.GM_VectorExportFlags_t32.GM_VectorExportFlags_ExportPoints,
IntPtr.Zero,
"");
And the files I get are:
xxx_Areas.shp
xxx_Areas.shx
xxx_Lines.shp
xxx_Lines.shx
xxx_Points.shp
xxx_Points.shx
xxx_Points.dbf
Cheers
Nick
GlobalMapperDLL.GM_ExportVectorEx(storagePath + "_Areas.shp",
GlobalMapperDLL.GM_VectorExportFormat_t32.GM_Export_Shapefile,
IntPtr.Zero,
ref ExportRect,
GlobalMapperDLL.GM_VectorExportFlags_t32.GM_VectorExportFlags_ExportAreas,
IntPtr.Zero,
"");
GlobalMapperDLL.GM_ExportVectorEx(storagePath + "_Lines.shp",
GlobalMapperDLL.GM_VectorExportFormat_t32.GM_Export_Shapefile,
IntPtr.Zero,
ref ExportRect,
GlobalMapperDLL.GM_VectorExportFlags_t32.GM_VectorExportFlags_ExportLines,
IntPtr.Zero,
"");
GlobalMapperDLL.GM_ExportVectorEx(storagePath + "_Points.shp",
GlobalMapperDLL.GM_VectorExportFormat_t32.GM_Export_Shapefile,
IntPtr.Zero,
ref ExportRect,
GlobalMapperDLL.GM_VectorExportFlags_t32.GM_VectorExportFlags_ExportPoints,
IntPtr.Zero,
"");
And the files I get are:
xxx_Areas.shp
xxx_Areas.shx
xxx_Lines.shp
xxx_Lines.shx
xxx_Points.shp
xxx_Points.shx
xxx_Points.dbf
Cheers
Nick
Comments
-
Nick,
Do your area or line features have any attributes? You should also pass in the GM_VectorExportFlags_ExportAttrs flag otherwise any attributes for each feature wouldn't be added and instead only special feature information.
Thanks,
Mike
Global Mapper Guru
gmsupport@bluemarblegeo.com
Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation -
Yes that is what I was missing! Didn't realise this wasn't a default.
Thanks for the help!
Nick
Categories
- 12.8K All Categories
- 5.7K Features Discussion
- 345 Downloading Imagery
- 1.3K Elevation Data
- 385 Georeferencing Imagery Discussion
- 636 GM Script Language
- 54 User Scripts
- 114 GPS Features
- 417 Projection Questions
- 825 Raster Data
- 1.3K Vector Data
- 6.6K Support
- 178 Announcement and News
- 912 Bug Report
- 558 SDK
- 1.2K Suggestion Box
- 3.7K Technical Support
- 569 Other Discussion
- 131 GIS Data Sources
- 27 Global Mapper Showcase
- 238 How I use Global Mapper
- 107 Global Mapper Forum Website