Spatial

R: How can I count how many points are in each cell of my grid?

泄露秘密 提交于 2019-12-18 06:54:45
问题 I have made a reference grid, cells 50x50m, based on GPS locations of a collared animal. I want to do the equivalent to a spatial join in ArcGIS, and count the number of points in each cell. I have made a reference grid, using a SpatialPointsDataFrame object (the data frame is already projected, using UTM coordinate system) RESO <- 50 # grid resolution (m) BUFF <- 500 # grid extent (m) (buffer around location extremes) XMIN <- RESO*(round(((min(dat.spdf$Longitude)-BUFF)/RESO),0)) YMIN <- RESO

Difference between Microsoft.OData.Core and Microsoft.Data.OData

落爺英雄遲暮 提交于 2019-12-18 06:07:46
问题 I am working on Web Api with OData enabled. I started working by referring to ( only the relevant dlls to the question are mentioned ) Microsoft.AspNet.WebApi.OData Microsoft.Data.OData Microsoft.Data.Edm System.Spatial But when I found out OData is by default case-sensitive , I look for a solution of case insensitive and I have gone through few post Support OData Uri case insensitive parse & ODataLib 6.7.0 Release then finally landed into nuget package Microsoft.OData.Core 6.9.0 which seems

Difference between Microsoft.OData.Core and Microsoft.Data.OData

混江龙づ霸主 提交于 2019-12-18 06:07:07
问题 I am working on Web Api with OData enabled. I started working by referring to ( only the relevant dlls to the question are mentioned ) Microsoft.AspNet.WebApi.OData Microsoft.Data.OData Microsoft.Data.Edm System.Spatial But when I found out OData is by default case-sensitive , I look for a solution of case insensitive and I have gone through few post Support OData Uri case insensitive parse & ODataLib 6.7.0 Release then finally landed into nuget package Microsoft.OData.Core 6.9.0 which seems

Transform/ Project a geometry from one SRID to another

為{幸葍}努か 提交于 2019-12-18 06:02:40
问题 I have a database table which currently holds geometric data in SRID 27700 (British National Grid). While retrieving the data however I need to transform it to SRID 4326 (WGS84). Is there any way to apply a function such as ST_Transform found in PostGIS to my data in order to get the result I need? NOTE: The solution needs to be able to be implemented using T-SQL and not stored procedures etc. I have to be able to construct a statement and have it saved in a table as a string field for

Adding scale bar to ggplot map

有些话、适合烂在心里 提交于 2019-12-18 04:13:08
问题 I've produced this map in ggplot2 : library(maptools); library(ggplot2) data(wrld_simpl) world <- fortify(wrld_simpl) worldUk <- subset(world, id=="GBR") ggplot() + geom_path(aes(long, lat, group=group), data=worldUk, color="black", fill=NA) + coord_equal() Using photoshop, I've added a scale bar to the map. How can I add a similar scale bar using ggplot2 ? This post adds a scale bar, but the bar doesn't refer to distance: scale bar and north arrow on map-ggplot2 回答1: There is a library

calculating minimum distance between a point and the coast

霸气de小男生 提交于 2019-12-18 03:44:03
问题 I am trying to get the minimum distance between a given point and the coast. My example is the distance of Madrid to the coast: library(rgeos) library(maptools) coast <- readShapeLines("Natural_Earth_quick_start/10m_physical/ne_10m_coastline.shp") MAD = readWKT("POINT(-3.716667 40.383333)") gDistance(MAD,coast) [1] 3.021808 I am having trouble understanding what gDistance() returns. The docs say it's in the units of the projection. Does that mean it is in latlong degrees? How can I convert

calculating minimum distance between a point and the coast

房东的猫 提交于 2019-12-18 03:43:32
问题 I am trying to get the minimum distance between a given point and the coast. My example is the distance of Madrid to the coast: library(rgeos) library(maptools) coast <- readShapeLines("Natural_Earth_quick_start/10m_physical/ne_10m_coastline.shp") MAD = readWKT("POINT(-3.716667 40.383333)") gDistance(MAD,coast) [1] 3.021808 I am having trouble understanding what gDistance() returns. The docs say it's in the units of the projection. Does that mean it is in latlong degrees? How can I convert

Know of any C# spatial data libraries?

戏子无情 提交于 2019-12-18 01:21:56
问题 I'm looking at implementing spatial queries in .NET without using SQL2008. The first requirement is to be able to create a (BTree styled) spatial index and be able to query it. Although SQL 2008 ships with .NET libraries for the types, you need to use SQL for the spatial indexes. HAs anybody used any .NET libraries for spatial data (OS or commercial)? I am looking at NetTopologySuite but it looks quiet and I don't want a dead library. 回答1: SharpMap is a (well known and used) OpenSource

What technique should be used to prune 2d collision checks?

女生的网名这么多〃 提交于 2019-12-17 22:24:15
问题 From the outset, collision detection feels like it is an O(n^2) problem. You have a bunch of objects and you need to check if each object is colliding with any of the other objects. However, I know that it is wildly ineffecient to check each object against all the other objects. Why do a relatively expensive collision check between two balls if they aren't even close to eachother? Here is example of my simple program I'm working on: If you have 1000 balls then if you went with the naive

convert matrix to raster in R

心不动则不痛 提交于 2019-12-17 18:58:40
问题 I have a matrix data with spatial coordinates and one variable. The spatial resolution is 1000 meters. > str(dat1) > List of 3 > $ x: num [1:710] 302340 303340 304340 305340 306340 ... > $ y: num [1:1241] 5431470 5432470 5433470 5434470 5435470 ... > $ z: num [1:710, 1:1241] 225 225 225 225 225 ... I want to convert it into raster format. > dat1$x[1:10] > [1] 302339.6 303339.6 304339.6 305339.6 306339.6 307339.6 308339.6 309339.6 310339.6 311339.6 > dat1$y[1:10] > [1] 5431470 5432470 5433470