geospatial

How do I use Doctrine2 to work with GeoSpatial Queries using PostGIS?

走远了吗. 提交于 2020-01-22 12:44:07
问题 I have a public facing app that is based on Postgres and PostGIS. I have tried Googling for hours but have been unable to find any documentation that can show some basic geospatial stuff like getting distance between two points using Doctrine2. Not being able to use an ORM is a big deal for me in terms of determining my database of choice. Can someone show me a basic example of lets say showing all points within a radius of lets say 10 miles using Doctrine? 回答1: I wrote an article on my blog,

Mongodb 2.4 2dsphere queries very slow (using $geoIntersects)?

和自甴很熟 提交于 2020-01-17 03:11:07
问题 mongod.log shows: {deliver_area: { $geoIntersects: { $geometry: { type: "Point", coordinates: [ 116.3426399230957, 39.95959281921387 ] } } } } ntoreturn:0 ntoskip:0 nscanned:2965 keyUpdates:0 numYields: 2 locks(micros) r:136723 nreturned:52 reslen:23453 103ms The collection has about 10k records, where deliver_area is one of the fields which is a Polygon(GeoJSON) and has a 2dsphere index This is my query: db.area_coll.find( { id: 59, deliver_area: { $geoIntersects: { $geometry: { type: "Point

Fetching Multipoint Spatial Data in MySQL

有些话、适合烂在心里 提交于 2020-01-16 10:57:53
问题 I didn't find any answer how to select every point in multipoint data type in MySQL. I have multipoint that contains many points and I want to select every point by query and I can't figure it out. Any ideas? Table structure: Image Example data: Image In MySQL documentation I've found only this, but it didn't help: https://dev.mysql.com/doc/refman/8.0/en/fetching-spatial-data.html 回答1: If you are using MySQL >= 8.0.2, an option may be: DELIMITER // CREATE PROCEDURE `sp_test`(`p_id` BIGINT

R - crop LIST of Least Cost Paths intersected with SpatialPolygonsDataFrame objects

心已入冬 提交于 2020-01-16 08:13:06
问题 I have a series of steps I need to complete on a LIST of SpatialLinesDataFrame (=least cost paths flowing 'downslope' created using ] gdistance ; 'LCPs' herein) objects based on their relationships with individual features within a MULTI-FEATURE SpatialPolygonsDataFrame ('polygons') object. To summarize, each LCP element in the list originates inside a single polygon feature, and may or may not pass through one or more other polygon features as it 'flows' downhill. I want to create new

Ms SQL geography.STDistance returns wrong distance

白昼怎懂夜的黑 提交于 2020-01-15 12:04:18
问题 I'm trying to query any locations within a specified distance from another location. The query is not the problem, but the distance returned by geography.STDistance is. It seems STDistance makes fairly accurate calculations on locations close to the equator, but I need this to work with locations in the nordic countries. Norway, Sweden, Finland and so on... According to my calculations, made on locations in northern Sweden, the distance is wrong by a factor of around 2.38?! Expected result is

Mapbox: Get loaded tile coordinates? [closed]

☆樱花仙子☆ 提交于 2020-01-14 04:15:09
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago . I'd like to load 3D terrain onto my mapbox map, like Peter's example, however I'm hoping to find a much simpler implementation. My idea is to use mapbox's data event to get each loaded tile and simply load a three.js mesh above it.. but I need to figure out how to calculate each

Get n points on a line

你说的曾经没有我的故事 提交于 2020-01-13 20:24:46
问题 If I have a line defined by a start and end coordinates, how do I get n equally spaced points on that line, taking the curvature of the earth into account? I'm looking for an algorithm, and/or a python library that implements this. 回答1: Using geographiclib, a python implementation of GeographicLib, I was able to do this: from geographiclib.geodesic import Geodesic number_points = 10 gd = Geodesic.WGS84.Inverse(35, 0, 35, 90) line = Geodesic.WGS84.Line(gd['lat1'], gd['lon1'], gd['azi1']) for i

Size legend of sf object won't show correct symbols

旧巷老猫 提交于 2020-01-13 10:45:53
问题 Does anyone know why the legend of the size aestatic BIR74 won't show the dot sizes but rectangles? If the answer is yes, how can I fix this? Reproducable example: library(sf) # devtools::install_github("tidyverse/ggplot2") library(ggplot2) nc <- st_read(system.file("shape/nc.shp", package="sf")) nc_centers <- st_centroid(nc) nc_centers %>% ggplot() + geom_sf(aes(color = SID79, size = BIR74)) + coord_sf(datum = NA) + theme_minimal() 回答1: you need to add the show.legend argument to geom_sf, i

Size legend of sf object won't show correct symbols

﹥>﹥吖頭↗ 提交于 2020-01-13 10:45:10
问题 Does anyone know why the legend of the size aestatic BIR74 won't show the dot sizes but rectangles? If the answer is yes, how can I fix this? Reproducable example: library(sf) # devtools::install_github("tidyverse/ggplot2") library(ggplot2) nc <- st_read(system.file("shape/nc.shp", package="sf")) nc_centers <- st_centroid(nc) nc_centers %>% ggplot() + geom_sf(aes(color = SID79, size = BIR74)) + coord_sf(datum = NA) + theme_minimal() 回答1: you need to add the show.legend argument to geom_sf, i

delphi read xml element

你。 提交于 2020-01-13 05:24:26
问题 I'm new to XML and we need to do GeoCoding with the new Bing Spatial Data API. I've managed to get a result back from them in xml format. How would I read specific elements in the response, ie. the Link, Status and ErrorMessages? <?xml version="1.0" encoding="utf-8"?> <Response xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/search/local/ws/rest/v1"> <Copyright>Copyright © 2011 Microsoft and its suppliers.