Spatial

MySQL Spatial - Convert from SRID 31287 to 4326

笑着哭i 提交于 2019-12-10 18:10:28
问题 In MySQL I have a a database with around 100 tables. They all contain a column called ´shape´, this is a polygon type field. It contains information in what I believe (st_srid returns 1, but it's wrong) is SRID 31287. I would like to convert it to SRID 4326, how would I go about to do this? 回答1: You have two problems here. Your internal representation is wrong, it's SRID 1, and it should be SRID 31287. Changing an internal representation is possible in every database: MySQL will get a mutator

How to select certain geometries from a geometrycollection after st_intersect?

家住魔仙堡 提交于 2019-12-10 17:13:59
问题 I am running an intersect of two polygons or other sf objects using the fantastic new sf package. It's similar to this: a <- st_polygon(list(cbind(c(0,0,7.5,7.5,0),c(0,-1,-1,0,0)))) b <- st_polygon(list(cbind(c(0,1,2,3,4,5,6,7,7,0),c(1,0,.5,0,0,0.5,-0.5,-0.5,1,1)))) i <- st_intersection(a,b) ## GEOMETRYCOLLECTION(POINT(1 0), LINESTRING(4 0, 3 0), POLYGON((5.5 0, 7 0, 7 -0.5, 6 -0.5, 5.5 0))) how do I only keep the POLYGON of the GEOMETRYCOLLECTION ? Selecting different types in a feature

“Unable to locate the SpatiaLite library.” Django

妖精的绣舞 提交于 2019-12-10 16:49:17
问题 I'm trying to make Django's SQLite3 accept spatial queries. This tutorial suggests that I add this to settings: SPATIALITE_LIBRARY_PATH = 'mod_spatialite' Which produces this error: django.core.exceptions.ImproperlyConfigured: Unable to load the SpatiaLite library extension "mod_spatialite" because: The specified module could not be found. I also tried doing this : SPATIALITE_LIBRARY_PATH = r'C:\\Program Files (x86)\\Spatialite\\mod_spatialite-4.3.0a-win-x86\\mod_spatialite-4.3.0a-win-x86\

Interpolation of geodata on surface of a sphere

谁说胖子不能爱 提交于 2019-12-10 16:22:05
问题 I have a dataset with lat/lon coordinates and a corresponding 0/1 value for each geolocation (4 to 200+ datapoints). Now, I want to interpolate the voids and add colors to the surface of the globe based on the interpolation results. The main problem I have is to interpolate "around the globe", because currently I do in a plane, which obviously does not work. My data set.seed(41) n <- 5 s <- rbind(data.frame(lon = rnorm(n, 0, 180), lat = rnorm(n, 90, 180), value = 0), data.frame(lon = rnorm(n,

DbGeography Intersects method not working

删除回忆录丶 提交于 2019-12-10 15:34:17
问题 The System.Data.Spatial.DbGeography.Intersects method seems to always return true for me. I'm not sure why this happens. I've created a simple command line snippet below that results in the below console output Intersects Intersects The point clearly is nowhere near the bounds, and therefore should not intersect. DbGeography bounds = DbGeography.PolygonFromText("POLYGON ((146 -20,148 -20,148 -22,146 -22,146 -20))", 4326); DbGeography point = DbGeography.PointFromText("POINT (0 0)", 4326); if

Handling spatial data in CakePHP

99封情书 提交于 2019-12-10 11:58:03
问题 I have a database with a field for spatial data and a cakephp interface for it. In MySQL I can save the data by doing: INSERT INTO nodes (Location) VALUES (GeomFromText('POINT(42.450071 -76.487664)')) How can I make Cake take the latitude and longitude from a web form and insert it in this manner? I made a model that reads spatial data but I can't figure out how to make it write in spatial format. Thanks for any insight. -Andrew 回答1: It's a little tricky to find in the manual unless you know

Weighted Voronoi Diagram

故事扮演 提交于 2019-12-10 11:54:40
问题 I would like to know how to create weighted Voronoi diagram . (For example, additively weighted Voronoi diagram and multiplicatively weighted Voronoi diagram.) In my recognition, a class of scipy.spatial.voronoi is just a euclidean distance Voronoi diagram. Can I create weighted Voronoi diagram using this class? Or there are no ways but to make codes by originally? 回答1: You could try my php implementation:https://tetramatrix.github.io/awvd/. 来源: https://stackoverflow.com/questions/51983360

How can I do this Spatial Query in Sql 2008?

百般思念 提交于 2019-12-10 10:38:22
问题 i'm trying to do a spatial query in sql 2008 -> for a given list of POI's (point of interest, long/lat GEOGRAPHY data), which postcodes do they exist in (multipolygon GEOGRAPHY data). So this is the query i tried, but it's syntactically incorrect:- SELECT PostCodeId, ShapeFile FROM Postcodes a WHERE a.ShapeFile.STIntersects( SELECT PointOfInterest FROM PointOfInterests WHERE PointOfInterestId IN (SELECT Item from dbo.fnSplit(@PoiIdList, ',')) So this means i pass in a csv list of POI Id's and

Bring rasters to same extent by filling with NA - in R

╄→尐↘猪︶ㄣ 提交于 2019-12-10 10:28:28
问题 I have several cropped rasters with different geometry/outlines. Specifically spatial yield maps from several years of the same field, but the extent varies - the measurements were not always overall the whole field, but in some years only part of it. I want to calculate a mean value of those maps and combine them into one mean-value-raster. That does mean however, that not for every pixel in let's say 5 layers/rasters there is a value. I could accept these missing values to be NA, so the

Change projection in MSSQL for web mapping (Leaflet,Openlayer, OpenStreetMaps, GoogleAPI, …) to WSG48 or any other format

感情迁移 提交于 2019-12-10 08:12:34
问题 I have some WKT/WKB data in the MSSQL server like this and would like to show them on the map with the help of leaflet, Openlayer, OpenStreetMaps, or GoogleAPI. My data look likes this: POLYGON ((1736946.0983 5923253.9175, 1736895.6852 5923333.9451, 1736936.0082 5923356.6991, ......)) in this format EPSG:2193 as shown below and would like to convert them to WGS48 or EPSG:4326 I am trying to add them to leaflet, and seems that I need to convert this data to an appropriate format like this: [