dvdoug / PHPCoord

PHPCoord is a PHP library to aid in handling coordinates. It can convert coordinates for a point from one system to another and also calculate distance between points

Home Page:https://www.phpcoord.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature request: support Irish grid

robations opened this issue · comments

As far as I can tell (I don't have much experience with GIS) this would be very similar or the same as the OSRef, just with a few different constants. I've been trying to follow along here to implement this:

https://www.ordnancesurvey.co.uk/docs/support/guide-coordinate-systems-great-britain.pdf

though so far pretty confused by the various standards, and statements like "this is not a transformation", which begs the question, "what is and isn't a transformation?".

I managed to implement this by copying the OSRef class as IrishGridRef and changing the relevant constants. It seems to work, at least to the low precision I need at the moment.

Obviously this isn't a maintainable solution, but doing this properly will need some refactoring to avoid repeating all the logic that's currently in OSRef::toLatLng(). If you're interested I could perhaps look at this and submit a PR.

Yes, I'd happily take a PR to add support

Now available in v2, but please note I refactored and changed the API a bit so it's not a drop-in upgrade

That's great — I didn't ever get back to this and I've been avoiding coding outside work for sanity reasons :)