2

I have a project that requires timezone lookup for given coordinates. http://efele.net/maps/tz/world/ is an awesome resource however the polygons only cover land. Sydney Harbour is considered seas in the shapefile, even though parts of it are 5km from the coast. Sydney Area Timezone map

I'm currently solving it in PostGIS with; SELECT * FROM timezones WHERE ST_DWithin(geom,ST_SetSRID(ST_Point(151.268421, -33.840613), 4326)::geography, 22224) ORDER BY ST_Distance(geom, ST_SetSRID(ST_Point(151.268421, -33.840613)::geography, 4326)) LIMIT 1;

This approach is costly and overly complex. Does anyone have a shapefile which includes territorial waters (12 nautical miles from the coast) or know how I could bloat/swell the shapefile from http://efele.net/maps/tz/world/ to include territorial waters but not overlap?

It doesn't have to be perfect, picking the closest land mass in area's like this would be suitable. Complex territorial water timezone area

Gregology
  • 199
  • 7
  • 1
    Have a look at what Geoscience Australia has http://www.ga.gov.au/scientific-topics/marine/jurisdiction/maritime-boundary-definitions, I'm sure I've seen a world map there with oceanic political boundaries... all the data from GA is free to download and use. – Michael Stimson Jul 06 '16 at 01:48
  • Thanks @MichaelMiles-Stimson, I couldn't find world oceanic political boundaries, but they had lots of other awesome maps in the catalog http://www.ga.gov.au/oracle/agsocat/geocat_brief.php?maxrecords=100000 – Gregology Jul 06 '16 at 02:39
  • 1
    If you're keen to use the data you have you could try Thiessen it http://gis.stackexchange.com/questions/6971/is-it-possible-to-create-thiessen-polygons-around-nodes-in-qgis ... The workflow I would use is: buffer by negative a few km, vertices to points, Thiessen and dissolve. That would cover the gaps with a closest polygon then you can use 'within' operator on that instead of trying to calculate nearest polygon for each request on-the-fly. – Michael Stimson Jul 06 '16 at 02:45
  • Thank you @MichaelMiles-Stimson, I followed your suggestion. I had to jump between QGIS and PostGIS. Results here for anyone interested -> https://github.com/gregology/territorial-timezones – Gregology Jul 12 '16 at 01:25

2 Answers2

1

There is a new source of timezone maps as shapefile or geojson at https://github.com/evansiroky/timezone-boundary-builder. The data from that project is sourced from Open Street Map.

Evan Siroky
  • 251
  • 1
  • 4
0

I calculated the closest landmass using QGIS by simplifying the original multipolygons, converting to points, and then calculating a Voronoi diagram. Simplification was required because of processing limitations. The original multipolygons were buffered using PostGIS to 22.224km and simplified as accuracy in the ocean was not a concern of mine. PostGIS was significantly faster than QGIS for the buffering process. I intersected and dissolved the results to create a map with the original land borders and simplified coast including territorial waters. The process has significantly simplified the coastal shapes reducing the shape files from 35.8MB to 14.5MB without affecting land borders.

You can find more details and downloadable shape files here.

Gregology
  • 199
  • 7