I want to extract city specific data from OSM for Finland. I have the data for Finland but I need the data for only 5 cities: Helsinki, Espoo, Vantaa, Kauniainen and Siuntio. I could extract the required data for Helsinki, but I need the city borders for the rest of the cities (so I can make a polygon of that). If I have the polygons I can extract the required data with osmconvert
Can you help me with information on how to extract the borders for these cities?
Do you know any open api that provides me these information?
Thanks to Roland Olbricht I've managed to resolve my problem. You can find information related to this question on this site. The solution is the following:
generate the boundary with overpass api http://overpass-api.de/api/interpreter?data=(rel[name='Helsinki'];>;);out;
you can change optionally 'Helsinki' to the city's name for which you want to generate the boundary
after you downloaded the data you can convert it to a polygon with this script. You can find information on how to use the script in it's upper section.
if you want to visualize the downloaded boundary, rename the interpreter file's extension to .osm and use QGIS (Quantum GIS) to display the borders. To load the osm file's data you'll need to install and activate the OpenStreetMap Plugin for QGIS. To install the plugin open QGIS and select Plugins>Fetch Python Plugins from the menu. On the plugins tab search for "openStreetMap plugin" and then hit install. You can activate the plugin by selecting Plugins > Manage plugins and by checking the check box for OpenStreetMap plugin.
Related
My application should allow users to store events and their locations and then perform search on them - so I need those locations in my database with their names and latitudes/longitudes. Google API doesnt allow storing anything else but place IDs so I have to find something else that can autocomplete/suggest places on UI and allow storing it my database.
Does anyone know such a good service?
You can simply add your points in your DB based on each point Lat & Long values. So when user is searching somewhere you have his current location(Lat-Long), Therefore you can search in your DB and get the distance of each saved point with current location and retrieve the results you want to show (i.e in JSON format).
In client-side use some auto-complete jquery library to show the nearby places and somethings like that (with additional information).
Google Map API has a service that you can show some custom marker on the map with your custom configuration like marker icon, description and etc. You can show your additional information in description as HTML format.
You can see some example here:
Customizing a Google Map: Custom Markers
Hope these tips would be helpfull. Regards.
Suddenly I've found an answer that helps me:
https://productforums.google.com/forum/#!topic/maps/hNc1OOU6Zm8
So I can use some Google's data under some conditions.
I'm currently working on a school project that implements Google Maps overlayed with data stored in shapefiles and a xml file with a bitmap in it and the WGS coordinates where the image should be overlayed.
The web application that needs to be build requires that a user uploads these raw files, and the result should be visible in the Google Maps.
Is there any way to convert these shapefiles to .json, using PHP or javascript, and get the coordinates stored in the .xml file to get the WGS coordinates. This needs to be done web-based, so stand-alone tools and software won't be sufficient.
These coordinates and .json files than need to be stored in a database, and these records will be used to put on the Google Maps with the appropriate overlays on the resulted coordinates.
Thank you in advance.
All of the processing will need to be done on the server side. I was able to find a shapefile reader class written in php here,
http://www.phpclasses.org/package/1741-PHP-Read-vectorial-data-from-geographic-shape-files.html
It sounds like you have a pretty decent handle on how you need to go about solving the rest of the problem from there.
js-shapefiles-to-geojson script renders shapefiles and dbf files entirely on the client-side, in the browser.
repo: https://github.com/wavded/js-shapefile-to-geojson
demo: http://wavded.github.io/js-shapefile-to-geojson/
Looking to the do what the title says - produce a world map image that colors particular countries. I'm open to platform - Processing or Python/Basemap preferable. Web based service ok if it has an API.
Anyone have direction on this?
have you looked at GIS? There are a number of open source and free clients that allow you to work with various maps (probably .dwg) with various corresponding data in xml format to produce geographical visualizations through queries and you can export a number of formats. I think this would give you either the visualization that you want or the data to plug into processing or whatever to create it.
Get the map data in shapefile format, look at python bindings to OGR and GDAL, or maybe try Fiona: http://sgillies.net/blog/1095/fiona/ or SciPy, or just download Qgis www.qgis.org and learn some GIS skills.
Country-level shapefiles for the world are fairly widely available www.gadm.org maybe.
Google Geomap did the trick here.
It's part of their chart visualizations tools. A javascript call that returns an SVG map colored according to data that you provide.
Is it possible to mask away neighbor countries in GoogleMap? In my case I just want to show Sweden on one view. On a second view just Norway, Denmark etc etc...
I know it is possible to draw polygon lines and fill them accordingly on to Maps API. Problem is that or the result sets get huge or the lines get very rough etc... Would be nice if GoogleMaps could deliver a country at the time without neighbors.
Does anyone know about a good coordinate database with country borders?
You can create very complex polygons in Maps without a drop in performance if you store them in KML file format and load them as KmlLayers. KML is an XML based vector file format for geo data. The beauty of using KML files in Google Maps is that they are rendered on Google servers into simple PNG files, matching the current resolution and bounding box of your Maps view at any time, no matter how complex the original polygon data is. So all complexity is handled server side at Google.
Here is a sample of a project, where I have used such a masking for one of the federal states of Germany. (The surroundings in this case are not fully masked away but only dimmed. But you can also mask them off just as easily by changing the alpha value of the fill color in the KML file.)
For a quick review KML files can also be loaded directly into the Google Maps public website (by entering their URL into the search field). Here is the KML file that I have used in the above project, loaded directly into Google Maps. (I have actually used a KMZ file here, but that is simply a KML file packed into a ZIP archive. You can pack and unpack it with normal ZIP tools.) BEGIN UPDATE 07/2015: Unfortunately Google has REMOVED the possibility to directly enter the URL of a KML/KMZ file into the search field of their public Google Maps when they launched its redesigned version in 2014. You can still use all techniques discussed in this answer but you cannot simply preview KML files by entering their URL in the search field anymore. If you need the KMZ mentioned above for further analysis, you can download it here. END UPDATE
Please be aware that Google implies a size limit to KML/KMZ files (currently 10 Mb uncompressed, 3 Mb compressed - details see here). If your KML files should be to large, there is software available to reduce the complexity (see examples here and here).
You will find free map data at many places on the Internet, most of them being in ESRI shapefile format. A great source for country maps is http://www.gadm.org/ with the big advantage of providing their data in KML/KMZ format too. If you should have to convert ESRI shapefiles to KML, have a look at the great (and free) OGR converter.
Please notice that KML files are only a solution if your polygons are static (like the border of Sweden is) and not depending on any user input. For dynamic polygons you will still have to use the Polygon class of the Maps API with the complexity restrictions that you have mentioned.
had a similar problem and managed it by combining gamps with fusion tables:
var table_id = 420419; //can be exchanged wit another table
var FT_Query = "SELECT 'kml_4326' FROM "+ table_id +" WHERE 'name_0' NOT EQUAL TO 'SWEDEN'";
var FT_Options =
{
suppressInfoWindows: true,
query: FT_Query
};
var layer = new google.maps.FusionTablesLayer(table_id, FT_Options);
layer.setMap(map);
Have you considered loading in a custom map?
I haven't used it myself, but hopefully that link could help you out a bit :)
I want to extract the latitude and longitude of a set of about 50-100 pins in a Google maps web page. I don't control the page and I don't need to do it more than once so I'm looking for something quick and dirty. I've got FireFox with FireBug as well as Chrome and all I need is something that's easier than re typing all the numbers.
Simply click the link shortcut on the map to retreive a URL for the map with pins in.
Next add &output=kml to the end of this url and use the link to retrieve a kml file containing all the pin data.
This kml file is actually in xml format so parsing it should be easy, you just need to look for <coordinates> elements which contain the latitude and longitude data you need.
The kml format is documented here: http://code.google.com/apis/kml/documentation/kmlreference.html
Just saving the .html file and using regex works:
These two reg-ex might be good starting points:
#[0-9]+\.[0-9]+,-[0-9]+.[0-9]+",geocode:"",sxti:"[-#A-Za-z .]+"
{id:"[A-Zloc0-9]+",fid
Google has change a lot the way you can extract information about google.maps and has set some limitations like numbers of queries by day.
To extract the lat and lon of Google maps you need a bit of knowledge about HMTL code and manipulating JSON/XML files. (all can be found in many tutorials.
I recommend you to extrac the data using de "Google Places API" it's VERY EASY! and you can extract about 150k locations by day for free. You have to get an account, activate your privileges of API Places (turn on/off buttom), get you secret KEY and then use a simple URL to extract the JSON/XML file. Here are two great links for that:
[1] https://developers.google.com/places/documentation/search?hl=en
[2] https://developers.google.com/places/training/basic-place-search?hl=en
If you want DETAIL info about the coordinates that you'll get, go to the section "Requesting Place Details" in the second link, that gives you info about what kind of site is that, the phone number and all the comments that users has made, if they are available.
Great coding and greetings!
Depending on the type of the map and whether the pins are set by latitude and longitude or by address, it might even work to just get the link (click on "Link" at the Google Maps page, the URL in the browser might not be the sam) and look for the "sll=[...]" parameters.