geocoding

Should I use a struct or a class to represent a Lat/Lng coordinate?

岁酱吖の 提交于 2019-11-27 10:31:14
问题 I am working a with a geo-coding API and need to represent the coordinate of a returned point as a Latitude / Longitude pair. However, I am unsure whether to use a struct or a class for this. My initial thought was to use a struct, but they seem to be generally frowned upon in C# (for instance, Jon Skeet mentions in this answer that, "I almost never define custom structs"). Performance and memory usage are not critical factors in the application. So far I have come up with these two

Check if a geopoint with latitude and longitude is within a shapefile

时光怂恿深爱的人放手 提交于 2019-11-27 10:30:30
How can I check if a geopoint is within the area of a given shapefile? I managed to load a shapefile in python, but can't get any further. Richard This is an adaptation of yosukesabai's answer. I wanted to ensure that the point I was searching for was in the same projection system as the shapefile, so I've added code for that. I couldn't understand why he was doing a contains test on ply = feat_in.GetGeometryRef() (in my testing things seemed to work just as well without it), so I removed that. I've also improved the commenting to better explain what's going on (as I understand it). #!/usr/bin

How do i return coordinates after forward geocoding?

不问归期 提交于 2019-11-27 09:52:23
I am trying to see whether the user is within a certain distance of an address. I have successfully managed to get the users location, and convert the address with forward geocoding. I am left with two sets of coordinates. I am trying to make an if statement saying if they are within "a distance", print something! Currently when i print the coordinates inside the placemark function i get the desired coordinates. When i call them to create eventLatitude and eventLongitude they become 0.0. I know this is a ascycronous problem, but i am unsure on who to resolve this. Can someone give me an

Is there an offline geocoding framework, library, or database for iOS?

一个人想着一个人 提交于 2019-11-27 09:38:50
问题 Is there an (offline) Geocoding framework, library or database for iOS? A place to get the data from? I need to be able to geocode street addresses in cities worldwide (or at least in the United States) into latitude and longitude for sunrise and sunset calculations. The information must be in a format that will work on iPhone OS. (Either a database file or written in C/Objective-C) 回答1: What I would recommend : Get the data from Open Street Maps, the license just implies that you mention the

ggplot centered names on a map

拜拜、爱过 提交于 2019-11-27 07:08:15
I'm attempting to use ggplot2 and maps to plot the names of the counties in NY state. My approach was to find the means of latitude and longitude by county (I assume this is the center of the county but this may be faulty thinking) and then use geom_text to plot the names on the map. It's not behaving as I anticipated as it's plotting multiple names per county. The outcome I'm looking for is that the center of each text (county) is at the center of it's respective county. In addition to solving the problem I'd appreciate helping to understand what's wrong with my thinking with ggplot. Thank

error (429) Too Many Requests while geocoding with geopy in Python

别等时光非礼了梦想. 提交于 2019-11-27 07:03:04
问题 I have a Pandas dataframe with ~20k rows, and I am trying to geocode by address column into lat/long coordinates. How do I use time.sleep() or maybe other function to stop OSM Nominatim from Too Many Requests 429 error that I am getting now? Here's the code I use for this: from geopy.geocoders import Nominatim from geopy.distance import vincenty geolocator = Nominatim() df['coord'] = df['address'].apply(geolocator.geocode).apply(lambda x: (x.latitude, x.longitude)) df.head() Thanks in advance

Converting Longitude & Latitude to X Y on a map with Calibration points

戏子无情 提交于 2019-11-27 06:49:40
If i have a jpeg map with size sizeX, sizeY and some calibration points on the map (X, Y, Lon, Lat) What would be the algorithm for calculating the corresponding XY point in the map with a given Longitude / Latitude pair? Here's what worked for me, without so much bs. int x = (int) ((MAP_WIDTH/360.0) * (180 + lon)); int y = (int) ((MAP_HEIGHT/180.0) * (90 - lat)); The lat,lon coordinates were given to me by Android devices. So they should be in the same standard used by all Google Earth/Map products. If using the Equidistant Cylindrical Projection type map , here is what you need to do: Find

Get latitude and longitude based on location name with Google Autocomplete API

拜拜、爱过 提交于 2019-11-27 06:23:23
I have a textbox in my page which gets a location name and button with text getLat&Long . Now on clicking my button I have to show an alert of latitude and longitude of the location in the textbox. Any suggestion? You can use the Google Geocoder service in the Google Maps API to convert from your location name to a latitude and longitude. So you need some code like: var geocoder = new google.maps.Geocoder(); var address = document.getElementById("address").value; geocoder.geocode( { 'address': address}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { // do something

Usage limit on Bing geocoding vs Google geocoding?

匆匆过客 提交于 2019-11-27 06:18:36
问题 I know that the google geocoding api has a 2,500 hits a day limit before it'll start returning REQUEST_DENIED. How many does the bing one take? I heard that it's unlimited but I had trouble confirming that. 回答1: Bing Geocoding limit mentioned here : http://prazjain.wordpress.com/2009/07/24/using-virtual-earth-bing-geocoding-webservice/ 回答2: Just came across this question. It's a bit old but still relevant. For Bing Maps there are two different ways to geocode address. The first is with batch

Recieving a 403 forbidden error when using latitude and longitude: geocoding

寵の児 提交于 2019-11-27 05:30:14
Our site has the option to insert your postcode in, which in turn works with geocoding to work out the latitude and longitude. This code has not been changed for years but today if the user trys to insert a postcode or update it from yesterday or before the error 'The remote server returned an error: (403) Forbidden.' pops up. The requests have not shot past 2,500 so I cant see Google blocking us because of that.. Any ideas?? The version 2 Geocoding API was turned off September 9th as announced... From Upgrading Your Geocoding API Application To v3 Version 2 ("v2") of the Geocoding API was