Click here to load reader
Click here to load reader
Jan 06, 2016
A more efficient map overlay method for Terralib
Vincius Lopes RodriguesMarcus Vincius Alvim AndradeGilberto Ribeiro de QueirozMirella Antunes de Magalhes
Universidade Federal de ViosaDepartamento de Informtica
TerraLib: A Component Library for GIS DevelopmentDeveloped by: INPE, Tecgraf/PUC-Rio, FUNCATE Implementation of Small GIS
TerralibTerralib has a geometric algorithms moduleUsed for manipulation of spatial dataContains all basic operations involving simple geometric forms (Points, Lines, Polygons)Spatial data are manipulated in a lower level
TerralibTerralib has also a functional moduleThis module uses basic geometric operations to build functions in a higher level
Map OverlayDescription:Is used to combine the information of two mapsCalculates the geometrical overlay between map polygons and joins the non-spatial information of two maps
Terralibs Polygon OverlayBasic operation for map overlayComputes intersection, union or difference of two polygonsNamed TeOverlay included in kernel of TerralibBased on Margalit and Knotts algorithm
Terralibs Polygon Overlay
Terralibs Polygon OverlayThe computation of the intersection points on the boundaries is essential to obtain the final resultThese points are used to determine the fragmentation of the boundaryThe generated fragments are grouped according to chosen operation
Terralibs Map OverlayLet M1 and M2 be two maps
Suppose that M1 has less polygons than M2
a1a2a3b1b2M1: blueM2: red
Terralibs Map OverlayIn Terralib, the original method proceeds as the following:
for each polygon bi in M1, a spatial query on the database is done, fetching all the polygons on the map M2 which bounding box intercepts the bis bounding box
Terralibs Map OverlayThe operation TeOverlay is applied to determine the intersection between the polygon ai and all polygons returned by the query.
To execute the operation above, it is necessary to determine the intersection points between the borders of the polygons.
Terralibs Map Overlay
All the regions returned by the TeOverlay operation are stored in the resulting map
Each computed polygon has attributes from both the original polygons (maps)
Terralibs Map Overlay ConsiderationsThis operation proceeds many spatial queries on the database that implies a large execution time
The same polygon of the map M2 could be processed twice or more times
An alternative map overlayDeveloped to avoid the database queries
The intersection points are found based on the Bentley & Ottmans plane sweep algorithm.
An alternative map overlayThe maps are full loaded from the database to build two segments sets.
So, the intersection algorithm is used to determine the intersection points between the segments of these two sets.
An alternative map overlayAfter finding the intersection points, a matrix is built to store them.
In this matrix, the position ( i , j ) contains the intersection points between polygon bi from M1 and aj from M2
An alternative map overlayIn this version, TeOverlay was modified to receive as parameter the intersection points previously calculated
For each position of the matrix where the list is not empty, the new version of TeOverlay is called with the respective polygons and their intersection points
An alternative map overlaySpecial case: if a polygon a1 is inside another polygon b1. In this case, the list of intersection points is empty but the polygons intersection is not.To circumvent this case, the algorithm checks if the polygons bounding box intersect each other.If they intersect, only a point-polygon localization is needed
Results Input Maps:
NumberMapNumber of RegionsNumber of segmentsM1Cities MG85361237M2Cities MG (translated)85361237M3Temperature MG20 4659M4Soil MG3067858696M5Cities Brasil5560571747M6Cities Brazil (translated)5560571747
ResultsM1 x M2M1 x M4M1 x M3M5 x M6
Results Time Results
NumberTime (ms)OverlayIntersectionsOutput polygonsTerralibsAlternativeM1 x M215382388518451625037M1 x M3367813232159118626M1 x M4393177437433884172007M5 x M6110232256571554776307913
Future WorkImplement a plane sweep based map overlay
Based on Kriegels algorithm
Does not require database queries and intersection points are determined as result regions are generated
QuestionsVincius Lopes [email protected]???????????????????