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
- 13K All Categories
- 5.8K Features Discussion
- 350 Downloading Imagery
- 1.3K Elevation Data
- 385 Georeferencing Imagery Discussion
- 652 GM Script Language
- 56 User Scripts
- 115 GPS Features
- 421 Projection Questions
- 837 Raster Data
- 1.4K Vector Data
- 6.7K Support
- 182 Announcement and News
- 942 Bug Report
- 562 SDK
- 1.2K Suggestion Box
- 3.8K Technical Support
- 581 Other Discussion
- 132 GIS Data Sources
- 27 Global Mapper Showcase
- 245 How I use Global Mapper
- 111 Global Mapper Forum Website
