3

I would like to know whether it is possible to plot points automatically on a map in ArcGIS by using a raster file as a reference.

The image below would represent an example of line that comes from thresholding procedures using OpenCV. Each point would be plotted following the white line (in contrast with the black background):

enter image description here

I would have done it manually but the number of lines if huge.

My view would have been to ask ArcGIS to recognize the white pixels positions and affect a coordinate for each pixel. The output would be a table that can be exported in a .csv file.

If someone has a better idea or you think it is not possible, I would be happy to hear your thoughts.

Edit

Only points actually. I though about coding something similar the following.

We extract white pixels only:

for i in range(img.shape[0]):
    for j in range(img.shape[1]):
        if img[i][j] == "255":
            ... to be defined

Then we call the Raster To Point tool from ArcGIS to convert white pixels only into points:

arcpy.RasterToPoint_conversion("image_with_white_pixels.jpg", "c:/output/source.shp", "VALUE")

Then I guess I would define the coordinate of the points using the Add XY Coordinates tool (from Data management toolbox).

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
JrCaspian
  • 31
  • 1
  • 1
    So you want an automatic method to trace a line along the path? – nickves Apr 27 '16 at 10:07
  • 1
    Check out this thread: http://gis.stackexchange.com/q/166753/8104. Essentially, they convert the raster to contour (polyline). Then you could simply convert the polyline vertices to points. This may be a more efficient approach than converting raster to points directly, Additionally, this approach will have the added benefit of being able to filter out line segments smaller than some threshold to remove the extraneous features (i.e. prior to converting to points). – Aaron Apr 27 '16 at 12:08
  • As a new user please take the [Tour] where you will see that we are looking for a focussed question in each question. At the moment you seem to be just trying to discuss some ideas you have. – PolyGeo May 01 '16 at 06:30

0 Answers0