Converting XML Polygons into Google Maps - javascript

I have a XML (KMZ) file with polygons that refer to geographical areas, like counties and states, and I want to be able to read this data into googlemaps.
I'm thinking it can be done more conveniently for me in 2 ways:
a) Parsing the xml file into inserts into a Oracle Database
b) Reading the xml directly from my google maps page using Javascript. (Data would be placed in arrays, I presume).
Either way, does anyone have some tips on how to do this efficiently?
Maybe someone made a great part of the code needed to do this already.
Thanks

Maybe try the google maps API v3, https://developers.google.com/maps/documentation/javascript/layers#KMLLayers
Regards, Lea.

Related

GPS Data with HTML

I'm working in a project where I have to collect data from a GPS Module (NMEA data) and pass it to an html application so I can display exact location of the device on a Google map. I have created the map using the google maps api but I'm unsure of how to pass the NMEA data through my application. What would be the most efficient way to do this? Thank you.
If you use Google's My Maps (this is a very easy method to get your own map in your own HTML page) you can import GPX data straight into the map. You just need to convert your NMEA data to GPX.
If you're comfortable with the command line GPSBabel looks relatively simple to use (there are a couple of GUIs available if needed). Alternatively, OpenStreetMap has some other alternative methods that you can try.

QGIS - Creating a map that uses live data

I am very new to qgis and qgis server, which I have downloaded the plugins of Openlayers, and qgis2web with qgis 2.18. As an added note, I have a wordpress site which the map will go into. I have created a map with multiple layers. Hooked up database's data to it to populate what midwest state counties people had went to, who had went to those counties, and how many times they have been to that county. Even colored coded it to show case results. Now I am ready to put the map on the web. Here is my Question: How do you put the map on the web so it will show live data from our database we are using?
I have create a map using qgis2web and exporting it and then use place it within my wordpress's wamp server and was able to display it using an iframe. BUT, I assume it only created that one static instance of the map. If the datbase were to update, it will not show the correct mapping results. In so, I want to keep the map constantly connected to the database so it will show live data. How would I show live data and having the map constantly update? I think I have downloaded the qgis server as well, and hopefully set that up correctly. Was thinking of doing that way as well, but no luck. Any help where to start, or what to do is appreciated.
You might want to consider using Rethinkdb. It pushes JSON to your apps in real time. https://github.com/rethinkdb/rethinkdb
When you export a map using qgis2web it will export your layers as a static files. Using the latest version (2.22.0) it goes into the "data" folder and will create a .js file with the geographic information stored as a geojson (https://en.wikipedia.org/wiki/GeoJSON). Now for a feed with live data this will definitely not work.
To achieve a live feed there are a number of ways to build one. There are certain services like Qgis Cloud (https://qgiscloud.com/) or Carto (http://carto.com/) that allow you to do that. However, these service might not necessarily suit your needs. (In Carto's case only the base functionality is free of charge. The features for building a live feed cost.)
If you want to build it yourself I'm not aware of a "simple solution". There are quite a few different ways to build a web GIS. In short you'd need your geodatabase (like postgres with postgis), a map server software (like geoserver) that renders the geographic information in the database as WMS/WFS services that in return can be visualised using Openlayers, Leaflet or other javascript libraries. The resulting map can be implemented on your site (Some CMS come with plugins that ease the process of implementing mapping services. I don't know about wordpress though).
In any case, it is probably best to just refer to already existing answers and tutorials:
https://gis.stackexchange.com/questions/8113/how-to-start-web-mapping

Use Google My Maps Polygons in my API

Here is what I would like to achieve :
I have a Google My Maps map, with a few polygons over a city, representing districts.
On the server side of my application, I would like to create a tool that, when given a position, can return me the polygon it is into.
Is it even possible ?
Maybe My Maps is not the good service, if so, I am totally open to work with something else.
One option is to use the geoxml3 kmz branch with a binary proxy to access the .kmz data from Google MyMaps, that will render your data as native Google Maps Javascript API objects. Then you can use point in polygon tests to determine which polygon your input point is in.
Point in polygon example (using another third party library, a version of epoly, ported to the Google Maps Javascript API v3).
Example rendering MyMaps output using the kmz branch of geoxml3
(Note: I couldn't make your data work, there were character encoding issues that made the KML invalid).

Calling Google Visualization API Server-Side

I'm working on a project that involves exporting some HTML reports on a website into PDF format. I'd like to use the excellent flying-saucer Java library to do this but my major stumbling block is that several of these reports use the Google Visualization API to generate charts with JavaScript. Flying-saucer doesn't currently support parsing/executing JS, so those charts don't show up in the generated PDF file.
I was hoping to work around this by seeing if there was some kind of web service I could call instead via server-side code that would return the chart image in Base64 as a variable that I could reference in my view instead of getting it via JS.
The old Google Image Charts API is exactly what I'm looking for, but it has unfortunately been deprecated and it looks like it's slated to be removed completely by next year, so it's not an option.
I'm hoping Google has a newer alternative. If not, is there some other method that's recommended? Thanks!
You can call the getImageURI method of the chart to generate an image/octet stream URI. You can send that data to your server, and you should be able to reconstruct the chart as a .png image file. I've never tried to do this server-side, so I'm not sure precisely how you would go about it, but this java tutorial might be of some assistance to you: http://www.programcreek.com/2009/02/java-convert-image-to-byte-array-convert-byte-array-to-image/
Years ago I wrote Eastwood Charts which implemented the Google Image Charts API as a servlet, backed by JFreeChart, so that you could generate charts without having to rely upon Google, or send your data to their servers. :-)
I don't maintain Eastwood Charts anymore (like Google, I can't be relied upon either) but it is open source and the code works so you might find it helpful. You could also modify it to meet your own requirements, which is something that wasn't possible with the Google service.

Is it possible to get building data from Google Maps?

Is it possible to manipulate or duplicate the building data (landscape.man_made) for Google Maps? I've been Googling about building data, but not really turning anything up. I'd like to be able to enhance the existing map to add live shadows (for example). Thanks in advance, obie
Unfortunately it's not possible to access the raw data behind the Maps API.

Categories

Resources