Spatial

Using Dapper with SQL Spatial Types as a parameter

偶尔善良 提交于 2019-12-17 18:30:02
问题 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

Parallel distance Matrix in R

梦想的初衷 提交于 2019-12-17 18:10:27
问题 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? 回答1: 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

Simple way to subset SpatialPolygonsDataFrame (i.e. delete polygons) by attribute in R

懵懂的女人 提交于 2019-12-17 15:27:33
问题 I would like simply delete some polygons from a SpatialPolygonsDataFrame object based on corresponding attribute values in the @data data frame so that I can plot a simplified/subsetted shapefile. So far I haven't found a way to do this. For example, let's say I want to delete all polygons from this world shapefile that have an area of less than 30000. How would I go about doing this? Or, similarly, how can I delete Antartica? require(maptools) getinfo.shape("TM_WORLD_BORDERS_SIMPL-0.3.shp")

MySQL latitude and Longitude table setup

痞子三分冷 提交于 2019-12-17 11:52:29
问题 I want to store latitude and longitude values of places in a mysql database table. With the future in mind I will want to be able to find these places within a certain radius of a specific location. Having said that, what datatypes should I store the latitude and longitude values in? Please could you provide me with a create table script for columns like so: place_id | lat | long Is there perhaps a column I am missing in the above table that will provide me with additional information that I

MySQL latitude and Longitude table setup

跟風遠走 提交于 2019-12-17 11:52:02
问题 I want to store latitude and longitude values of places in a mysql database table. With the future in mind I will want to be able to find these places within a certain radius of a specific location. Having said that, what datatypes should I store the latitude and longitude values in? Please could you provide me with a create table script for columns like so: place_id | lat | long Is there perhaps a column I am missing in the above table that will provide me with additional information that I

SpatialPolygons - Creating a set of polygons in R from coordinates

ε祈祈猫儿з 提交于 2019-12-17 10:46:25
问题 I am trying to take create a set of polygons from vertex locations, saved in X,Y format. Here is an example of my data - each row represents the vertices for one polygon. the polygons are squares square <- rbind(c(255842.4, 4111578, 255862.4, 4111578, 255862.4, 4111558, 255842.4, 4111558, 255842.4, 4111578, 255842.4, 4111578), c(257397.0, 4111309, 257417.0, 4111309, 257417.0, 4111289, 257397.0, 4111289, 257397.0, 4111309, 257397.0, 4111309)) ID <- c("SJER1", "SJER2")' I am using

Neo4j Spatial 'WithinDistance' Cypher query returns empty while REST call returns data

回眸只為那壹抹淺笑 提交于 2019-12-17 09:49:49
问题 I have what appears to be a correctly configured spatial layer and index and can successfully query a node using findGeometriesWithinDistance REST API call. POST /db/data/ext/SpatialPlugin/graphdb/findGeometriesWithinDistance {"layer":"geom","pointX":15.0,"pointY":60.0,"distanceInKm":100.0} However, when querying using cypher, I get no results (I have tried reversing the order of 60.0 and 15.0 without luck): START n=node:geom('withinDistance:[60.0, 15.0, 500.0]') return n; Cyper returns: ==>

Inverse Distance Weighted (IDW) Interpolation with Python

删除回忆录丶 提交于 2019-12-17 04:15:00
问题 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

Magento geographical search and product recommendation

佐手、 提交于 2019-12-14 03:58:39
问题 I'm evaluating Magento for a travel company who will need to do product searches and recommendations based on geographical distance. The company is creating custom holiday packages based on various components (eg: accommodation, tours, restaurant vouchers, etc). These components potentially have overlapping locations (ie: a particular tour might be close enough to several hotels to be considered related to each of them). As a user builds up their custom package by adding stays at various

Issue on trying to query GeoJson multipolygons in SQL Server 2016

末鹿安然 提交于 2019-12-14 02:09:21
问题 I am trying to run a query (which I gleened from here) against GeoJson multipolygon data. It processes many of the spatial records but is stopping on a some. I get the following error in the query messages: Msg 6522, Level 16, State 1, Line 10 A .NET Framework error occurred during execution of user-defined routine or aggregate "geography": System.FormatException: 24142: Expected "(" at position 15. The input has ",". System.FormatException: at Microsoft.SqlServer.Types.WellKnownTextReader