Access to KML tree - google-maps-api-3

I have some rutes in KML format and I can't modify them. I want to draw them on a map but I also want to get the fist and last points to check for near cities and interesting places.
The problem that Google Maps API does server-side procesing and I cannot access individual elements form it. I searched and tried to use a parser like GeoXML but it's not exactly what I want because it uses its own map style an so on and I have to use Google API maps. I only do need to acces certain elements of KML tree and i will draw them using Google Maps API.
Can anyone help please? Thanks in advance for answer in these vacation days(for some).

You can use the standard KmlLayer in Google Maps for rendering, and then use a 3rd party library like GeoXML (or your own code to read the XML) to grab whatever data you need from the KML and run additional functions based on that.

Related

Is the located in information available on any google api?

As an example Google Maps place result. Features information about whether a location is within a larger complex. The google search result knowledge pane features this same information.
Is this available on a google api that can be queried via third party applications?
I could not find it, from what I could tell google uses its own geo polygons to work out whether something is inside a location.
So I went with using https://nominatim.openstreetmap.org/search.php?q=Australia&polygon_geojson=1&format=json to get the location polygons and GeoDjango + Postgis Example.
Hope this helps someone else out there.

Google Maps API: Directions Service on Custom Maps

I am in need of importing custom roads into Google Maps, (ie: new roads that may not yet be visible in Google Maps) and I would like them to be included in the Directions Service API. The approach I was thinking about first, was to use Google Maps Engine to import a shapefile containing the road data of what I need and create a map based on that. Then I would use the Directions Service on the data in that Custom Map. I am very wary as to if this will work, and as far as I can tell there isn't a trial version of Google Maps Engine that I can use to test this out. And I really don't want to purchase it if it isn't going to work anyway.
Does anyone know if this way will work, or if there is a similar service that Google provides that will work for what I require?
I assume I will need to implement my own directions service if I want to do this, but I want to see if there already is a service out there that will instead.
Thanks!
EDIT:
To try and clarify:
I want to import a set of custom roads obtained by an alternate source. These roads are in a shapefile format and are more up-to-date than some of the roads on Google. What my goal is, is to use the existing google roads, and "merge" the data that I have where necessary. Say in the far north of Alberta Canada a company has put some roads in for getting to their oil site. I want to import those roads and be able to tell our drivers how to get there. They would take a main highway that google already has, and then turn onto a road that doesn't show up on google because it is too new. This is where the alternate data set of roads would come in.
I want to find the best way to do this, while obtaining directions that incorporate those new roads. I understand that this may not be possible using google services, but I am asking in case someone else has come across this problem.
I guess I should update this to my solution, in case anyone else was wondering the same thing. The answer is NO, currently there is no way to import custom data like roads into Google Maps and have them be included in the directions service. I have talked to a Google representative on the phone, and they have let me know this.
I had to implement my own routing engine, which I did using PostgreSQL, PostGIS, and PgRouting.

How do I quickly draw a map

I am trying to export the layers (land, street, street names) separately from either google maps, openstreetmap.org, maperitive.net (or if you have a better recommendation).
The end goal is to have a custom marked up map but I need to make sure the land is the same and most of the roads line up. Any recommendations out there?
You'll need to get the raw XML data from OpenStreetMap for your area. For anything other than a tiny area, this might be a huge file. There's an API for this but you don't mention a language but I know there's bindings to Python and R.
Once you've done that, extract the bits you want according to the OSM data definition - basically you select XML elements by attribute tags using whatever XML parser is included in whatever language you are using.
Then you'll have a vector data set which you need to render as a map. For that you can use Mapnik, which is what OpenStreetMap use to put labels in the right place, draw good-looking lines etc etc.
This is all pretty hard work. Maybe you could just use some maps from an existing provider? It sounds like you want something simple - have you tried Stamen.com's 'Toner' map?
http://maps.stamen.com/toner/#12/37.7619/-122.3930

Openlayers vector layer

I want to have a vector layer of the world, which shows the country borders, states and their names in English. Is there a layer that exists that I can control the colours?
Cloudmade doesn't let me quite do this, nor does openstreetmap and a bunch of others. I'm thinking I might need to create a raster image and overlay that except I dont know where to get an accurate EPS/vector map I can edit and overlay.
Running out of options!
You have different options depending of your needs:
The easiest one is to use a public
WMS service that offers the
information you need. You can check
catalogues like this one or a
Google search like this. If
your are lucky to find a service
that suits you, just add it as a WMS
layer in OpenLayers as described in
this example.
If you can't find a public service, you will have to serve the
geographic data yourself. You have
to find a dataset of the world
countries (the most common formats
are ESRI shapefile and KML).
If you find a shapefile (try here), you will
have to serve it via a map server like
MapServer or Geoserver.
Both are pretty straightforward to
set up, but choose the one that suits you best (MapServer is a CGI and Geoserver is Java-based). Once you have configured a WMS service with the countries data, you can add it to your OpenLayers app following the previous example.
If you can't or don't want to use a map server and you have a KML file of the world countries, you can also add a vector layer to OpenLayers from a KML file, as described in this example. Be careful, because all geometries will be rendered in the user's browser (with SVG or VML) and for large datasets, this can be a performance issue. Check this example to see it in action.
I hope this give you a few clues.

Geographical Data Visualization in a Web Application

I've got a request to implement a visualization service for geographical related data.
I have a list of Italian ZIP Codes (they are called CAP in Italian). I've already found a table which maps these ZIP codes to geographical coordinates (lat/long).
So, the data I have to visualize as map is structured the following way:
ZIPcode Latitude Longitude RequestCount
------- -------- --------- ------------
Is there an easy way (using a web service or implementing it myself using a component - preferably in .NET) for creating a map chart similar to the image i inserted below? It needn't to be that pretty and not necessarily geo-political.
I just need a indicator for every point which shows a smaller or bigger circle and next to it the value of RequestCount. I think this could be done either using the coordinates or, if there is some service which maps the Italian ZIP codes, using the ZIP code.
Thank you in advance!
alt text http://img515.imageshack.us/img515/3814/carsalesuh6.png
GeoNames offers a data set and open source libraries for geo mapping
Take a look at .net Charting and Chart FX Maps (I've never used these before).
Maybe...
Use the Google Map API. You can't draw circle overlays, but you can draw polygons. Here's the API for drawing polygons. An 8-sided polygon already looks pretty circle like. You could experiment with more sides to see how that looks.
Here's the API reference for the Google GPolygon class:
http://code.google.com/apis/maps/documentation/reference.html#GPolygon
I've used MapServer for many projects and it works well and is very flexible. Haven't tried the .NET bindings though:
http://www.paolocorti.net/2006/09/20/mapserver-tutorial-for-c-mapscript-asp-net/
I've used Fusion Maps for things like this. It is flash based with a javascript API. You can easily feed it either a static XML file to start, but I've also built various webservices to give it dynamic capabilities. There are many options to change the look and feel of the map as well.
take a look at Mapv - a library of geography visualization
enter image description here

Resources