Spatial

Intersecting Points and Polygons in R

狂风中的少年 提交于 2019-11-28 11:03:13
I am working with shapefiles in R , one is point.shp the other is a polygon.shp. Now, I would like to intersect the points with the polygon, meaning that all the values from the polygon should be attached to the table of the point.shp. I tried overlay() and spRbind in package sp, but nothing did what I expected them to do. Could anyone give me a hint? Spacedman If you do overlay(pts, polys) where pts is a SpatialPointsDataFrame object and polys is a SpatialPolygonsDataFrame object then you get back a vector the same length as the points giving the row of the polygons data frame. So all you

System.Data.Spatial DbGeography.Distance units?

爷,独闯天下 提交于 2019-11-28 10:42: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 ? Sign Several articles seem to agree on meters being used in 4326 as the unit of distance. WGS 84 is done in meters as well, which is probably

Using Dapper with SQL Spatial Types as a parameter

做~自己de王妃 提交于 2019-11-28 07:46:51
I've got a system which basically has to do a query like this: SELECT * FROM MyTable WHERE @parameter.STIntersects(MyGeometryColumn) This is quite simple to do when using vanilla SQL parameters, you just have to create your parameter in a non-typical way (where the builder variable is a SqlGeometryBuilder which I use to create a rectangle): command.Parameters.Add(new SqlParameter { UdtTypeName = "geometry", Value = builder.ConstructedGeometry, ParameterName = "@paremeter" }); Now, When I try to do this using dapper, I get an error that it can't figure out how to use this as a parameter. Anyone

“Non Finite Transformation Detected” in spTransform in rgdal R Package

巧了我就是萌 提交于 2019-11-28 06:29:43
问题 I am trying to convert geographic coordinates (degrees) into UTM coordinates (meters) and keep getting an error message that a "Non finite transformation detected." Do you know how I can fix this? Here is the code I used: > GPS.Points <- Gomer.Data[, c('Longitude', 'Latitude')] > head(GPS.Points) Longitude Latitude 1 23.85474 -19.52211 2 23.85531 -19.52243 3 23.85534 -19.52257 4 23.85580 -19.52346 5 23.85551 -19.52380 6 23.85513 -19.52360 > GPS.Points.Spatial.Data <- SpatialPoints(GPS.Points,

Parallel distance Matrix in R

非 Y 不嫁゛ 提交于 2019-11-28 06:29:15
currently I'm using the build in function dist to calculate my distance matrix in R. dist(featureVector,method="manhattan") This is currently the bottlneck of the application and therefore the idea was to parallize this task(conceptually this should be possible) Searching google and this forum did not succeed. Does anybody has an idea? Will Beason Here's the structure for one route you could go. It is not faster than just using the dist() function, instead taking many times longer. It does process in parallel, but even if the computation time were reduced to zero, the time to start up the

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

扶醉桌前 提交于 2019-11-28 06:01:50
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 larger distance than d - but maybe there is a better way to do this??) thanks! according to Novelocrats

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

南笙酒味 提交于 2019-11-28 03:56:54
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 something with the ID columns, merge uses) oooh such a hard question, I quess... Thanks! Jens Let df = data

Laravel model with POINT/POLYGON etc. using DB::raw expressions

匆匆过客 提交于 2019-11-28 00:16:14
问题 I have some models that use geospatial fields like POINT , POLYGON or MULTIPOLYGON . I would like to tell my model to process these attributes in a special way, for me to get the desired model attributes set. Example: Every regular Model::find() or other Eloquent method should apply some custom code before storing or after retrieving a database value. $area->surface is a POLYGON field in MySQL, but in my model class I would like to handle $area->surfare as an array of points. On SELECT I

Rules engine for spatial and temporal reasoning?

妖精的绣舞 提交于 2019-11-27 23:03:11
问题 I have an application that receives a number of datums that characterize 3 dimensional spatial and temporal processes. It then filters these datums and creates actions which are then sent to processes that perform the actions. Rinse and repeat. At present, I have a collection of custom filters that perform a lot of complicated spatial/temporal calculations. Many times as I discuss my system to individuals in my company, they ask if I'm using a rules engine. I have yet to find a rules engine

How to extract data from a RasterBrick?

試著忘記壹切 提交于 2019-11-27 21:55:14
问题 I have a RasterBrick consisting of monthly rainfall data over 7 years, so it has 7 layers with 12 slots each: rainfall <- brick("Rainfall.tif") > rainfall class : RasterBrick dimensions : 575, 497, 285775, 7 (nrow, ncol, ncell, nlayers) resolution : 463.3127, 463.3127 (x, y) extent : 3763026, 3993292, -402618.8, -136213.9 (xmin, xmax, ymin, ymax) coord. ref. : +proj=sinu +lon_0=0 +x_0=0 +y_0=0 +a=6371007.181 +b=6371007.181 +units=m +no_defs data source : in memory names : layer.1.1, layer.2.1