Spatial

Storing objects for locating by x,y coordinates

蹲街弑〆低调 提交于 2019-11-27 04:00:23
问题 I'm trying to determine a fast way of storing a set of objects, each of which have an x and y coordinate value, such that I can quickly retrieve all objects within a certain rectangle or circle. For small sets of objects (~100) the naive approach of simply storing them in a list, and iterating through it, is relatively quick. However, for much larger groups, that is expectedly slow. I've tried storing them in a pair of TreeMaps as well, one sorted on the x coordinate, and one sorted on the y

System.Data.Spatial DbGeography.Distance units?

一世执手 提交于 2019-11-27 03:46:53
问题 When measuring the distance between two locations using the DbGeography.Distance(otherLocation) what is the unit of the distance? Even the msdn information and the intellisense fails to specify the unit of the distance. Anyone knows? [edit] I'm using srid 4326. which most examples seems to use. From what I can find, 4326 seems to be radians, this leaves me completely clueless. radians are used to measure angles/degrees so what does this mean in reality ? 回答1: Several articles seem to agree on

which data structure is appropriate to query “all points within distance d from point p”

ぃ、小莉子 提交于 2019-11-27 01:10:16
问题 I have a 3D pointcloud and I'd like to efficiently query all points within distance d from an arbitrary point p (which is not necessarily part of the stored pointcloud) The query would look something like Pointcloud getAllPoints(Point p, float d); what accelerationstructure would be appropriate for this? A range-tree seems to be appropriate only for querying rectangular volumes, not sphere volumes (of course I could query the boundingbox of the sphere and then sort out all vertices that have

How to attach a simple data.frame to a SpatialPolygonDataFrame in R?

℡╲_俬逩灬. 提交于 2019-11-27 00:15:03
问题 I have (again) a problem with combining data frames in R. But this time, one is a SpatialPolygonDataFrame ( SPDF ) and the other one is usual data.frame ( DF ). The SPDF has around 1000 rows the DF only 400. Both have a common column, QDGC Now, I tried oo <- merge(SPDF,DF, by="QDGC", all=T) but this only results in a normal data.frame, not a spatial polygon data frame any more. I read somewhere else, that this does not work, but I did not understand what to do in such a case (has to do

How to create thiessen polygons from points using R packages?

十年热恋 提交于 2019-11-26 20:28:54
问题 I have multiple sets of points (for different years ~20) I want to generate thiessen polygons for each set of points using r spatial packages. I know this can be done using GIS but as i want a batch process something in R would be helpful. 回答1: You haven't given us access to your data, but here's an example for points representing cities of the world, using an approach described by Carson Farmer on his blog. Hopefully it'll get you started... # Carson's Voronoi polygons function

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

旧街凉风 提交于 2019-11-26 20:26:56
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 polygons, three scenarios are possible: Sometimes, those additional polygons describe a "hole" in the geographic ara describe by the first polygon in the object of class "polygons". Sometimes, those additional polygons describe additional geographic areas, i.e. the shape of the region is quite complex and described by putting together multiple parts.

Comparison of the runtime of Nearest Neighbor queries on different data structures

半城伤御伤魂 提交于 2019-11-26 18:36:28
问题 Given n points in d-dimensional space, there are several data structures, such as Kd-Trees, Quadtrees, etc. to index the points. On these data structures it is possible to implement straight-forward algorithm for nearest neighbor queries around a given input point. Is there a book, paper, survey, ... that compares the theoretical (mostly expected) runtime of the nearest neighbor query on different data structures? The data I am looking at is composed of fairly small point clouds, so it can

Inverse Distance Weighted (IDW) Interpolation with Python

馋奶兔 提交于 2019-11-26 18:26:13
The Question: What is the best way to calculate inverse distance weighted (IDW) interpolation in Python, for point locations? Some Background: Currently I'm using RPy2 to interface with R and its gstat module. Unfortunately, the gstat module conflicts with arcgisscripting which I got around by running RPy2 based analysis in a separate process. Even if this issue is resolved in a recent/future release, and efficiency can be improved, I'd still like to remove my dependency on installing R. The gstat website does provide a stand alone executable, which is easier to package with my python script,

.NET 4.5 Beta DbGeography NotImplementedException

这一生的挚爱 提交于 2019-11-26 17:05:45
问题 I have a brand new server which I installed the .NET 4.5 Beta redistributable on. I am getting a NotImplemented exception when trying to use the spatial features. This code... var x = DbGeography.PointFromText(string.Format("POINT({0} {1})", -45, 45), 4326); Throws this exception... System.NotImplementedException: The method or operation is not implemented. at System.Data.Spatial.DefaultSpatialServices.GeographyPointFromText(String geographyText, Int32 spatialReferenceSystemId) If I install

Create Grid in R for kriging in gstat

走远了吗. 提交于 2019-11-26 16:29:38
问题 lat long 7.16 124.21 8.6 123.35 8.43 124.28 8.15 125.08 Consider these coordinates, these coordinates correspond to weather stations that measure rainfall data. The intro to the gstat package in R uses the meuse dataset. At some point in this tutorial: https://rpubs.com/nabilabd/118172, the guys makes use of a "meuse.grid" in this line of code: data("meuse.grid") I do not have such a file and I do not know how to create it, can I create one using these coordinates? Or at least point me to