Convert an Area to Lines?
Roger Edrinn
Global Mapper UserTrusted User
I downloaded a shapefile boundary expecting lines, I got an area shapfile. I was working with the edit tools vertices trying to break the thing into a group of line vertices. No Luck.
Is their a way to break apart an area into line segments?
Thanks
Is their a way to break apart an area into line segments?
Thanks
Comments
-
Yes, you can select the area(s) with the Digitizer Tool, then right click and select the option to generate line features from the area(s).
Let me know if I can be of further assistance.
Thanks,
Mike
Global Mapper Support
support@globalmapper.com -
That worked easy enough, but I'm not able to break the line apart and delete some lines.
Vision two boxes, side-by-side, where they join vertically, I want to delete both verticals and join, or not, the horizontal lines. When I attempted to delete the corner vertice, GM says I can't.
Part of my problem is I'm used to CorelDraw, so bit of a mind block.
Thanks -
You need to first enable vertex display (Shift+V), then you can select the vertex where you want to split up the line, then right click and select the option to split the line at the vertex. Then repeat that as necessary to break up your line into pieces. You can then select the desired line pieces and delete those, leaving just the ones that you want.
Let me know if I can be of further assistance.
Thanks,
Mike
Global Mapper Support
support@globalmapper.com -
I thought I was doing exactly that, just wasn't working. Probably because I needed to delete four different lines and was expecting two.
I needed a break, nothing like shovelling 15" of snow off the deck to reset the brain.
Thanks -
global_mapper wrote: »Yes, you can select the area(s) with the Digitizer Tool, then right click and select the option to generate line features from the area(s).
Let me know if I can be of further assistance.
Thanks,
Mike
Global Mapper Support
support@globalmapper.com
Can this process be scripted?
ie
1)open a file containing area shapes
2)convert all those areas to lines
3)export the lines as a new vestor shape file
what would 2 look like? Or perhaps some other method to script this process? -
There is a multi-step method to do this. It would look like the following:
1) IMPORT command to load areas
2) EXPORT_VECTOR command to export areas to simple ASCII text file. Add TYPE=SIMPLE_ASCII and EXPORT_ATTRS=NO to get text file with no attributes
3) UNLOAD_ALL
4) IMPORT_ASCII command to load file back in. Add TYPE=POINT_AND_LINE to pull data in as lines
5) EXPORT_VECTOR to export lines back out as Shapefile
Note this will remove any attributes. I may have some other solutions if you need to keep those.
Thanks,
Mike
Global Mapper Support
support@globalmapper.com
5) EDIT_VECTOR command to -
DIR_LOOP_START DIRECTORY="path-to-area-files" FILENAME_MASKS="*.shp" RECURSE_DIR=YES
IMPORT FILENAME="%FNAME_W_DIR%" PROJ_NAME="GEO_WGS84" HIDDEN=NO
EXPORT_VECTOR FILENAME="%FNAME_W_DIR%_ASCII.TXT" TYPE=SIMPLE_ASCII EXPORT_ATTRS=NO GEN_PRJ_FILE=YES COORD_DELIM=COMMA FEATURE_SEP=BLANK_LINE
UNLOAD_ALL
IMPORT_ASCII FILENAME="%FNAME_W_DIR%_ASCII.TXT" TYPE=POINT_AND_LINE PROJ_NAME="GEO_WGS84" COORD_DELIM=COMMA
EXPORT_VECTOR FILENAME="%FNAME_W_DIR%_LINE.SHP" TYPE=SHAPEFILE SHAPE_TYPE=LINES GEN_PRJ_FILE=YES
UNLOAD_ALL
DIR_LOOP_END -
global_mapper wrote: »I may have some other solutions if you need to keep those.
In general the conversion works well but now I'd like to take you up on a method that retains (at least one) of the attributes.
I'm stumped as to how you might do it? -
I have updated the EDIT_VECTOR script command to support a new CONVERT_AREAS_TO_LINES=YES parameter that will convert area features to lines. Use the following command to do this:
EDIT_VECTOR CONVERT_AREAS_TO_LINES=YES
I have placed a new build at http://www.globalmapper.com/global_mapper12.zip with the change for you to try. Simply download that file and extract the contents into your existing v12.xx installation folder to give it a try. If you are using the 64-bit v12 version there is a new build at http://www.globalmapper.com/global_mapper12_64bit.zip .
Let me know if I can be of further assistance.
Thanks,
Mike
Global Mapper Support
support@globalmapper.com
Categories
- 12.7K All Categories
- 5.6K Features Discussion
- 342 Downloading Imagery
- 1.3K Elevation Data
- 380 Georeferencing Imagery Discussion
- 628 GM Script Language
- 53 User Scripts
- 113 GPS Features
- 414 Projection Questions
- 819 Raster Data
- 1.3K Vector Data
- 6.6K Support
- 177 Announcement and News
- 908 Bug Report
- 558 SDK
- 1.2K Suggestion Box
- 3.7K Technical Support
- 562 Other Discussion
- 129 GIS Data Sources
- 27 Global Mapper Showcase
- 233 How I use Global Mapper
- 107 Global Mapper Forum Website