Is there a way to retrieve the polygon coordinates of buildings on Google Maps?
I could draw an overlay and grab polygon coordinates manually, then try to determine whether a latitude and longitude are in those coord boundaries. But is there a smarter way of doing this?
The goal is to programmatically understand where a set of lat/lng belong to a building.
Related
On one project , I recovered all the coordinates of the polygons of different postal code.
When I search a zip code, I draw the polygon using the google api.
Now I would like to know whether a given polygon is so much distance from another .
Is that possible ?
By parsing all my geojson , I need to know if a random polygon is 5km from the polygon drawn .
There is computeDistanceBetween method from the geometry library...but its for two points. Is there the same for the distance between two polygons ?
Thx u for your help
Not sure if this would solve your problem but you can somehow use this library to compute distances within your polygon.
BDCCgeo.js
There is a function called bdccGeoDistanceToPolyMtrs(), you can measure the distance between a point and a polygon edge or polyline. Perhaps you can get a certain point on your first polygon and compare with with the second using this function.
Reference:
Distance from point within a polygon to polygon edge
Is there a function in google map that can get the geofence or the polygon area of city? For example i like to get the geofence Manila Philippines. I want to save the polygon Latitude and longitude of the city to MySql geometry column.
At the moment there is no such function. If you search for Manila, Philippines using geocoding you will get the location with the viewport and bounding box. However you won't get a polygon around the area.
One workaround would be to create your own polygons and save them to your database and then check if the lat/long is within those polygons.
I need to draw polyline for the more than one vehicle that are being tracked in our Appln in PHP and google map. Could any one plz tell me how to draw poly line for multiple vehicle with latitude and longitude got from Mysql Database.
You'll have to fish out your lat and lon values per vehicle out of the database, and then use the API to create markers, as explained here
Currently, we can accept the Lat/Long coordinate correctly, and save it correctly, but when we go back to the map later - the pin snaps to the nearest road and not to the exact lat/long we entered.
Has anybody encountered this, and if so, how did you get around this?
place = response.Placemark[0];
point = new GLatLng(place.Point.coordinates[1],place.Point.coordinates[0]);
marker = new GMarker(point);
me.map.addOverlay(marker);
me.map.setCenter(point, zoom);
When we show this, the coordinates snap to the road, not the actual coordinates.
Don't run a coordinate though the geocoding api. If you pass a coordinate to the API it will reverse geocode it. Which is finding the nearest feature.
As you have a coordinate, just build a GLatLng directly with it. parseFloat is recommended.
I want to draw Polylines with the Google Maps JavaScript API. Is there a tool that will help me get the latitude and longitude points by just clicking on the map, then exporting an array of lat-long pairs?
I imagine something like the personalized maps service (My Places) in Google Maps where you can click-snap on the roads to specify your own driving directions. I'd like to take that one step further. That is, to export an array of lat-long pairs that specify the roads traveled.
I know this answer might be a little late but today I was trying to figure out what I believe to be the same issue as this question. So, you can draw the points on the map then get that encoded polyline with Google's Interactive Polyline Encoder Utility then I recommend using Mapbox polyline utility to convert the overview_polyline to latitude and longitude pairs values. The latitude and longitude pairs are also on Googles Utility but it is a bit of a hassle to continuously copy each coordinate.
For more information about the Mapbox Polyline Utility process:
http://zevross.com/blog/2014/09/23/convert-google-directions-to-geojson-points-or-polylines/
And here is Google's Encoder Utility:
https://developers.google.com/maps/documentation/utilities/polylineutility
You can use the Drawing Tools library:
http://code.google.com/apis/maps/documentation/javascript/overlays.html#drawing_tools
which will give you an encoded polyline. You can use that to draw a line, or you can decode it to get the specific points using the geometry library:
http://code.google.com/apis/maps/documentation/javascript/geometry.html