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
- 346 Downloading Imagery
- 1.3K Elevation Data
- 385 Georeferencing Imagery Discussion
- 639 GM Script Language
- 54 User Scripts
- 115 GPS Features
- 419 Projection Questions
- 829 Raster Data
- 1.4K Vector Data
- 6.6K Support
- 179 Announcement and News
- 923 Bug Report
- 560 SDK
- 1.2K Suggestion Box
- 3.7K Technical Support
- 574 Other Discussion
- 132 GIS Data Sources
- 27 Global Mapper Showcase
- 241 How I use Global Mapper
- 108 Global Mapper Forum Website