Download full KML from Google Maps - google-maps

I have Google Map with about 1200 points. When I try to save it as KML or view in Google Earth there is only 1000 point. Is there a way (for example using some API) to download all points (I don't need KML - I just want coordinates with description - it may be in some other format)?
Map can be found here. When you save KML there will be no points from 6th page.

Apparently there is a 1000 feature limit on exports from My Maps:
Restrictions
#4. There is a 1,000 feature limit on a single My Maps export, and approximately 1,000
in displaying KML - so large maps wont particully benefit from this trick. Wont show an
error just the first 1000 points/lines/features.
See this post on the google map product forum for a workaround to export all the points, Barry Hunter also recommends (and I concur) using FustionTables if you need to display more points on a map (sounds like you don't need to display them on a map, just retrieve the data from your map).
Seems to work, here is a combined file displayed on Google Maps (goes up to 1193)
geoxml3 reports 1197: geoXmlDoc: Object -> placemarks: Array[1197]

Related

How to create a polygon on Google map using list of GPS location

I have a list of customer (GPS coordinates) for each salesman in excel file. I want to create a polygon in Google map that shows area of each salesman in map.
Is there any tool that shows my salesman area in the Google map ?
For the first step it is easier to use Google Earth.
To display data you need a google kml file.
Create a placemark, and use the Polygon.
More, see https://developers.google.com/kml/documentation/kml_tut
To display a kml in google maps, the file has to be located on a server reachable by an url.
Ffor goggle earth a local file on your disk is sufficient.
For this problem, you may want to use a concave hull algorithm. You can read more in depth at https://gis.stackexchange.com/questions/39205/converting-point-sets-to-polygon-boundaries
In JavaScript, you can use https://www.npmjs.com/package/concaveman.

KML file from Massachusetts GIS - display in Google Maps API

I've been pulling KML files from the Mass GIS service via their export feature:
http://maps.massgis.state.ma.us/map_ol/oliver.php
For example, a KML output of Population Density per Square Mile looks like this when exported:
http://evrkusd.fatcow.com/populationpersquaremile.kml
I try to add it to my Google Map and nothing shows up, although this code works fine with other kml files from other sources.
var NewLayer = new google.maps.KmlLayer('http://evrkusd.fatcow.com/populationpersquaremile.kml');
NewLayer.setMap(map);
I'm getting the idea that some of the kml tags are outdated or are not accepted by Google Maps API.
Is anyone able to get this file to work for them? Any ideas how I can (preferably easily) update this file to work with Google Maps? I'm going to be using multiple KML files like this, so I'm hoping I can do a fairly quick fix.
Your KML file is still too big:
http://www.geocodezip.com/geoxml3_test/v3_geoxml3_kmltest_linktoB.html?filename=http://www.geocodezip.com/geoxml3_test/populationpersquaremile.kml
If you click on the "load KmlLayer" button, it will show you the status return by attempting to load that file in KmlLayer:
Kml Status:DOCUMENT_TOO_LARGE
Your "partial" KML files are not valid xml, if I make the one you posted valid, it works with geoxml3, but the Google Maps API v3 KmlLayer still says it is too big.
See the documentation, the maximum fetched size of a raw KML file is 3M, your file is 7M+.
Fusion Tables can handle much larger KML than client-side maps, up 100MB total (though some limits apply to features). So that might be a solution.

Mobile localisation app based on kml layers

I'm trying to develop a mobile app that locates the nearest location. I'm using Phonegap, Google Maps API v3, and KML layers to show the locations. I came up with this workflow:
1. The main view contains an autocomplete search box , so that once the user starts a search:
The query is sent to a service that will filter and generate a KML file for the results.
So here I am not using Google Maps Distance API; the service will retrieve the user's lat and long and then generate KML files which will contain the user's location and sorted matching results.
Finally we use the KML file with Google Maps for rendering the results.
Is this the right way to go about doing things?
Or is the Google Maps Distance API more accurate than manually calculate the distance using some maths?
Thank u in advance.

Can I show a single country (masked out) in GoogleMaps?

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 :)

google maps multiple line segments

this question is kind-of programming related but not exactly - see how we go...
I am trying to view a trip i have made using a gps tracking device onto google maps as one continuous line, however, when i upload the KML file onto google maps it is arbitrarily broken into about 7 different segments.
The trip was made in one go and when shown in google earth it is shown as one continuous line.
I have inspected the KML file and all coordinates are contained within the same single linestring element.
Does anyone know why this is occuring?
Regards
Grant.
It looks like other people have experienced the same problem that you're having, but I was unable to find a solution. It seems that this is just a bug in the Google Maps KML parser.
If you don't mind creating your own map with the Google Maps API, you should be able to parse the file with no problem. There are also some sites like this one which will create a map from your KML file.