We need to get a reliable and updated world map (named mundi in the SQL script below) with ISO3166-1-alpha2 country codes in the country-polygons, and with reliable topology. I need also (named utm_cells in the script) a compatible tile of UTM cells.
So, the first part of the question is "where I get these maps?" (better if it is simple to import with SQL+PostGIS tools)
The "preparation process" at this Open Knowledge's datasets/country-codes project is expressed by the SQL-OGC-compliant script below:
-- Get neighbor_list column for country-codes.csv SELECT m.ISO3166_alpha2 as ref_country, array_agg(scan.ISO3166_alpha2) as neighbor_list FROM mundi AS m INNER JOIN mundi AS scan ON (m.geom && scan.geom) and ST_Touches(m.geom, scan.geom) WHERE m.id>scan.id; -- Get utmzones_list column for country-codes.csv SELECT m.ISO3166_alpha2 as ref_country, array_agg(scan.zone) as utmzones_list FROM mundi AS m, utm_cells AS scan WHERE (m.geom && scan.geom) and ST_intersects(m.geom,scan.geom) So, a complementar question is "this process can be accomplished by other (simpler) tool or script?", perhaps an online tool...Or a existent database with the same or part of data.
We need that the full process is simple and easy to reproduce... But simple not only for me, but for "GIS community"... So a secondary question is "it seems simple for you?", "if you have also source preparation scripts, you accomplish the task in 15 minutes?".
أكثر...
So, the first part of the question is "where I get these maps?" (better if it is simple to import with SQL+PostGIS tools)
The "preparation process" at this Open Knowledge's datasets/country-codes project is expressed by the SQL-OGC-compliant script below:
-- Get neighbor_list column for country-codes.csv SELECT m.ISO3166_alpha2 as ref_country, array_agg(scan.ISO3166_alpha2) as neighbor_list FROM mundi AS m INNER JOIN mundi AS scan ON (m.geom && scan.geom) and ST_Touches(m.geom, scan.geom) WHERE m.id>scan.id; -- Get utmzones_list column for country-codes.csv SELECT m.ISO3166_alpha2 as ref_country, array_agg(scan.zone) as utmzones_list FROM mundi AS m, utm_cells AS scan WHERE (m.geom && scan.geom) and ST_intersects(m.geom,scan.geom) So, a complementar question is "this process can be accomplished by other (simpler) tool or script?", perhaps an online tool...Or a existent database with the same or part of data.
We need that the full process is simple and easy to reproduce... But simple not only for me, but for "GIS community"... So a secondary question is "it seems simple for you?", "if you have also source preparation scripts, you accomplish the task in 15 minutes?".
أكثر...