remove coastline
#1
Posted 09 July 2007 - 09:01 AM
I have a shapefile with countries - as polygons. Now if I want to do things with the country to country boundaries, excluding coastlines (or vice versa ) - is there any cool way one can easily do this in ArcGIS 9.2? I have often been doing this in ArcInfo workstation, where it is extremely easy - since a coverage can contain both polygon and line topology, and it is easy to figure out which lines that border the "universe polygon" (open sea).
Any tips, scripts, tools are welcome!
#2
Posted 09 July 2007 - 09:26 AM
add your polygon data to ArcMap
run the Polygon to Line tool in Toolbox under Data Management Tools, in the Features toolset
look at the attribute table for the newly created line layer, it should have fields for LEFT_FID and RIGHT_FID
LEFT_ID with value of -1 means there were no features on that edge
(note - if some features with land boundaries had no data next to them for the neighboring land you'll have to select those and change LEFT_FID to -1 for those cases)
You can then symbolize the data with unique values or a query so the coastlines get a different symbol from the land or no symbol
or
create a new field
do a select by attribute and select LEFT_ID = -1
calculate the selected to some value (for example, I often create a text field and set the value to "Ocean" or "coastline")
I hope this helps.
Esri
Product Engineer
Map Geek
#3
Posted 09 July 2007 - 09:37 AM
Now for a follow up challenge - how would one do this in Illustrator? Any takers... ?
For Illustrator - I actually have the coastline already, in a separate layer - so it would be very cool if one could remove where two paths are overlapping - which I don't think you can do (for filled paths, one can, of course, do that)
(note to self - the response here was right on, and came much quicker than my post on the ESRI forums...
#4
Posted 09 July 2007 - 09:58 AM
I'm going to have to remember that trick. I spent a couple of hours last month, hand deleting coastlines, in that same effort. I didn't mind doing the work, but had I know there was an easier way...
David
GIS Manager
United States Marine Corps
West Coast Installations
#5
Posted 09 July 2007 - 11:16 AM
Your my new hero. We've spent countless hours trying to figure out a slick way to do this. Typically we copy the layer we want to turn into an "inline layer" (that's what we call it around here), create a negative buffer and then use the buffer to clip the file. It never works that well and when it does the results are never this clean. This is too easy and saves so much time. Thank you.
#6
Posted 09 July 2007 - 12:06 PM
FME's Dissolver transformer can do this. Simply have it dissolve all polygons and look at the "Interior Line" output.
Red Geographics
Email: hans@redgeographics.com / Twitter: @redgeographics
#7
Posted 10 July 2007 - 06:44 AM
#8
Posted 10 July 2007 - 08:37 AM
Back to ArcInfo workstation, I guess...
(I guess the topology is not correct)
Attached Files
#9
Posted 10 July 2007 - 09:21 AM
Dave - the method works fine with one shape file - but when I try another (the one I really need) then I get problems - the lines are split up into odd polyline segments, and I have segments with -1 here and there where they shouldn't be...
Back to ArcInfo workstation, I guess...
(I guess the topology is not correct)
I check Cartotalk and the ESRI user forums almost every morning during the work week, but I don't check all of the user forums. There are many areas I don't have enough expertise in to be helpful. Other ESRI ppeople check the forums, too, but they're really meant to be user to user forums.
Without seeing your data I can't be sure, but I wonder if there are slivers in your data. Could that be a river with some holes where the river is wide, for example? Of course you would get -1 if there is a hole, no matter how small. You can hardly expect to get different data out than what you put in. So it means doing some clean up before or after the polygon to line tool is run. If it's something you do often enough it may be feasible to build a model that cleans up slivers before converting polygons to lines, possibly even with an option to set the tolerance for slivers.
Sorry, people. (well, I had a day to bask in the glow - LOL)
Esri
Product Engineer
Map Geek
#10
Posted 10 July 2007 - 09:51 AM
I would actually be curious how the polygon-to-line tool works, by the way, since a polygon shapefile doesn't really have topology (right?).
I assume it would be possible to do this exercise and go from shapefile to geodatabase and create topology that way too (since geodatabase feature classes can have topology, right?).
Bonus points to anyone how can spot where in the world that screen dump I posted is located, and when.
#11
Posted 10 July 2007 - 10:03 AM
Doesn't Arcmap 9.x create topology?
#12
Posted 10 July 2007 - 10:23 AM
I ran this yesterday on several different polygon layers and it worked great. We only found one spot where we had to do a little 30 second edit and cleanup and that was it. this is a real time saver. I'm guessing the qualtity of the end-result depends on the qualiity of the polygon layer you start with.
Not sure if it makes a difference or not, but I used Xtools "Polygon to Polyline" tool instead of the "polygon to polyline" in Arc. Do these tools work in the same way?
#13
Posted 10 July 2007 - 10:51 AM
I'm not an expert on this by any means. I just know what worked for me. If it helps others so much the better.
I don't know the guts of how XTools or the Geoprocessing tool do this. And I don't have answers to the other questions. Might be something to Ask a Cartographer - ESRI Mapping Center
p.s. area around Kaliningrad/Koenigsberg (as part of Prussia?). Not sure of the time frame, mid 1600's to early 1700's?
Esri
Product Engineer
Map Geek
#14
Posted 10 July 2007 - 03:49 PM
Dave - the method works fine with one shape file - but when I try another (the one I really need) then I get problems - the lines are split up into odd polyline segments, and I have segments with -1 here and there where they shouldn't be...
Back to ArcInfo workstation, I guess...
(I guess the topology is not correct)
My guess is that workstation isn't going to handle this any better (short of a clean and build after you convert to coverage, which may handle some of it, mainly for the fact of converting the data). Instead try running the ELIMINATE tool . That will take care of slivers and inconsistencies in topology; though it's a bit indiscriminate. Before doing that, check to see if the data is bad using the Check Geometry tool, then if there are problems use the Repair Geometry tool.
Worst case is that the data just has some sloppy errors. I would say put it into a geodatabase, build topology with rules for must not overlap & must not have gaps.
Chief Cartographer
Software Products Department
ESRI, Redlands, California
#15
Posted 11 July 2007 - 02:12 AM
But it did work in Workstation, using this workflow:
* Export to coverage from within ArcMap
* BUILD [coverage] arc
* In ArcEdit, one does an 'aselect' on arc with lpoly#/rpoly# = 1 (universe polygon)
* nselect
* put [new coverage]
And that's it!
Dave you are correct - don't know how far back that border goes though - I don't think it is further than WWII - it is the Soviet/Poland border from post WWII up to the fall of the wall.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users


Sign In
Create Account

Sweden
Back to top
United States
Netherlands









