Dividing space.gis.Geography space in to grid

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Dividing space.gis.Geography space in to grid

sudheera Navaratne
Hi

      I have a gis.Geography space and GIS agent's  in my system. I want to divide this space in to a grid based on Latitude and Longitude to define agent's placement and territory.

     Is there any libraries I can use? Can I use space.grid ?

Thanks
--
Sudheera Navaratne 

------------------------------------------------------------------------------

_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|

Re: Dividing space.gis.Geography space in to grid

Tatara, Eric R.
I'm not aware of any libraries that will automatically partition the space, nor is the Repast space.grid suitable for this, however it should be a relatively straightforward calculation.  The simplest way is to find your min/max lat lons for the grid you want to define, and simply partition it by the grid size you need, so start at the min lat/lon and add the grid size delta, and then repeat until you reach the max lat lon, in each x.y dimension.  The assumes that you can ignore the distortion caused by the polar coordinate system used by most map projections.  Unless the location is close to Earth's poles, or the grid area is very large, this distortion is minimal for the purposes of dividing the land area to place agents. 

The more accurate approach is to convert a 2D Cartesian grid that you manually create and partition to the map coordinate system.  This can be done via the CRS transform operations in the JTS/Geotools libraries included with Repast.  For example to transform a point geometry from Cartesian to WGS84:
CoordinateReferenceSystem sourceCRS =  DefaultGeocentricCRS.CARTESIAN;
CoordinateReferenceSystem targetCRS = DefaultGeographicCRS.WGS84;
MathTransform transform = CRS.findMathTransform(sourceCRS, targetCRS, false); Point transformedGeometry = (Point)JTS.transform(geometry, transform);
So the approach used with the CRS transform is similar to the partitioning mentioned above, however you partition the space in 2D Cartesian coordinates, assign a 2D coordinate to each agent, and then convert the 2D coordinate to CRS used in your geography projection (eg WGS84).


Eric Tatara, PhD, PE
Software Engineer
Global Security Sciences Division
Argonne National Laboratory

From: sudheera Navaratne [[hidden email]]
Sent: Monday, October 12, 2015 10:14 AM
To: List, Repast
Subject: [Repast-interest] Dividing space.gis.Geography space in to grid

Hi

      I have a gis.Geography space and GIS agent's  in my system. I want to divide this space in to a grid based on Latitude and Longitude to define agent's placement and territory.

     Is there any libraries I can use? Can I use space.grid ?

Thanks
--
Sudheera Navaratne 

------------------------------------------------------------------------------

_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest