Evaluate geographically distributed data over a polygon
Mostrar comentarios más antiguos
Information on global population is available in gridded format, that is in discrete points spaced in a regular latitude-longitude grid. This information may represent the number of users (people or vehicles) in a quadratic area around the grid point (population density), or certain properties related to the users.
The grid for the data is defined through minimum latitude (latmin), maximum latitude (latmax), step size in latitude (latstep), minimum longitude (lonmin), maximum longitude (lonmax), step size in longitude (lonstep).
The data shall be evaluated across an arbitrarily shaped polygon, representing a region or country. The polygon is defined through a number of points along its edge. The number of users or the properties related to users shall be integrated across the polygon area.
In order to achieve this I want to express the polygon by means of a latitude/longitude matrix, where a 1 is assigned to gridpoints inside (or at edge), and a 0 to gridpoints outside the polygon. The grid needs to be the same as for the user dataset. This polygon matrix POLY can serve as a mask for the dataset DATA. Then I can simply multiply the matrices to achieve a matrix carrying the user data for each point inside, and a 0 for each point outside the polygon.
To generate the polygon I found I can use the poly2mask command. My challenge is that the grid of the resulting matrix is not the same as for the dataset DATA. How can I achieve this?
Is there any alternative way to screen the data through a mask related to a polygon?
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Geographic Plots en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!