polyline to raster and creating a mask

3863
11
Jump to solution
01-15-2016 05:46 PM
TilottamaGhosh
New Contributor III

Hi,

I have downloaded the NGA shoreline data which is in a polyline form. I need to create a RASTER land sea mask with this data. The X,Y resolution of the data should be 0.0041666667, 0.0041666667. However, some of the polylines are not getting converted to rasters if the resolution is kept as such. The easiest way would be to convert the polyline to a polygon and then polygon to raster. However, this is not working, as there are small islands which are being left out, etc. So, I tried converting the polyline to a line raster, and was then trying to create a land-sea mask. However, everything inside as well as outside the polygon is assigned as 'No Data'. So, I am unable to create the mask. Any ideas? I am attaching the shapefile of one of the blocks with this mail. Please note the world shoreline data is divided into blocks, so some of the polygons maybe open ended for this block.

Thanks in advance,

Tilottama

0 Kudos
1 Solution

Accepted Solutions
XanderBakker
Esri Esteemed Contributor

Dan is giving good advice with the help page where he is pointing. It is important to know where you are going to draw the lines. The coordinate I used where based on the extent to the featureclass. Enter the properties van the shore lines and look at the Source tab:

It seem to be cut with vertical lines at 156°E (+156) and 180°E (+180). This will be different with each tile of the data. To give some handy tips on constructing the lines I will include the procedure which isn't complicated.

In ArcMap right click on the layer, and select Edit Features, Start Editing

In the standard toolbar there is button to show the Editor toolbar:

...which will show this Editor toolbar. Click on the Create Feature window

In the create features window click on  "cd06e" and choose Line in the lower part of the window:

Click on F6 to enter exact coordinate:

Specify the exact coordinates (start point) of the line you are going to draw. For instance Long 180 and Lat 0. Click Enter to confirm the location, which will draw the first point. Hit F6 again and specify the end point of the line:

Enter to confirm the second point and press F2 to end the line.

Repeat the process for the second line, and save your edits:

... and stop editing.

That's all it takes.

View solution in original post

11 Replies
DanPatterson_Retired
MVP Emeritus

rather than a polyline showing the shoreline, is there a polygon land mass file?  you could convert that to a raster which would give you land and nodata, you could then reclassify the nodata to sea and the land to nodata if you liked (or whatever combination you need)

0 Kudos
TilottamaGhosh
New Contributor III

Hi Dan,

Thanks for your reply. Unfortunately, there is no polygon land mass file. That would have made the work so much more easy.

Thanks,

Tilottama

0 Kudos
DanPatterson_Retired
MVP Emeritus

And I presume buffering the polyline by a suitable amount didn't prove appropriate?  If you have the advanced licence, you can buffer on one side of the line.  In a perfect world, the polyline would be consistently digitized so that you could buffer inland, then convert

0 Kudos
XanderBakker
Esri Esteemed Contributor

As far as I understand you are interested in converting polygons to raster but maintain small islands that will be lost in the translation. To create the polygons (if you have access to an Advanced license) you can do this:

  • To avoid loosing islands at the borders of the dataset you good create lines at the border. I created two lines going from latitude 0° to -60°. One at longitude 156° and one at longitude 180°

  • Convert this featureclass to polygons using the Features to Polygons tool.
  • The Extra lines at the side will close the open polygons:

  • Next convert the polygons to raster (I added a field with value = 1) to rasterize on.
  • The result shows that many small islands are not represented by pixels (this is normal)

  • Rasterize the original lines to raster (without the two side lines)
  • This will have pixels for the entire shoreline, but NoData for most of the land

  • When you combine the both using for instance cell statistics:

  • You will have a raster where land = 1 and all small islands are included

Please note that even very tiny islands will be represented by the value 1 in the output raster, which actually would be incorrect for the chosen cell size.

DanPatterson_Retired
MVP Emeritus

elegant solution!

TilottamaGhosh
New Contributor III

Hi Xander,

Thanks a lot for your detailed solution. I will surely try it. However, if you could please let me know how to create the polylines at the specific latitudes and longitudes like you have done in the first step.

Thanks,

Tilottama

0 Kudos
DanPatterson_Retired
MVP Emeritus

You can do it manually in an edit session What is editing?—Help | ArcGIS for Desktop

XanderBakker
Esri Esteemed Contributor

Dan is giving good advice with the help page where he is pointing. It is important to know where you are going to draw the lines. The coordinate I used where based on the extent to the featureclass. Enter the properties van the shore lines and look at the Source tab:

It seem to be cut with vertical lines at 156°E (+156) and 180°E (+180). This will be different with each tile of the data. To give some handy tips on constructing the lines I will include the procedure which isn't complicated.

In ArcMap right click on the layer, and select Edit Features, Start Editing

In the standard toolbar there is button to show the Editor toolbar:

...which will show this Editor toolbar. Click on the Create Feature window

In the create features window click on  "cd06e" and choose Line in the lower part of the window:

Click on F6 to enter exact coordinate:

Specify the exact coordinates (start point) of the line you are going to draw. For instance Long 180 and Lat 0. Click Enter to confirm the location, which will draw the first point. Hit F6 again and specify the end point of the line:

Enter to confirm the second point and press F2 to end the line.

Repeat the process for the second line, and save your edits:

... and stop editing.

That's all it takes.

TilottamaGhosh
New Contributor III

Hi Xander,

THANKS VERY VERY MUCH!!! As Dan has rightly said, 'Elegant solution' indeed. Thanks so much for answering all my queries with elaborate illustrations. You have helped me solve this problem!

Thanks again.

Best,

Tilottama

0 Kudos