Number of points inside polygon is returning 0 but should be a bigger number
Show older comments
Hello, I am working with this code where I generate random points inside a polygon then I superpose another polygon inside the first one and check for number of points that fall inside a the second polygon. The number of points return 0 when it should not be. The data plots fine. but the result value is 0 for both in and on. The code below shows the loop that does that. X_pop_trim,Y_pop_trim already defined. See code below
4 Comments
KSSV
on 15 Oct 2021
We cennot check your code as the values are not given. Show us complete code with data, so that we can check.
Cris LaPierre
on 19 Oct 2021
I got the following errors:
Error using load
Unable to find file or directory 'Guam_PFD_Contour_1arc_noBerm262mtest.mat'.
Then
Invalid shapefile C:\Users\...\MATLAB Answers\tl_2019_66_tract.shp.
[basename, ext] = checkSHP(basename,shapeExtensionProvided);
= openShapeFiles(filename,'shaperead');
Perhaps try zipping your 3 shapefiles and attaching that?
Mini Me
on 19 Oct 2021
Accepted Answer
More Answers (0)
Categories
Find more on Create Plots on Maps in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

