Spatial

Split polygon parts of a single SpatialPolygons Object

元气小坏坏 提交于 2019-12-05 02:42: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,5,5))) Sr4 = Polygon(cbind(c(5,6,6,5,5),c(4,4,3,3,4)), hole = TRUE) Srs1 = Polygons(list(Sr1), "s1")

OSM初识(三)OSM Data

瘦欲@ 提交于 2019-12-05 02:38:59
一 导出数据 将XML格式的OSM数据转换成另一种格式。 二 提取数据 剪切你选择区域内的数据,或者提取出特定区域特定的特征 三 数据格式 OSM文件仅属于OSM,不能用别的软件打开。其中后缀为bz2,pdf的文件是为了节省空间压缩过的OSM文件。一个简单的OSM文件如下图所示: shapefiles是一种用来存储矢量地图数据的格式,是由几个不同文件组成的。比如:一个包含建筑物数据的shapefile可能含有下述三个文件: buildings.shp buildings.shx buildings.dbf 一个shapefile文件只能有一种元素(点/线/形状)特征。不像OSM,里面的每一个目标都可以有无数个Tags,但是shapefile文件元素特征的属性必须符合定义的表格结构,如下图所示。OSM数据可以转化成shapefiles。 OSM数据一般存储在PostgreSQL 数据库或者SQLite数据库。 OSM数据一般存储在PostgreSQL 数据库或者SQLite数据库。下载最新版PostgreSQL:http://www.postgresql.org/download/。会安装三部分文件: • PostgreSQL server:核心部分,数据库软件 • pgAdmin4/3:管理数据库的图形界面 • StackBuilder:用来增加另外的应用

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

ぐ巨炮叔叔 提交于 2019-12-05 01:21:18
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" : [-111.28334489999998, 47.4941836] }, "Zip" : "59405" } According to the docs here MongoDB C# API Docs the

Geospatial Point Mapping in Fluent NHibernate

我们两清 提交于 2019-12-04 19:51:43
I'm struggling to get Fluent NHibernate to play nice with SQL Server's Geospatial types. I want to store a geographic point in my Place class, but I keep getting an NHibernate configuration error when I run my ASP.NET MVC app: Method 'SetParameterValues' in type 'NHibernate.Spatial.Type.GeometryType' from assembly 'NHibernate.Spatial, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation. Update : This is caused by an out-dated NHibernate.Spatial DLL. Referencing the latest version (2.2+) solves the problem. Kudos to psousa for leading me to a solution. Place

Coordinate transform

一个人想着一个人 提交于 2019-12-04 17:32:22
Do any open source or 'free' libraries exist for Java where i can perform coordinate transforms from one spatial system to another? I found Opengeo http://opengeo.org/ but it's a huge and comprehensive library for all sorts of spatial things. Does anything smaller exist? I need to convert from MGA56 to WGS84. A simple solution is PROJ.4 , but it doesn't have Java bindings, so working with it might be a bit tricky. A more complete (but probably bigger than you want) solution would be GeoTools . But a quick search found the Java Map Projection Library , which appears to be a Java port of PROJ.4.

How do I insert a mysql spatial point with a yii model?

点点圈 提交于 2019-12-04 14:38:55
I have a model type that was generated from a mysql table that has address data and also a spatial POINT field named "coordinates". When a model is created or updated I want to geocode the address and store the latitude and longitude coordinates in the POINT field. My understanding is the way to do this is to geocode the address in the model's beforeSave method. I have done this and have the coordinates in an associative array. Now my question is how can I insert this data into my coordinates field? This is what I'm trying: public function beforeSave() { $singleLineAddress = $this-

saving a polygon in oracle database

折月煮酒 提交于 2019-12-04 14:17:41
I have captured four points(coordinate) of a plot using a gps device. Point 1:- lat- 27.54798833 long- 80.16397166 Point 2:- lat 27.547766, long- 80.16450166 point 3:- lat 27.548131, long- 80.164701 point 4:- --- now I want to save these coordinate in oracle database which save it as an polygon. Thanks If you're intending to use Oracle Spatial for storage or processing of polygons, then you'll need to store the data as an SDO_GEOMETRY object. Here's a quick example: CREATE TABLE my_polygons ( id INTEGER , polygon sdo_geometry ) / INSERT INTO my_polygons ( id , polygon ) VALUES ( 1 , sdo

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

扶醉桌前 提交于 2019-12-04 13:48:30
问题 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

DFT to spatial domain in OpenCV is not working

一笑奈何 提交于 2019-12-04 13:24:37
问题 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;

R:Custom color palette in map with spplot

情到浓时终转凉″ 提交于 2019-12-04 13:02:40
I am struggling with introducing a custom color palette on several polygons using spplot from the sp package. I am plotting several fields and want to show my rating , which can have the values 0,1,2,4 or 5. I need to use custom colors for that. What I tried is: spplot(Map,zcol="Rating", col.regions=c("0"="#00cc00","1"="#ffff66","2"="#e5c100", "3"="orange","4"="#ff5e5e","5"="red"), colorkey=TRUE) However, it is producing a repetition of colors like in the map below. How can I solve this? I know how I can to it with ggplot, but for several reasons I need to know how to do it with spplot. Thank