Questions tagged [geospatial]

pertaining to the geographic location and characteristics of natural or constructed features and boundaries on, above, or below the earth's surface; esp. referring to data that is geographic and spatial in nature.

Geospatial (adj) Definition: pertaining to the geographic location and characteristics of natural or constructed features and boundaries on, above, or below the earth's surface; esp. referring to data that is geographic and spatial in nature.

[Source]

4809 questions
216
votes
18 answers

Find nearest latitude/longitude with an SQL query

I have latitude and longitude and I want to pull the record from the database, which has nearest latitude and longitude by the distance, if that distance gets longer than specified one, then don't retrieve it. Table…
Basit
  • 16,316
  • 31
  • 93
  • 154
167
votes
16 answers

Given the lat/long coordinates, how can we find out the city/country?

For example if we have these set of coordinates "latitude": 48.858844300000001, "longitude": 2.2943506, How can we find out the city/country?
meow
  • 27,476
  • 33
  • 116
  • 177
128
votes
10 answers

Converting from longitude\latitude to Cartesian coordinates

I have some earth-centered coordinate points given as latitude and longitude (WGS-84). How can i convert them to Cartesian coordinates (x,y,z) with the origin at the center of the earth?
daphshez
  • 9,272
  • 11
  • 47
  • 65
94
votes
2 answers

Criteria SpatialRestrictions.IsWithinDistance NHibernate.Spatial

Has anyone implemented this, or know if it would be difficult to implement this/have any pointers? public static SpatialRelationCriterion IsWithinDistance(string propertyName, object anotherGeometry, double distance) { // TODO: Implement …
Ian
  • 1,619
  • 1
  • 14
  • 23
86
votes
6 answers

Java double vs BigDecimal for latitude/longitude

When storing latitudes/longitudes which are typically of the format: 44.087585 (i.e. max 2 numbers before the dot and 6dp) do I need to bother with bigdecimals?
DD.
  • 21,498
  • 52
  • 157
  • 246
80
votes
2 answers

Function to calculate geospatial distance between two points (lat,long) using R

I have geocoded points in long, lat format, and I want to calculate the distance between them using R. This seems pretty straight forward, yet I can't find a function that will do it easily. I've been attempting to do it with the gdistance…
SteveO7
  • 2,430
  • 3
  • 32
  • 40
71
votes
2 answers

Formulas to Calculate Geo Proximity

I need to implement a Geo proximity search in my application but I'm very confused regarding the correct formula to use. After some searches in the Web and in StackOverflow I found that the solutions are: Use the Haversine Formula Use the…
Alix Axel
  • 151,645
  • 95
  • 393
  • 500
59
votes
7 answers

Developing Geographic Thematic Maps with R

There are clearly a number of packages in R for all sorts of spatial analysis. That can by seen in the CRAN Task View: Analysis of Spatial Data. These packages are numerous and diverse, but all I want to do is some simple thematic maps. I have data…
JD Long
  • 59,675
  • 58
  • 202
  • 294
52
votes
7 answers

MongoDB 'unable to find index for $geoNear query'

I'm just trying to get a simple near query working. Here's a sample of my document. {"point": {"type": "Point", "coordinates": [30.443902444762696, -84.27326978424058]}, "created_on": {"$date": 1398016710168}, "radius": 180, …
frankV
  • 5,353
  • 8
  • 33
  • 46
47
votes
4 answers

How to Convert data frame to spatial coordinates

I have been working on earthquake data that has lat long values, and I want to convert those lat long values to spatial coordinates. Suppose I have the following data set df: longitude latitude 128.6979 -7.4197 153.0046 …
mk04
  • 585
  • 1
  • 4
  • 6
44
votes
2 answers

How does a geospatial index work?

I'm wondering how a geospatial index, such as the one used by MongoDB, works. Can anyone explain what data structure/algorithm is used internally? What time complexity does a search run in? Links to resources would be great too.
Scott Hyndman
  • 923
  • 1
  • 7
  • 15
44
votes
8 answers

Is there an API for openstreetmap?

I wonder if there is any API I could query OSM data through, for example; Are (lon_1, lat_1) at land or at sea? Or could it be possible to get an island as a well-defined polygon? The only usage I've seen so far has just been tools for rendering OSM…
Yngve Sneen Lindal
  • 1,013
  • 3
  • 12
  • 24
43
votes
2 answers

R-Tree and Quadtree Comparison

I want to compare the R-Tree and the Quadtree for geospatial data. While there is literature out there I struggle to find documents that cover real basic comparison. So I decided to ask this question. In my opinion, the R-Tree has the advantage of…
Andre
  • 1,249
  • 1
  • 15
  • 38
43
votes
4 answers

Construct DbGeography point from Latitude and Longitude doubles?

I want to construct a DbGeography point from latitude and longitude doubles. I know I can convert my doubles to strings and use the DbGeography.FromText method. var latitude = 50.0d; var longitude = 30.0d; var pointString = string.Format( …
jcarpenter2
  • 5,312
  • 4
  • 22
  • 49
42
votes
10 answers

How to calculate the area of a polygon on the earth's surface using python?

The title basically says it all. I need to calculate the area inside a polygon on the Earth's surface using Python. Calculating area enclosed by arbitrary polygon on Earth's surface says something about it, but remains vague on the technical…
andreas-h
  • 10,679
  • 18
  • 60
  • 78
1
2 3
99 100