Where can I get postal codes for all countries?
My guess is that your lost friend is GeoNames.
My guess is that your lost friend is GeoNames.
Edit As of 2013, most links below are not functional anymore. However, I’ve found the cited paper, algorithm included, still available at this (very slow) server. Here you can find a project dealing exactly with your issues. Although it works primarily with an area “filled” by points, you can set it to work with a … Read more
I’ve got XML for US state polygons here. I use them like this. I deliberately kept the detail fairly light to reduce the loading time and end up with a map that’s reasonably responsive in slow browsers. I don’t have anything for Canada.
To deal with the body of water problem is going to be largely a data issue, e.g. do you just want to miss the oceans or do you need to also miss small streams. Either you need to use a service with the quality of data that you need, or, you need to obtain the … Read more
My approach is to use USGS Elevation Query Web Service: private double getAltitude(Double longitude, Double latitude) { double result = Double.NaN; HttpClient httpClient = new DefaultHttpClient(); HttpContext localContext = new BasicHttpContext(); String url = “http://gisdata.usgs.gov/” + “xmlwebservices2/elevation_service.asmx/” + “getElevation?X_Value=” + String.valueOf(longitude) + “&Y_Value=” + String.valueOf(latitude) + “&Elevation_Units=METERS&Source_Layer=-1&Elevation_Only=true”; HttpGet httpGet = new HttpGet(url); try { HttpResponse … Read more
graphs databases like Neo4j are a very good fit, especially as you can add different indexing schemes dynamically as you go. Typical stuff you can do on your base data is of course 1D indexing (e.g. Timline or B-Trees) or funkier stuff like Hilbert Curves etc, see Nick’s blog. Also, for some live demonstration, look … Read more
I found an interesting article describing how to do exactly what you are looking to do. TL;DR: Use Shapely You will find this code at the end of the article: import json from shapely.geometry import shape, Point # depending on your version, use: from shapely.geometry import shape, Point # load GeoJSON file containing sectors with … Read more
This simple code works for me: new L.Draw.Polyline(map, drawControl.options.polyline).enable(); Just put it into the onclick handler of your custom button (or wherever you want). The variables map and drawControl are references to your leaflet map and draw control. Diving into the source code (leaflet.draw-src.js) you can find the functions to draw the other elements and … Read more