Spatial

Datatable containing SqlGeometry is causing stored procedure execution to fail… Why?

寵の児 提交于 2019-12-03 17:27:45
I'm trying to save a series of SqlGeometry values to a SQL Server 2008 database. Basically I have a tabletype in a SQL Server stored procedure which looks like this: CREATE TYPE [dbo].[TableType_Example] AS TABLE ( [SpatialID] [bigint] NOT NULL, [RecordID] [bigint] NOT NULL, [geom] [geometry] NOT NULL ) I then build a datatable in C# and send it like this: public static bool SaveSpatialDataElements(long recordID, List<BOSpatial> featureList) { //Setup features datatable DataTable dtFeatures = new DataTable(); dtFeatures.Columns.Add("SpatialID", typeof(SqlInt64)); dtFeatures.Columns.Add(

calculate distance between each pair of coordinates in wide dataframe

浪子不回头ぞ 提交于 2019-12-03 16:16:57
I want to calculate the distance between two linked set of spatial coordinates ( program and admin in my fake dataset). The data are in a wide format, so both pairs of coordinates are in the same row. library(sp) set.seed(1) n <- 100 program.id <- seq(1, n) c1 <- cbind(runif(n, -90, 90), runif(n, -180, 180)) c2 <- cbind(runif(n, -90, 90), runif(n, -180, 180)) dat <- data.frame(cbind(program.id, c1, c2)) names(dat) <- c("program.id", "program.lat", "program.long", "admin.lat", "admin.long") head(dat) # program.id program.lat program.long admin.lat admin.long # 1 1 -42.20844 55.70061 -41.848523

How to correct Polygon Ring Orientation using C# Entity Framework 5 DbGeography Spatial Data

谁都会走 提交于 2019-12-03 14:16:32
I'm working with the new Entity-Framework 5 using the Spatial data type DbGeography as part of my model for storing in one instance, a POINT and in another instance a POLYGON. When setting the value of my POLYGON all saves with no error however this is only the case if I draw the Polygon on the map in a clockwise order. If I draw the POLGON in an anti-clockwise direction I get an error the the sql level indicating that the data is an invalid geography type. Now after doing my own research into the problem, it appears to stem from the geography data type being quite strict in terms of a

How to perform a vector overlay of two SpatialPolygonsDataFrame objects?

守給你的承諾、 提交于 2019-12-03 14:16:20
I have two GIS layers -- call them Soils and Parcels -- stored as SpatialPolygonsDataFrame s ( SPDF s), and I would like to "overlay" them, in the sense described here . The result of the overlay operation should be a new SPDF in which: The SpatialPolygons component contains polygons formed by the intersection of the two layers. (Think all of the atomic polygons formed by overlaying two mylars on an overhead projector). The data.frame component records the attributes of the Soils and Parcels polygons within which each atomic polygon falls. My question(s): Is there an existing R function that

How to persist a calculated GEOMETRY or GEOGRAPHY column

依然范特西╮ 提交于 2019-12-03 13:29:38
问题 I'm trying to create a table under SQL Server 2008 containing a GEOMETRY column and a calculated variation thereof. Considering the following table where the calculated column returns a buffered geometry: CREATE TABLE [dbo].[Test] ( [Geometry] GEOMETRY NOT NULL, [Buffer] FLOAT NOT NULL, [BufferedGeometry] AS ([Geometry].STBuffer([Buffer])) PERSISTED ); The problem with this is it results in the following error: Msg 4994, Level 16, State 1, Line 2 Computed column 'BufferedGeometry' in table

Are SQL Server 2008 Spatial Data features useful for mapping queries?

这一生的挚爱 提交于 2019-12-03 13:19:10
问题 I have an app where basically I have a huge table (100 million records) of information, with each row containing a lat/long value. I'm constantly querying this table to get all the records that fit within a radius around a certain point. For example, "all records within 5 miles of 39.89288,-104.919434" For this, I have an index over the Lat/Long columns, and I'm getting the "bounding square" of points, and then discarding all the points that fall outside of the circle in my ASP.Net app, since

Coding and Paper Letter(三十)

*爱你&永不变心* 提交于 2019-12-03 13:18:48
资源整理,接上篇,本篇是论文。 Paper: 1. Assimilating multi-source remotely sensed data into a light use efficiency model for net primary productivity estimation/将多源遥感数据同化为光能效率利用模型,用于净初级生产力评估 高时空分辨率卫星数据对于植被指数的反演是必要的,例如归一化差异植被指数(NDVI),将被纳入CASA模型中,用于净初级生产力(NPP)估算,尤其是生长季节。然而,当前的遥感数据无法准确地监测高时空分辨率下的植被变化。为了考虑时间和空间信息,已经开发了时空融合模型以从高时间分辨率数据(例如,MODIS)获得时间信息以及来自高空间分辨率数据(例如,Landsat)的空间信息。本文首先利用时空融合模型生成具有Landsat数据空间分辨率和MODIS数据时间分辨率的合成NDVI图像。接下来,从合成的NDVI时间序列数据中提取物候特征,以提高土地覆盖分类的准确性。最后,我们评估了将合成NDVI和土地覆盖分类图同化到用于合成NPP估计的CASA模型的方法。结果表明,合成NPP的准确性优于非融合NDVI数据的NPP估计,提高土地覆盖分类精度可提高合成NPP估算的准确性。此外,月度合成NPP与当前和上个月的温度,降雨量和太阳辐射显示出显着的指数关系

DFT to spatial domain in OpenCV is not working

混江龙づ霸主 提交于 2019-12-03 09:23:49
I have created dft of an image and after some adjustment with filters i want to convert it back to the real image but every time when i do that it gives me wrong result ..seems like its not converting it back. ForierTransform and createGaussianHighPassFilter are my own functions rest of the code i am using like below for the inversion back to real image. Mat fft = ForierTransform(HeightPadded,WidthPadded); Mat ghpf = createGaussianHighPassFilter(Size(WidthPadded, HeightPadded), db); Mat res; cv::multiply(fft,ghpf,res); imshow("fftXhighpass1", res); idft(res,res,DFT_INVERSE,res.rows); cv::Mat

Spatial index/query (finding k nearest points)

孤人 提交于 2019-12-03 09:02:58
I have +10k points (latitude, longitude) and I'm building an app that shows you the k nearest points to a user's location. I think this is a very common problem and I don't want to reinvent the wheel. I'm learning about Quadtrees. It seems to be a good approach to solve this spatial problem. I'm using these tools: Python 2.5 MySQL MongoDb Building the Quadtree is not that hard: http://donar.umiacs.umd.edu/quadtree/points/pointquad.html But once I've created the tree and saved it to a db (MySQL or MongoDb), how I run the query? I need to run queries like these: Find all points within 10 km of

calculating minimum distance between a point and the coast in the UK

馋奶兔 提交于 2019-12-03 08:51:20
I have been following the example shown here , but for the UK. For this reason I am using the CRS for the UK of EPSG:27700, which has the following projection string: "+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +datum=OSGB36 +units=m +no_defs" However, I am unsure on the wgs.84 code to follow. Currently I am using: "+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0" Have also tried to use the datum=OSGB36 and +ellps=airy as well. The full code is as follows: library(rgeos) library(maptools) library(rgdal) epsg.27700 <- '+proj=tmerc +lat_0