[ckan-dev] Spatial extent
Aaron McGlinchy
McGlinchyA at landcareresearch.co.nz
Wed Aug 6 00:06:42 UTC 2014
Further to this, there seems to be some quite subtle things causing problems?
e.g. I got it to work if I changed the coordinates from an exact rectangular box so that the lats/longs did not have the same westwards, eastwards coordinates, or the same nth/south coordinates (hope that makes sense). Also, sometimes if there was a space before each of the last two co-ordinate pairs then it worked, but other times you did not need the space.
Possibly if your 'box' spans the 180th meridian (e.g. 2nd case below) then it may not work? I did eventually get that to work, but the extent is wrong: http://demo.ckan.org/dataset/ross-test (should be a small box around NZ).
e.g. some tested strings (on dataset http://demo.ckan.org/dataset/random-path-across-nz):
Works { "type": "Polygon","coordinates": [ [ [165.4379, -34.4136],[179.2646, -34.3023],[172.5849, -48.9186],[164.6748, -46.9163],[165.4379, -34.4136] ] ] }
Not work { "type": "Polygon","coordinates": [ [ [171.6782, -32.9509],[-178.0107, -37.6444],[172.5849, -48.9186],[164.6748, -46.9163],[171.6782, -32.9509] ] ] }
Not work { "type": "Polygon","coordinates": [ [ [171.6782, -32.9509],[179.8799, -37.5051],[172.5849, -48.9186],[164.6748, -46.9163],[171.6782, -32.9509] ] ] }
Works { "type": "Polygon","coordinates": [ [ [171.6782, -32.9509],[179.8799, -37.5051],[172.5849, -48.9186], [164.6748, -46.9163], [171.6782, -32.9509] ] ] }
Actually, I've now found that sometimes the above work/don't work - seems to be no rhyme nor reason, although inserting or removing the space before last 2 co-ord pairs does sometimes force it to work.
Is there some convention to follow and/or is this a bug (sometimes work, sometimes not with exact same string of coordinates)?
Thanks
From: Aaron McGlinchy
Sent: Wednesday, 6 August 2014 10:48 a.m.
To: 'ckan-dev at lists.okfn.org'
Subject: Spatial extent
Hi,
I'm having trouble specifying the spatial extent for a dataset (around New Zealand in the southern hemisphere, hence -ve latitudes).
West bounding longitude 165.3214
East bounding longitude 179.3214
North bounding latitude -34.7248
South bounding latitude -46.7248
Which gives co-ordinates of a box at:
165.3214, -34.7248 179.3214, -34.7248
165.3214, -46.7248 179.3214, -46.7248
If I put in an extra field 'spatial' with value { "type": "Polygon","coordinates": [ [ [165.3214, -34.7248],[179.3214, -34.7248],[179.3214, -46.7248],[165.3214, -46.7248],[165.3214, -34.7248] ] ] }
I get an error.
The example I followed (in Italy) { "type": "Polygon","coordinates": [ [ [12.0384, 41.9723],[12.773, 42.1604],[12.6824, 41.8092], [12.2957, 41.7967], [12.0384, 41.9723] ] ] }
works fine.
Is there some trick to this e.g. the order of the co-ordinates?
Thanks
Aaron
________________________________
Please consider the environment before printing this email
Warning: This electronic message together with any attachments is confidential. If you receive it in error: (i) you must not read, use, disclose, copy or retain it; (ii) please contact the sender immediately by reply email and then delete the emails.
The views expressed in this email may not be those of Landcare Research New Zealand Limited. http://www.landcareresearch.co.nz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20140806/0987be68/attachment-0003.html>
More information about the ckan-dev
mailing list