Spatial

org.hibernate.MappingException: No Dialect mapping for JDBC type: 2002

这一生的挚爱 提交于 2019-12-07 05:27:14
问题 I'm getting org.hibernate.MappingException: No Dialect mapping for JDBC type: 2002 when I try to do a JPA nativeQuery to get a geometry field type. I'm using Oracle and org.hibernatespatial.oracle.OracleSpatial10gDialect . The geometry field is mapped as: @Column(name="geometry") @Type(type = "org.hibernatespatial.GeometryUserType") private Geometry geometry; // ... List<Object> listFeatures = new LinkedList<Object>(); Query query = entityManager.createNativeQuery( "SELECT "+ slots +" ,

In R, how to average spatial points data over spatial grid squares

对着背影说爱祢 提交于 2019-12-07 05:15:36
问题 Managed to solve problem now I have a set of around 50 thousand points that have coordinates and one value associated with them. I would like to be able to place points into a grid averaging the associated value of all points that fall into a grid square. So I want to end up with an object that identifies each grid square and gives the average inside the grid square. I have the data in a spatial points data frame and a spatial grid object if that helps. Improving answer: I have definitely

How can I speed up extraction of the proportion of land cover types in a buffer from a raster?

人走茶凉 提交于 2019-12-07 04:07:26
问题 I would like to extract spatial data in a buffer of 10 km around 30 000 objects of class SpatialLines and calculate proportion of each land cover type around buffered lines. In a first time, I used the function crop to crop my raster. Then, I used the function extract (package raster) to calculate proportion of 10 land cover types. Here is my code: lapply(1:nrow(tab_lines), FUN=function(k){ First step: to build a buffer of 10 km around the line buf_line <- gBuffer(seg_line[k], width=10000) ##

Index on Spatial / DBGeography Property for Entity Framework Code First

血红的双手。 提交于 2019-12-07 02:28:46
问题 I have an EF (6.1) code first project and one of its model has a DbGeography Property (which will contain only POINT geographies) which I'll perform queries against. I declare custom indices following the official guide, however it is lacking details regarding indices for spatial members / properties and I was wondering how I can create those via Code First? The underlying Database is / will be SQL Server 2012 if that plays any role. 回答1: Could not comment. Practically same question here.

Overplotting two SpatialPolygonsDataFrames with spplot

余生长醉 提交于 2019-12-07 00:16:42
问题 I have a bunch of data which I've plotted at the county level, without borders. I'd like to add in state boundaries. I have a state shapefile (polygons), but spplot doesn't seem to have any way to add on top of the previous map. Is there any way to do this without rewriting the panel function to take two SPDFs (which seems pretty specialized for what is likely a problem other people have)? Here's a reproducible example: library(sp) Srs1 = Polygons(list(Polygon(cbind(c(2,4,4,1,2),c(2,3,5,4,2))

Split polygon parts of a single SpatialPolygons Object

随声附和 提交于 2019-12-06 20:17:27
问题 In R, I have single SpatialPolygons object (i.e. multi-polygons) containing several hundred polygons. I would like to split this SpatialPolygons object into a list of Polygons (i.e. holes should remain attached to the parent polygon). Any idea how to do this? EDITED: Using the following example provided in the sp package: # simple example, from vignette("sp"): Sr1 = Polygon(cbind(c(2,4,4,1,2),c(2,3,5,4,2))) Sr2 = Polygon(cbind(c(5,4,2,5),c(2,3,2,2))) Sr3 = Polygon(cbind(c(4,4,5,10,4),c(5,3,2

How do I use a geospatial query in the 2.1 MongoDB C# driver?

不羁岁月 提交于 2019-12-06 19:49:04
问题 I've been banging my head on this one for days. I have a very simple query I'm trying to run in C#, it looks like this in the shell. db.runCommand({geoNear: "items", near: {type: "Point", coordinates : [-111.283344899999, 47.4941836]}, spherical : true, distanceMultiplier: 3963.2, maxDistance : 25}); My collection looks like this { "_id" : ObjectId(), "Title" : "arst", "Description" : "<p>arst</p>", "Date" : new Date("11/29/2015 09:28:15"), "Location" : { "type" : "Point", "Coordinates" : [

How can i create a Spatial Index on an Indexed View?

∥☆過路亽.° 提交于 2019-12-06 17:38:28
I have a view which already has SchemaBinding applied AND it has a UNIQUE CLUSTERED index. Now, i'm trying to add a second index, which is a SPATIAL index ... and I get the following error message:- and here's the a piccy of the schema.... Can someone help, please? Pure.Krome FFS - I found my answer . Spatial Indexes cannot be specified on indexed views. The error message is incorrect / misleading. Cheers & Heads up to a previous SO question which is very similar. Epic Fail again. 来源: https://stackoverflow.com/questions/5798487/how-can-i-create-a-spatial-index-on-an-indexed-view

Making query to find nearest multiple(Lat,Long) from the single(Lat,Long)

北战南征 提交于 2019-12-06 16:36:28
I am doing the nearest point query from a single point. Here is the sequence. I have multiple POI stored in the MSSQLServer and the table is dbo.Place . The second table is dbo.Position , which will stored the collected GPS point. I am using the Stored Procedure, and LatLong of Position is defined and available. How can I make query which is based from the examples below? dbo.Place Id | Name | Lat | Long 1 POI1 1.735 4.73225 2 POI2 1.5665 3.9983 3 Tim2 1.4344 3.1282 The Lat Long variable is defined in the stored procedure. I would like to use the following formula to find the nearest point,

How to create a Large Distance Matrix?

孤街醉人 提交于 2019-12-06 16:07:33
How to allocate a huge distance matrix in an appropriate way to avoid " allocation is unable " error. Imagine you have a 100.000 points randomly spreaded over some space. How can one cleverly create a matrix or "dist"-object, which represents the the half of DistMatrix. Maybe it should be another object, which will be able efficiently allocate the large number of distances. You can get the polygonial object from the following link: https://www.dropbox.com/sh/65c3rke0gi4d8pb/LAKJWhwm-l # Load required packages library(sp) library(maptools) library(maps) # Load the polygonal object x <-