I am working with a huge area, 7 states of forest and nonforest using the NLCD data. Within some of the forested areas is a plot (this is my master's thesis I am working on). I have stumped everyone I have asked with this large dataset but we are certain there is a resolution out there. The forest/nonforest area is a signed and discrete raster. I was able to make the forested area into polygons by subsetting out the forested area. I am not able to make the nonforest area into polygons (too large). So I was trying to get point distance (the point is within the polygon) to the edge of the forested polygon. Do you have suggestions for getting the distance of a point to the forest edge?
相关问题
- How to get a fixed number of evenly spaced points
- Union of many (more than two) polygons without hol
- How to add a “hole” to a Circle Polygon (Google Ma
- Android Google Map Polygon click event [duplicate]
- Polygon from a grid of squares
相关文章
- How to make holes in a Polygon in shapely python,
- How to check if a polygon is empty in Shapely?
- Draw a rectangle arround a polygon when given in c
- Greiner-Hormann clipping with degeneracies
- Fill polygon with pattern doesn't work with le
- How to draw an arbitrary irregular polygon with n
- How to determine a diagonal is in or out of a conc
- Solving a cubic to find nearest point on a curve t
if you aren't sure that the point is within the outer polygon, test that first. Then, to test for the distance to closest forest edge, you could try something like this:
http://www.bdcc.co.uk/Gmaps/BdccGeo.js
Google has a wealth of results for 'distance from point to polygon edge'
Here is some code that output the distance from a point to an edge, wether the polygon is convex or not, CCW or not. You'll have to test for all your polygons' edges. It might be a little slow for a large set of edges.
Well, this really does depend on a couple of things; specifically, which edge do you want? Do you want to find the nearest edge, or do you have some other criteria that you want to select an edge by (for example, cardinal direction)?
If you want to find the nearest edge, you basically want to iterate across all of the line segments the polygon defines, doing a line-segment-to-point distance calculation; this will find your distance. There's a good implementation of the algorithm in Python on this question, and there's some good description of the algorithms there.