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
18
votes
3 answers

Plotting static base map underneath a sf object

I'm trying to plot a static base map underneath my sf object (for print). When using ggmap I first get a lot of errors, then I can't seem to figure out how to chain the base map to my ggplot2 object with a geom_sf. library(sf) #…
Tdebeus
  • 1,519
  • 5
  • 21
  • 43
18
votes
2 answers

MongoDB Bound Queries: How do I convert mile to radian?

I have a collection of stores with a geospacial index on the location propery. What I am trying to do is given the user's latitude, latitude and a search radius (mi), I want to return the list of stores that are within those parameters. I saw the…
Abe
  • 6,386
  • 12
  • 46
  • 75
18
votes
6 answers

sql geography to dbgeography?

Maybe I'm missing something. I have a sql server column of the "Geography" datatype. I want to use the DbGeography type in my c# code. Any way to cast or convert from sql's geography to dbgeography?
Eric
  • 2,273
  • 2
  • 29
  • 44
18
votes
1 answer

Non-linear color distribution over the range of values in a geom_raster

I'm faced with the following problem: a few extreme values are dominating the colorscale of my geom_raster plot. An example is probably more clear (note that this example only works with a recent ggplot2 version, I use…
Paul Hiemstra
  • 59,984
  • 12
  • 142
  • 149
17
votes
7 answers

Algorithm to calculate the distances between many geo points

I have a matrix having around 1000 geospatial points(Longitude, Latitude) and i am trying to find the points that are in 1KM range. NOTE: "The points are dynamic, Imagine 1000 vehicles are moving, so i have to re-calculate all distances every few…
17
votes
2 answers

Does PostgreSQL implement Geospatial relationship queries?

My company is looking at different database providers, and how they implement Geospatial queries to get distances from a Lat/Long for a number of records. We are going to investigate PostgreSQL as a potential database platform. I've heard that…
pearcewg
  • 9,545
  • 21
  • 79
  • 125
17
votes
8 answers

Heightmap generation algorithm?

I was looking around the internet and couldn't find a perfect algorithm for this particular problem: Our customer have a set of points and weight data along with each point as can be demonstrated by this image: weighted points…
chakrit
  • 61,017
  • 25
  • 133
  • 162
17
votes
1 answer

Using MongoDB's Geospacial index with 3d data

I have a set of documents each of which contain a point in 3-space stored in a MongoDB collection. MongoDB currently has Geospatial Indexes only for 2-space. Is there a way of leveraging the Geospacial Index to do similar queries on 3-space data?
John F. Miller
  • 26,961
  • 10
  • 71
  • 121
17
votes
2 answers

Saving and restoring geometries in OpenLayers

Context: I'm a just-hours-old newbie at OpenLayers, please be gentle. Fundamentally, I have a map with some drawn objects on it. If I understand things correctly, I have a number of OpenLayer.Feature.Vector (layers?) with a number of…
Walt Stoneburner
  • 2,562
  • 4
  • 24
  • 37
17
votes
1 answer

Lat/Lon + Distance + Heading --> Lat/Lon

So: I have the following function, adapted from a formula found online, which takes two lat/lon coordinates and finds the distance between them in miles (along a spherical Earth): public static double distance (double lat1, double lon1, double lat2,…
DanM
  • 7,037
  • 11
  • 51
  • 86
17
votes
2 answers

How to efficiently calculate distance between pair of coordinates using data.table :=

I want to find the most efficient (fastest) method to calculate the distances between pairs of lat long coordinates. A not so efficient solution has been presented (here) using sapply and spDistsN1{sp}. I believe this could be made much faster if…
rafa.pereira
  • 13,251
  • 6
  • 71
  • 109
17
votes
2 answers

Entity Framework Code First truncating my decimals

I am using Entity Framework 6.x using the Code First approach on an MVC 5 application. In this particular situation my model (among other things) contains two properties named Latitude and Longitude: [Required, Range(-90, +90)] public decimal…
17
votes
1 answer

PostgreSQL PostGIS vs ElasticSearch Spatial search

I am working on a search query which needs to do a geospatial filter (i.e. filter all elements outside of a certain radius). We have both PostgreSQL and ElasticSearch as part of our infrastructure and I am evaluating which of the two to use. I'm not…
lmirosevic
  • 15,787
  • 13
  • 70
  • 116
17
votes
2 answers

Check if point is in spatial object which consists of multiple polygons/holes

I have a SpatialPolygonsDataFrame with 11589 objects of class "polygons". 10699 of those objects consists of exactly 1 polygon, however the rest of those objects consists of multiple polygons (2 to 22). If an object of consists of multiple…
majom
  • 7,863
  • 7
  • 55
  • 88
17
votes
3 answers

Determining the distance between two ZIP codes (alternatives to mapdist)

I want to calculate the distance between approx. 100,000 different ZIP codes. I know about the mapdist function in the ggmap package mapdist works perfectly: library(ggmap) mapdist('Washington', 'New York', mode = 'driving') # from to…
majom
  • 7,863
  • 7
  • 55
  • 88