1

Topic: Configure new grid reference system

Hi,

Could someone please point me in the right direction...?

In Instant Indicia I need to include a new grid system. It's a 5x5 minute grid (for Namibia). I see where to upload a shapefile in the postgresSQL database, and where to specify it in the iForm settings but there must be some other steps needed to configure it. Is there some documentation somewhere? I couldn't find anything relevant.

Thanks, Alice

2

Re: Configure new grid reference system

Hi Alice,

Spatial reference systems are added as modules in the /modules folder of your warehouse.
Look at the sref_* modules that are present for examples.
Having added a module it has to be enabled in /application/config/config.php.

PostGIS performs transformations between spatial referece systems.
Spatial reference systems that PostGIS knows about are stored in the database template_postgis20 in the spatial_ref_sys table

Resources which may or may not be relevant
http://www.spatialreference.org/ref/?search=namibia
http://www.mme.gov.na/gsn/nam-map-system.htm

Jim Bacon.

3

Re: Configure new grid reference system

Hi Alice

Just to add to what Jim said and hopefully give a bit of background. When a spatial reference is input for a record in Indicia, this is provided as a string, e.g. SU0213 (British National Grid), or 52.3N, -2.4W (latitude and longitude). This is "human readable", but behind the scenes we need to convert this to x, y coordinates which define the square for a grid system or the point for a lat/long. So as an example we could say that underlying a grid square there might be a square which goes from 100, 100 to 200, 200. Or we could say that the lat long example above maps to an x, y coordinate of -2.4, 52.3.

Once we've got these x, y coordinates the system needs to understand how to reproject them into other projections, for example we might need to reproject from the OSGB 1936 projection (used by British National Grid) to the projection used by Google Maps, which is called Web Mercator, if we want to put the grid ref onto a map. Fortunately, as long as we know the internationally recognised code for the projection we are using (called the EPSG code), Indicia can automate this step.

So, in order to allow a new grid system to be used in Indicia you will need to provide a piece of PHP code in a warehouse module, which provides a translation from the text representation of a grid square, to the underlying x,y coordinates which define the square in your local projection. You will also need to provide the reverse operation. Once these things are in place, Indicia can use your grid system.

Any other questions, please ask - I'd love to hear how you get on!

Best wishes
John

John van Breda
Biodiverse IT

4

Re: Configure new grid reference system

Thanks for the clarification, John. I have used the grid in the current (non-Indicia) system with PHP code deriving the grid codes from the lat longs so it should be possible to adapt this code for Indicia. I'll give it a go next week and keep you posted.

Thanks, Alice