Spatial

Saving spatial data in CakePHP

时间秒杀一切 提交于 2019-12-05 09:54:57
I have a problem saving spatial data in CakePHP with saveAll(). I really dont want to write the query manually ( Handling spatial data in CakePHP ) because there are number of models being saved. Also I read this CakePHP and MySQL Spatial Extension but when I try to do the same, $db->expression() returns an stdClass. This is the returned object printed out: stdClass Object ( [type] => expression [value] => GeomFromText('POINT(48.18879 18.527579999999944)') ) If I use this object the way it is used in CakePHP and MySQL Spatial Extension and try to save it with saveAll() I get this error: Error

Voronoi Diagram Edges: How to get edges in the form (point1, point2) from a scipy.spatial.Voronoi object?

て烟熏妆下的殇ゞ 提交于 2019-12-05 08:14:33
I have spent a great deal of time now trying to obtain edges from the scipy.spatial.Voronoi diagram to no avail. Here is the main documentation: http://docs.scipy.org/doc/scipy-dev/reference/generated/scipy.spatial.Voronoi.html If you create a Voronoi Diagram like so: points = np.array([[0, 0], [0, 1], [0, 2], [1, 0], [1, 1], [1, 2], [2, 0], [2, 1], [2, 2]]) //Or feel free to use any set of points then you have access to the following object properties: vor.regions vor.max_bound vor.ndim vor.ridge_dict vor.ridge_points vor.ridge_vertices vor.npoints vor.point_region vor.points But is unclear

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

一笑奈何 提交于 2019-12-05 06:39:07
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) ## seg_line = Lines objects Second step: to extract land cover types in the buffer from the raster ha <

Which approach is faster for getting all POIs from MySQL/MariaDB with PHP/Laravel

老子叫甜甜 提交于 2019-12-05 06:02:55
问题 Correct me if I'm wrong. There are three approaches to get the nearest homes, users have created in my website: To create a table with two columns(latitude, longitude) that both of them are float and say: Here it is: $latitude = 50; $longitude = 60; SELECT * FROM my_table WHERE (latitude <= $latitude+10 AND latitude >= $latitude-10) AND (longitude <= $longitude+10 AND longitude >= $longitude-10) that 10 here means 1km for example. In this approach we can also use harvesine formula. To merge

Entity Framework not getting Spatial type data in result from Sql Server stored procedure

醉酒当歌 提交于 2019-12-05 05:19:20
问题 I'm using Entity Framework 6 with .Net 4.5 . I have a stored procedure that selects and returns data. One of the return columns is a geography type . In Visual Studio 2015, I right click the .edmx file, click "Update Model From Database...". This action gets my stored procedure and creates a complex type of storeprocedurename_Result. All the columns are represented in the complex type objects except the geography type . At the same time one of my table also have Geography type but that table

Entity framework 6 and spatial data

强颜欢笑 提交于 2019-12-05 05:16:04
I have database with spatial data types. I use database first model and entity framework 6.0.2 and .NET 4.5. When I am trying to use the generated classes I get following error: Schema specified is not valid. Errors: The relationship 'Name_FK1' was not loaded because the type 'Model.TypeB' is not available. The following information may be useful in resolving the previous error: The property 'Position' on the type 'Data.TypeB' has a property type of 'System.Data.Spatial.DbGeography' which cannot be mapped to a primitive type. The same error is listed for all tables where I use spatial type.

natural neighbour interpolation. error in calculating polygon intersection area

删除回忆录丶 提交于 2019-12-05 04:27:54
问题 I am trying to write this algorithm in R. Does it exist in any package already?!? This is what I did (with help from SO and various blog posts): library(rgdal) library(ggmap) require("maptools") require("plyr") locations<- unique(cbind(data22[,1], data22[,2])) [,1] [,2] [1,] 24.9317 60.1657 [2,] 24.9415 60.1608 [3,] 24.9331 60.1577 [4,] 24.9228 60.1477 [5,] 24.9370 60.1545 [6,] 24.9491 60.1559 [7,] 24.9468 60.1591 [8,] 24.9494 60.1675 [9,] 24.9561 60.1609 [10,] 24.9218 60.1632 [11,] 24.9213

Get data frame with polygons id and Centroid (lat long) information from shapefile

怎甘沉沦 提交于 2019-12-05 04:20:31
I have a polygon shapefile (downloadable here ) from which I want to create a data.frame with 3 columns containing: Polygon id Centroid latitude Centroid Longitude From this answer here , I know it its quite easy to get this information as a Formal Class SpatialPoints object. And when I convert this object to a data.frame I loose the id information. # Load Shapefile Legislative_areas <- readOGR(dsn = 'C:/Users/.../Downloads/Legislative2010UTM', layer ='Legislative2010UTM') # Get centroids cent <- gCentroid(Legislative_areas, byid=TRUE) # Convert to data.frame, but loose id info cent <- as.data

Custom placement of spplot legend in the map

心已入冬 提交于 2019-12-05 03:33:17
Is it possible to place the spplot (spplot polygons) legend within the map, in lower left corner, like this? The closest I've been able to get is this (I am not posting my data, I just use the example data instead, so in this case, try to place the legend in top left part of the map): data(meuse.grid) gridded(meuse.grid)=~x+y spplot(meuse.grid[,'dist'], colorkey = list(space = "left", height = 0.5) ) But the legend is in the middle of the page and is outside of the map. Unfortunatelly, colorkey argument doesn't support "bottomleft", or x, y, or corner arguments (see ?levelplot ). I also tried

what's the difference between spatial and temporal characterization in terms of image processing?

此生再无相见时 提交于 2019-12-05 03:25:47
I am a beginner in learning image processing and I am a bit confused with the concept of spatial and temporal characterization. So, for Spatial characterization, is it like a 2D map which contains some statistical information about the map? And in terms of the temporal characterization, is the value with respect to time? What does it mean and why do we care? Thanks! Temporal characterization occurs when you have a series of images taken at different time. Correlations between the images are often used to monitor the dynamic changes of the object. Spatial characterization applies when you are