45

You can get polygon coordenates in json for using with googlemaps using openstreetmap. Go to http://nominatim.openstreetmap.org/ search a place like "Partido de Ituzaingó" click on "details" Look for OSM ID and copy it (control+c), example: 2018776 paste the ID in http://polygons.openstreetmap.fr/index.py and download the polygon


20

I can use Google Maps in OpenLayers 4.2 like this under my WMS layer and its perfectly fitted with EPSG:3857 projection: new ol.layer.Tile({source: new ol.source.TileImage({ url: 'http://khm{0-3}.googleapis.com/kh?v=742&hl=pl&&x={x}&y={y}&z={z}' })}) Why do you need a plugin? JSFiddle link for ROADMAP new ol.layer.Tile({ source: new ...


18

To get polygon boundaries just add format=json to your request! So instead of https://nominatim.openstreetmap.org/search.php?q=Warsaw+Poland&polygon_geojson=1 use https://nominatim.openstreetmap.org/search.php?q=Warsaw+Poland&polygon_geojson=1&format=json By adding &format=geojson you can get a valid geojson response


15

Mehul, I used to work in the address verification industry with a company called SmartyStreets. There are lots of geocoding services out there, but only few will support batch processing with the volume you require. (Google and others don't permit bulk use of their API or storing/caching results.) If you go to your MySQL database and perform an export of ...


11

If you like Python, you could use the GeoPy API, combined with the GDAL Python bindings or Fiona, and create a very basic script like this for converting the addresses to a point shapefile. This will geolocate a file named 'addresses_to_geocode', creating an output shapefile named 'my_output.shp' in my_output folder: import os from geopy import geocoders ...


10

you can check out k-means clustering algorithm here. In data mining, k-means clustering is a method of cluster analysis which aims to partition n observations into k clusters in which each observation belongs to the cluster with the nearest mean. This results into a partitioning of the data space into Voronoi cells. kmeans-postgresql implementation ...


10

Firstly, it is possible to add your own data on top of Google Maps, using Google Maps API. For example, this and this page show two different ways of adding a WMS service on to of Google Maps. You can easily add vectors as overlays. OpenLayers has many advantages as compared to Google Maps API, including: It is completely Open Source and standard compliant....


10

Here is some code I'm successfully using to toggle a Fusion Tables layer in one of my maps: google.maps.event.addListener(map, 'zoom_changed', function() { zoomLevel = map.getZoom(); if (zoomLevel >= minFTZoomLevel) { FTlayer.setMap(map); } else { FTlayer.setMap(null); } }); it looks almost identical to your code, apart ...


9

In other implementations (as in, our implementation) this is done with palette modification; you can quickly recolor a PNG image without touching the actual data, if you know the full original palette. Google doesn't do that; they likely have a tile-based database and tiles of vector data that are rasterized on the fly.


9

Drag Marker and Geocoder with Coordinates https://gmaps-samples-v3.googlecode.com/svn-history/r49/trunk/draggable-markers/draggable-markers.html Entire code: <html> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false">&...


9

I have put together a simple function for you: function markerCoords(markerobject){ google.maps.event.addListener(markerobject, 'dragend', function(evt){ infoWindow.setOptions({ content: '<p>Marker dropped: Current Lat: ' + evt.latLng.lat().toFixed(3) + ' Current Lng: ' + evt.latLng.lng().toFixed(3) + '</p>' }); ...


8

You could give Leaflet Maps Marker Wordpress Plugin a try Pin, organize & show your favorite places through OpenStreetMap/WMTS, Google Maps/Earth (KML), GeoJSON or Augmented-Reality browsers http://www.mapsmarker.com/


8

I think this is not so hard a problem to solve but I have my doubts about whether the accuracy is absolutely correct. First of all, you have to convert your center lat/lon to pixels with gdal2tiles codes. If I find some time and if you want, I can convert it to stable code for finding corner coordinates. This is a Python code: tileSize = 256 ...


8

Firstly you need to make sure that your WKT string is properly formatted. After that you can use a custom function to parse the string, and draw a polygon. I could use the following code: var wkt="POLYGON(...)"; //this is your WKT string //using regex, we will get the indivudal Rings var regex = /\(([^()]+)\)/g; var Rings = []; var results; while( ...


7

Comment to Answer Google Map v3 API can use JSON Examples: github.com/JasonSanford/GeoJSON-to-Google-Maps – Mapperz♦ Apr 18 at 13:54


7

I'm not sure what tool you are using, but look into linear referencing methods. For example, if you are using PostGIS, here are 10 random points along a linestring: SELECT ST_Line_Interpolate_Point('LINESTRING (10 20, 50 60, 80 30, 140 60)', random()) FROM generate_series(1,10) Or if using Shapely: from random import random from shapely.geometry import ...


7

It really depends on your users requirements. I recently started a project in the Google Maps API, where I overlaid some services from ArcGIS Server and had some basic queries going on. I wanted to use Google, so that I could legally incorporate their Streetview/Geocoding/Traffic APIs into my map. As this would be a public facing application, I also ...


7

There are two approaches. One is brute-force: write code to find the distance between a point and a polygon, and then iterate over all polygons. The second involves building efficient data structures, an arduous process. For the first approach, you might look at this Wolfram Demonstration Project for computing the distance from a point to a polygon. Link ...


7

According to links provided by Andre Joost, I found the translation. And this is the projection for google.maps: function MProjection() { } MProjection.prototype.fromLatLngToPoint = function(latlng) { var x = (latlng.lng() + 180) / 360 * 256; var y = ((1 - Math.log(Math.tan(latlng.lat() * Math.PI / 180) + 1 / Math.cos(latlng.lat() * Math.PI / 180)) /...


7

1) There's a bit of code you can add to your spreadsheet and run a macro. The instructions are detailed here: https://vilimpoc.org/blog/2013/07/11/google-spreadsheet-geocoding-macro/ 2) CartoDB can pull in a google doc spreadsheet directly from your account, then you can export it back out: 3) Download your Google Drive Spreadsheet to a CSV, then use the ...


7

Yes, you can use custom tiles with Android Maps API v2 - you can see a fully working example in our OpenTripPlanner for Android app on Github. (You can also download the app directly from Google Play) We support the following tile providers: LyrkOpenStreetMap MapQuestOpenStreetMap Mapnik CycleMap Google (normal, satellite, hybrid, terrain) Our ...


6

Officially you have to create tiles for your Panoramic image to become streetview controlled: Providing Custom StreetView Panoramas Function(pano,zoom,tileX,tileY):StreetViewPanoramaData The Maps Javascript API V3 supports the display of custom panoramas within the StreetViewPanorama object. Using custom panoramas, you can display the interior of ...


6

check out this example here which uses arcgis service time geoprocessing service and google maps. if your points locate in US, u can use CreateDriveTimePolygons from ESRI here. you need to do is that write Input Location, Drive Times and format as json then execute your process. beside this you should check out similar ques.: Creating drive time polygons ...


6

There is the Route360 API that also works with Google Maps. https://developers.route360.net/index.html It offers quiet a few functionalities. Including different modes of transportation or the intersection of polygons As well you can add a few hundred points at once and see the result: It works for most countries in Europe and North America


6

I think you will find numerous answers to similar questions on our site by searching the geocode tag. A few that stick out are: Geocoding API Comparison Bulk Geocode 20 million records What reliable GeoCoding service would you recommend me? Is there an open source Geocoding tool which can be used commercially? Geocoding that's anonymous, good, and free - ...


6

Get the x,y coordinates of the boundaries of countries from the following website Natural Earth (thanks, Devdatta Tengshe) which has more accurate data than others I've tried. Then use ArcGIS 10.2 to open the map shape file and select the boundaries you need. Go to data management tools --features-- features vertices to points and open the generated table. ...


6

The file sizes you are using are far too big to be using GeoJSON rendered as vectors on the client-side. It will be slow to download and also bog down the browser as it struggles to render all of the geometry. The best practice for medium to large size datasets is to render them as images on the server and send those images to the client. I build a lot of ...


6

In the following lines you are trying to refer to a DOM element that does not exist: document.getElementById("lat").innerHTML = location.lat(); document.getElementById("lon").innerHTML = location.lng(); So in your HTML you would have to add an element like a div or a span, that you can give an id. I would use a span, so you can stay in the same line ...


5

you can achieve this with Google Maps JavaScript API v3 - Directions Service. There is a doc here. and you can see stand-alone google example here. and in this doc. you can get information about Travel Modes. When you calculate directions, you need to specify which transportation mode to use. The following travel modes are currently supported: ...


Only top voted, non community-wiki answers of a minimum length are eligible