I have about 100k locations stored in a MySQL server.
I want to plot this in a map, but when I export it to a .csv file and then convert to .kml file, the file size exceeds 20mb, whereas Google Map API has limits of 3mb for .kml file.
The .csv file is about 2.5mb, but I cannot load .csv files into Google Map.
Is there any way I can do load the locations to a map?
Use Google Fusion Tables - they support 100,000 points per layer and 5 layers in toto. They are lightning fast too as you access them via an SQL-type language that runs on Google's servers - exactly where your data will be when you upload it.
You load your CSV into a Fusion Table in your Google drive and get a key to that table and you then use the key in your Javascript.
I created the following website with Fusion Tables and I am a zero in Javascript! See Skyscan website here.
Related
Why does website performance improve very significantly when (for example, 100,000) markers are loaded on Google Maps from a Google Fusion Table versus loading the markers from a locally stored JSON file storing the same data
FusionTablesLayer uses tile based rendering (the tiles are rendered on Google's server), loading a DataLayer from a JSON file doesn't, your browser loads the file locally, then renders the data.
I have a little problem, I'm work on a map with politic division, but when I try to load the KML file in Google Earth work fine, then I publish this KML and I try to use them in Google Maps, but not work, I read that Google Map have some restrictions, like size of files, and limit of Points, but then How I can display correctly my Map, I also have the data in a DataBase.
In this moment, I'm using FusionTables and work very well, but in my job don't want use FusionTables.
I have some option? (Server Side Processing, Load some KML instead of one or something)
thanks in advance.
Excuse me for my English.
You can:
try a KMZ file (raw KML in a KMZ can be bigger, up to 10MB)
use a third party KML parser (no limits on size, but may have performance problems)
break your KML into multiple files that meet the restrictions.
KML reference on limits, looks to me like a KMZ (compressed KML) file will work for the data you have described.
Maximum fetched file size (raw KML, raw GeoRSS, or compressed KMZ) 3MB
Maximum uncompressed KML file size 10MB
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.
I need export line coordinates from KML. I use some KML2CSV export tools. but this programs cant read my kml. Error: Read Error.
WHY i need coordinates:
I`v kml which there pipelines of regions. i must show this coordinates on google map without KML..
I hope that I can explain to yours.
One solution: Google Fusion Tables
One way to extract coordinates from your KML is to upload your KML to Google's Fusion Tables.
If Google Earth parses your data then most likely you'll be able to import into a Fusion Table.
Short-cut to create a "Fusion Table" is simply clicking "Create a Fusion Table" from here and pick your KML file. The direct way to create Fusion Table is login to Google Drive (aka Google Docs) then click "Create" and under "More" pick "Fusion Table" and import your KML file.
After it's imported you have lots of visualization options to try online.
You can also select "Download" under File menu and export the data back as a CSV or KML file.
http://support.google.com/fusiontables/answer/2548807/
However, CSV export of KML import in Fusion Tables exports a KML geometry (not a separated latitude/longitude field) so you can further edit the resulting file in a text editor and strip off the KML markup.
1,"<Point><coordinates>-122.536226,37.86047,0.0</coordinates></Point>"
Google Fusion Tables also allows programmatic access through a RESTful API with SQL-like queries to insert, update or delete rows of data.
UPDATE: Google Fusion tables will be retired in Dec 3, 2019 after which will no longer work.
Validating KML
If you're unable to use other KML2CSV converters then your KML probably has some invalid elements preventing it. Google Earth can still render badly formed KML so when you need to use that KML elsewhere you need to validate the KML data.
You can use the Galdos KML Validator. Also suggest some tips to validate your KML.
This should help here, you have to made a small change to your kml file: save it as a xml file, and then use excel to get what you want.
I need to create images of GPS paths on top of google maps satellite information. The ultimate goal is to import those images in a report that is being created in an Excel program that is run through userforms & VBA.
I'm having trouble coming up with a way to automate the generation of these images. Preferably the user would not have to install additional software and there would be a way of automating this process using VBA. I would like to use the Static Google Maps API, but that is limited by the number of characters in an HTML request (2048 as I understand) and my path data is easily going to exceed that length.
Let's assume for now that I have a single KML file with my GPS path data.
Any thoughts on a way to convert large KML path files into static maps image files using VBA? I'm imagining VBA opening a local HTML file with a dynamic google map, uploading the KML file, and somehow capturing and saving a screenshot of the KML data loaded onto the dynamic google map.
FYI I'm locked into using the existing Excel/VBA forms-based program to generate these reports.
(new to this board and relatively new at programming so please let me know if my description is lacking. thanks)