Jump to content

 
Photo

remove coastline

- - - - -

  • Please log in to reply
18 replies to this topic

#1
frax

frax

    Hall of Fame

  • Associate Admin
  • PipPipPipPipPipPipPip
  • 2,312 posts
  • Gender:Male
  • Location:Stockholm, Sweden
  • Interests:music, hiking, friends, nature, photography, traveling. and maps!
  • Sweden

Hi,

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!
Hugo Ahlenius
Nordpil - custom maps and GIS
http://nordpil.com/
Twitter

#2
DaveB

DaveB

    Hall of Fame

  • Validated Member
  • PipPipPipPipPipPipPip
  • 1,054 posts
  • Gender:Not Telling
  • Location:Redlands, CA
  • United States

One way I've done this is as follows (I don't know if this is the best way, but it works; works best with data where all or most features have land neighbors represented by polygons and water represented by no data) -
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.
Dave Barnes
Esri
Product Engineer
Map Geek

#3
frax

frax

    Hall of Fame

  • Associate Admin
  • PipPipPipPipPipPipPip
  • 2,312 posts
  • Gender:Male
  • Location:Stockholm, Sweden
  • Interests:music, hiking, friends, nature, photography, traveling. and maps!
  • Sweden

Thanks Dave, that was exactly what I was looking for! Seems like it was simpler than I expected - I didn't know that the polygon to line tool included those attributes - now I have to play with it...

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...
Hugo Ahlenius
Nordpil - custom maps and GIS
http://nordpil.com/
Twitter

#4
David T

David T

    GIS Manager, USMC, MCIWEST-MCB Camp Pendleton

  • Validated Member
  • PipPipPipPip
  • 192 posts
  • Gender:Male
  • Location:San Diego, California
  • United States

Dave -

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
David Toney, GISP
GIS Manager
United States Marine Corps
West Coast Installations

#5
ELeFevre

ELeFevre

    Hall of Fame

  • Associate Admin
  • PipPipPipPipPipPipPip
  • 1,050 posts
  • Gender:Male
  • Location:Louisville, Colorado USA
  • Interests:Cartography, Music, GIS, Coffee
  • United States

Dave,
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
Hans van der Maarel

Hans van der Maarel

    CartoTalk Editor-in-Chief

  • Admin
  • PipPipPipPipPipPipPip
  • 3,888 posts
  • Gender:Male
  • Location:The Netherlands
  • Interests:Cartography, GIS, history, popular science, music.
  • Netherlands

And for a non-Arc solution...

FME's Dissolver transformer can do this. Simply have it dissolve all polygons and look at the "Interior Line" output. ;)
Hans van der Maarel - Cartotalk Editor
Red Geographics
Email: hans@redgeographics.com / Twitter: @redgeographics

#7
frax

frax

    Hall of Fame

  • Associate Admin
  • PipPipPipPipPipPipPip
  • 2,312 posts
  • Gender:Male
  • Location:Stockholm, Sweden
  • Interests:music, hiking, friends, nature, photography, traveling. and maps!
  • Sweden

To separate the coastlines in Illy is actually not that difficult, by the way - one just merge all the country polygons and then you have it ready. The boundaries are more difficult.
Hugo Ahlenius
Nordpil - custom maps and GIS
http://nordpil.com/
Twitter

#8
frax

frax

    Hall of Fame

  • Associate Admin
  • PipPipPipPipPipPipPip
  • 2,312 posts
  • Gender:Male
  • Location:Stockholm, Sweden
  • Interests:music, hiking, friends, nature, photography, traveling. and maps!
  • Sweden

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)

Attached Files


Hugo Ahlenius
Nordpil - custom maps and GIS
http://nordpil.com/
Twitter

#9
DaveB

DaveB

    Hall of Fame

  • Validated Member
  • PipPipPipPipPipPipPip
  • 1,054 posts
  • Gender:Not Telling
  • Location:Redlands, CA
  • United States

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)
Dave Barnes
Esri
Product Engineer
Map Geek

#10
frax

frax

    Hall of Fame

  • Associate Admin
  • PipPipPipPipPipPipPip
  • 2,312 posts
  • Gender:Male
  • Location:Stockholm, Sweden
  • Interests:music, hiking, friends, nature, photography, traveling. and maps!
  • Sweden

Thanks anyways Dave - the dataset that caused me problems has regions, and has been edited and reprojected a few times (originally based on the ESRI data & maps country dataset, I think). Exporting it to a coverage and doing the trick there worked very smoothly, and was easier than I remembered, so that solved everything. Going from shapefile to coverage rebuilds the geometry and creates topology, without slivers.

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.
Hugo Ahlenius
Nordpil - custom maps and GIS
http://nordpil.com/
Twitter

#11
MapMedia

MapMedia

    Hall of Fame

  • Validated Member
  • PipPipPipPipPipPipPip
  • 1,029 posts
  • Gender:Male
  • Location:Davis, California
  • United States

Frax - for bonus point, what scale is it?

Doesn't Arcmap 9.x create topology?

#12
ELeFevre

ELeFevre

    Hall of Fame

  • Associate Admin
  • PipPipPipPipPipPipPip
  • 1,050 posts
  • Gender:Male
  • Location:Louisville, Colorado USA
  • Interests:Cartography, Music, GIS, Coffee
  • United States

Dave,
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
DaveB

DaveB

    Hall of Fame

  • Validated Member
  • PipPipPipPipPipPipPip
  • 1,054 posts
  • Gender:Not Telling
  • Location:Redlands, CA
  • United States

Hi guys,

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?
Dave Barnes
Esri
Product Engineer
Map Geek

#14
Charlie Frye

Charlie Frye

    Master Contributor

  • Validated Member
  • PipPipPipPip
  • 112 posts
  • Gender:Male
  • Location:Redlands, CA
  • Interests:Base map design/data model, political/election maps; use of historical maps for modern GIS analysis
  • United States

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.
Charlie Frye
Chief Cartographer
Software Products Department
ESRI, Redlands, California

#15
frax

frax

    Hall of Fame

  • Associate Admin
  • PipPipPipPipPipPipPip
  • 2,312 posts
  • Gender:Male
  • Location:Stockholm, Sweden
  • Interests:music, hiking, friends, nature, photography, traveling. and maps!
  • Sweden

Charlie - those things didn't help - tried both ELIMINATE and CHECK/REPAIR GEOMETRY.

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.
Hugo Ahlenius
Nordpil - custom maps and GIS
http://nordpil.com/
Twitter




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

-->