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
29
votes
7 answers

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

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.
Gerald Bäck
  • 445
  • 1
  • 5
  • 7
29
votes
5 answers

How does one represent MongoDB GeoJSON fields in a Mongoose Schema?

MongoDB 2.4 allows the use of GeoJSON objects and a slew of neat functions and indexes that I'd like to use. It expects GeoJSON objects to be stored in the format like: loc: { type: 'Polygon', coordinates: [[[-180.0, 10.0], [20.0, 90.0], [180.0,…
Aaron Silverman
  • 22,070
  • 21
  • 83
  • 103
28
votes
3 answers

Distance between 2 POINTs in Postgis in srid 4326 in metres

This is probably a simple question, but I'm not very good at PostGIS and don't fully grok all of this. Basically I have a table (nodes) with a POINT column (point). I have created an index on this column create index nodes__points on nodes using…
Amandasaurus
  • 58,203
  • 71
  • 188
  • 248
27
votes
6 answers

Convex hull of (longitude, latitude)-points on the surface of a sphere

Standard convex hull algorithms will not work with (longitude, latitude)-points, because standard algorithms assume you want the hull of a set of Cartesian points. Latitude-longitude points are not Cartesian, because longitude "wraps around" at the…
27
votes
2 answers

Querying within longitude and latitude in MySQL

Before asking for specific code examples, I just wanted to ask whether it is possible to make a query something like this pseudo code: select items from table where lat/lon = -within x miles of a certain lat/lon point- Is that doable? Or do I have…
Genadinik
  • 18,153
  • 63
  • 185
  • 284
25
votes
7 answers

How to use Redis and geo proximity search to find two users at the same location?

I want to implement a service that, given users' geo coordinates, can detect whether two users are at the very same location in real time. In order to do this in real time and to scale, it seems I should go with a distributed in-memory datastore…
Simian
  • 1,622
  • 3
  • 17
  • 32
24
votes
1 answer

Why use st_intersection rather than st_intersects?

st_intersection is very slow compared to st_intersects. So why not use the latter instead of the former? Here's an example with a small toy dataset, but the difference in execution time is huge for my actual set of just 62,020 points intersected…
syre
  • 902
  • 1
  • 7
  • 19
24
votes
1 answer

Pandas Latitude-Longitude to distance between successive rows

I have the following in a Pandas DataFrame in Python 2.7: Ser_Numb LAT LONG 1 74.166061 30.512811 2 72.249672 33.427724 3 67.499828 37.937264 4 84.253715 69.328767 5 72.104828 33.823462 6 …
edesz
  • 11,756
  • 22
  • 75
  • 123
24
votes
6 answers

How to import Geojson file to MongoDB

Since Geojson is actual json I thought i could to use mongoimport to load data into my MongoDB database from a .geojson file. but i'm getting the following error: exception:BSON representation of supplied JSON is too large: code FailedToParse:…
OscarVGG
  • 2,632
  • 2
  • 27
  • 34
23
votes
5 answers

Converting lat/long to JTS?

I am trying to integrate hibernate spatial with JPA for Geo searches. I have been referencing the tutorial on the official site (I am not associated with hibernatespatial). The tutorial, unfortunately, does not cover how to create a Point instance…
Werner Altewischer
  • 10,080
  • 4
  • 53
  • 60
23
votes
8 answers

geospatial queries in javascript

I'm looking for a library in javascript that would allow me to make geospatial queries. I know about OpenLayers and GoogleMaps, but this two do not support things like union intersection and so on. +----+ | | | +-+--+ +--+-+ | | | …
wolktm
  • 263
  • 3
  • 10
23
votes
4 answers

MongoDB print distance between two points

When I am firing this query on MongoDB, I am getting all the places in the proximity of 500 miles to the specified co-ordinates. But I want to know the exact distance between the specified co-ordinates and the result location. db.new_stores.find({…
work_in_progress
  • 747
  • 1
  • 10
  • 27
23
votes
3 answers

Create & Find GeoLocation in mongoose

I'm trying to save the longitude/latitude of a location in my user Model and query it with $geoNear. I've looked at almost any page I could find on that topic, but still I'm not sure how to 1) create the model appropriately and how to query…
Markus
  • 1,565
  • 6
  • 26
  • 57
23
votes
6 answers

Python, GEOS and Shapely on Windows 64

When trying to install Shapely on my Windows 64bit computer, I cannot get the GEOS library to work. So far, I have run the OSGeo4W installer from which I installed GDAL (I believe the geos library is included in that package). After that, I checked…
Juan Carlos Coto
  • 11,900
  • 22
  • 62
  • 102
22
votes
2 answers

ggplot map with l

I want to plot a world map using ggplot2 (v.9) which combines two pieces if information. The following example illustrates: library(rgdal) library(ggplot2) library(maptools) # Data from http://thematicmapping.org/downloads/world_borders.php. #…
Rasmus
  • 1,349
  • 1
  • 9
  • 15