3

I'am creating a python script tool for ArcGIS Desktop 10.1 to extract profiles. I’m using stack profile to extract values to a table but stack profile only outputs values where the line and raster overlaps.

My solution to create profiles that will start at the beginning of my line is to find the distance between the start of the line and the start of the raster and then offset the x-axis. But how do I find this distance (marked with blue in picture below) with arcpy/python?

Update: the solution needs to work with floating point raster dataset pix

0

My suggestion would be to use the Raster to Polygon (Conversion) tool on each of the two rasters, using non-simplified output. You could then use each of the resulting feature classes to erase the overlap from the original line features calculate the length of the remaining end portions.

  • Good Idea. But Polygon to Raster only works with integer raster dataset and I need it to work with floating point. – Mathiaskopo Aug 28 '14 at 16:07
  • I didn't realize that. What a dumb shortcoming! If you have Spatial Analyst you could use Int to create an integer version, since the polygons are only used for their geometry and not their values. – nmpeterson Aug 28 '14 at 16:13
  • yes of course, I will try again – Mathiaskopo Aug 28 '14 at 16:17
  • Thanks a lot. Your solution will work for me. Since there can be gaps in the raster datasets I will use Multipart To Singlepart on the remaining lines to get the distance – Mathiaskopo Aug 28 '14 at 16:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.