geospatial

MongoDB - Geospatial Index with Aggregation

限于喜欢 提交于 2019-12-05 08:08:14
问题 I've read from the to docs that it is not possible to use a geospatial index on an aggregation with MongoDB. Is there an alternative to this? I am attempting to run a query take grab all activities within a certain radius, then group/sort them by the number of times that activity has occurred. Is there way around this issue? 回答1: You can use map-reduce on a geo query. Here is an example based on geo_mapreduce.js (from the mongodb jstests): // setup test collection var act_date = new Date(2010

How to calculate geo-distance from a polygon?

[亡魂溺海] 提交于 2019-12-05 07:35:12
问题 I have a shapefile with 50+ different polygonal shapes (representing 50+ different regions) and 10,000+ data points that are supposed to be present in one of the regions. The thing is, the 10,000+ points are already coded with a region they are supposed to be in, and I want to figure out how far they are from this coded region in geo-spatial distance. My current approach (code below), which involves converting shapefiles to owin objects from the sp library and using distfun gets me distances

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

RTree: Count points in the neighbourhoods within each point of another set of points

梦想的初衷 提交于 2019-12-05 04:23:18
Why is this not returning a count of number of points in each neighbourhoods (bounding box)? import geopandas as gpd def radius(points_neighbour, points_center, new_field_name, r): """ :param points_neighbour: :param points_center: :param new_field_name: new field_name attached to points_center :param r: radius around points_center :return: """ sindex = points_neighbour.sindex pts_in_neighbour = [] for i, pt_center in points_center.iterrows(): nearest_index = list(sindex.intersection((pt_center.LATITUDE-r, pt_center.LONGITUDE-r, pt_center.LATITUDE+r, pt_center.LONGITUDE+r))) pts_in_this

How to get spplot (lattice) to not draw borders around polygons

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-05 03:50:42
I have a tally by zip code which is a lot of polygons to plot (30,357 to be precise). Consequently when I pdf the spplot all I see are the borders not the choropleth interiors. Therefore, I'd like to turn off plotting the borders, or at least be able to make them much, much thinner. However, digging around in ?spplot and its various offshoots (the panel function, levelplot, etc.) have come up empty. Here's an example to work with (the borders aren't that prominent here but they would be given a bajillion polygons): library(sp) Srs1 = Polygons(list(Polygon(cbind(c(2,4,4,1,2),c(2,3,5,4,2)))),

How can I remove border lines when using geom_sf? [closed]

旧时模样 提交于 2019-12-05 02:52:19
Closed. This question is off-topic . It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last year . I tried doing the following: ggplot(geography) + geom_sf(aes(fill=rate, color = NULL)) but that didn't get rid of the border lines. Peter Without a reproducible example it is difficult to know exactly what you are looking for. However, I will take a guess that your are looking for a way to suppress the lines marking boundaries between different polygons (regions), e.g., suppress the lines showing country borders

Table structure for Geo Spatial Data

江枫思渺然 提交于 2019-12-05 02:28:10
问题 What is the suggested way to structure a table in a MYSQL Database containing Geo Spatial data. As a POC i am working to insert the data as in the image as below into a database table. This below is the snapshot of the table creation of Phpmyadmin table creation looking for suggestions to create table for geospatial data as in screenshots. EDIT: I am working on XAMPP V1.8.3 Windows8 running MYSQL version 5.6.16. Created Table geomduplicate and columns and inserted data as in screenshot with

How can I get the installed GDAL/OGR version from python?

做~自己de王妃 提交于 2019-12-05 01:37:25
How can I get the installed GDAL/OGR version from python? I aware of the gdal-config program and are currently using the following: In [3]: import commands In [4]: commands.getoutput('gdal-config --version') Out[4]: '1.7.2' However, I suspect there is a way to do this using the python API itself. Any dice? gdal.VersionInfo() does what I want: >>> osgeo.gdal.VersionInfo() '1604' This works on both my Windows box and Ubuntu install. gdal.__version__ gives an error on my Windows installation, although it works on my Ubuntu installation: >>> import osgeo.gdal >>> print osgeo.gdal.__version__

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

Is Displaying 1000+ Feature Footprint Vectors on OpenLayers Map with Good Performance Possible? [closed]

我与影子孤独终老i 提交于 2019-12-04 22:10:44
Closed. This question is off-topic . It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last year . When loading many feature footprint vectors onto the map, the openlayers map and web application becomes unresponsive. Is there any way to improve the performance of the openlayers map with many vectors? We would like to be able to support at least 1000 vectors on the map at once. We are using openlayers 4. As I can tell, OpenLayers 3+ uses HTML5 canvas to render images and vectors. I've seen the canvas being used