Editing Feature Type for Export to Shapefile

Eagle2Eagle2 Global Mapper UserPosts: 29Trusted User
edited June 2014 in Vector Data
Hello,

I'm working on a project with a large number of 1km x 1km tiled contour files in MicroStation .dgn format I need to output as ESRI Shapefiles. Problem is that the closed contours (ie peaks/pits) within each .dgn file are classed as closed shapes, whereas the open contours are classed as polylines. When running a batch conversion in Global Mapper the resulting shapefiles are split into polygon features and line features - not ideal when viewing contours. Is there any functionality within Global Mapper to force all loaded vector features to export as lines?

Thanks in advance

Bryan

Comments

  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited July 2011
    Bryan,

    Are there any attributes of interest besides the elevation? If not, you can first batch convert to Simple ASCII and uncheck the option to include feature attributes and make sure to check the one to include elevations, then do the convert again from ASCII Text to Shapefiles. With no attributes included everything should come back in as lines for the export to Shapefiles.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • Eagle2Eagle2 Global Mapper User Posts: 29Trusted User
    edited July 2011
    Thanks Mike, I'll try this. I'd like to be able to keep the feature attributes (mainly layer information) but I can live without it as I can add it back fairly easily using a selection set in ArcMap. A second question I have regarding the same contour data is regarding the gridding of data during export. The contour files I have extend beyond the deliverable boundary. Is there a way I can clip to this boundary AND tile the data on predetermined tiles? I have tried gridding data before, and can specify a tile size, but GM seems to choose the lower left corner of the data, rather than an absolute coordinate. Any suggestions?

    Thanks,

    Bryan
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited July 2011
    Bryan,

    You can specify the bounds of your export on the Export Bonds tab when exporting, including either to a specific bounding rectangle or cropping to a selected area, then also setup gridding on the Gridding tab of the export dialog to split up into grid cells within that export boundary.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • Tyler LTyler L Global Mapper User Posts: 2
    edited June 2014
    Bryan,

    Are there any attributes of interest besides the elevation? If not, you can first batch convert to Simple ASCII and uncheck the option to include feature attributes and make sure to check the one to include elevations, then do the convert again from ASCII Text to Shapefiles. With no attributes included everything should come back in as lines for the export to Shapefiles.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com

    Hi Mike, I have the same problem when batch-converting many DGN files to SHP file polylines. I followed your advice by converting DGN to Ascii text, then to SHP file. The resulting SHP files still get exported as both lines and polygons for each file. Any help would be appreciated.
    Thanks.
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited June 2014
    If you export to a simple ASCII text file and make sure to uncheck both the general attribute inclusion and the inclusion of style attributes then your areas should just look like line features on re-import. Or you skip the export to ASCII and use a script with the following command:

    EDIT_VECTOR FILENAME="*.dgn" CONVERT_AREAS_TO_LINES=YES

    See Global Mapper Scripting Reference for details. That command will convert any area features in a loaded DGN file to line features. You could then use EXPORT_VECTOR to export a Shapefile.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Guru
    geohelp@bluemarblegeo.com
    Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation
  • Tyler LTyler L Global Mapper User Posts: 2
    edited June 2014
    Ok, that works for the dgn to ascii to shp method, when unchecking the attributes, and it will retain elevations. There is one attribute I would like to retain though (style/line weight) to differentiate between major and minor contours. I am new to GM Scripting, but am guessing it would look something like this:

    //Converts DGN to shp file
    GLOBAL_MAPPER_SCRIPT VERSION=1.00
    UNLOAD_ALL

    DIR_LOOP_START DIRECTORY="N:\\contour_test\dgn" \
    RECURSE_DIR=NO

    IMPORT_DGN FILENAME="N:\contour_test\dgn\%FNAME_WO_EXT%.dgn" \
    TYPE=AREAS,LINE
    INC_COORD_LINE_ATTRS=YES \
    INC_ELEV_COORDS=YES \

    EDIT_VECTOR FILENAME="N:\contour_test\dgn\%FNAME_WO_EXT%.dgn" \
    CONVERT_AREAS_TO_LINES=YES

    EXPORT_VECTOR FILENAME="N:\contour_test\converted_lines\%FNAME_WO_EXT%.SHP" \
    TYPE=SHAPEFILE \
    SHAPE_TYPE=LINES \
    GEN_3D_LINES=YES \
    GEN_PRJ_FILE=YES \

    UNLOAD_ALL

    DIR_LOOP_END
Sign In or Register to comment.