geospatial

Why can't I insert into MySQL?

大兔子大兔子 提交于 2019-12-04 08:15:35
+---------+---------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +---------+---------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | user_id | int(11) | NO | UNI | NULL | | | utm | point | NO | MUL | NULL | | +---------+---------+------+-----+---------+----------------+ insert into life(user_id, utm) values(99,point(4,4)); ERROR 1416 (22003): Cannot get geometry object from data you send to the GEOMETRY field Have you tried: insert into life(user_id, utm) values(99,PointFromWKB(POINT(4,4))); 来源: https:

Shortest path between raw geo coordinates and a node of a graph

久未见 提交于 2019-12-04 08:00:18
I have implemented a simple Dijkstra's algorithm for finding the shortest path on an .osm map with Java. The pathfinding in a graph which is created from an .osm file works pretty well. But in case the user's current location and/or destination is not a node of this graph (just raw coordinates) how do we 'link' those coordinates to the graph to make pathfinding work? The simple straightforward solution "find the nearest to the current location node and draw a straight line" doesn't seem to be realistic. What if we have a situation like on the attached picture? (UPD) The problem here is that

Is there an API for openstreetmap? [closed]

此生再无相见时 提交于 2019-12-04 07:35:43
问题 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 wonder if there is any API I could query OSM data through, for example; Are (lon_1, lat_1) at land or at sea? Or could it be possible to get an island as a well-defined polygon? The only usage I've seen so far has just been tools for rendering OSM data (generating tiles). 回答1: Yes, there is an api and xapi

Help plotting Geographic Data in R using PBSMapping and Shapefiles

让人想犯罪 __ 提交于 2019-12-04 05:42:10
Using O'Reilly's Data Mashups in R as inspiration, I'm trying to plot a handful of addresses on a shapefile of Salt Lake County, Utah found here . I have data frame geoTable: > geoTable address Y X EID 1 130 E 300 S 40.76271 -111.8872 1 2 875 E 900 S 40.74992 -111.8660 2 3 2200 S 700 E 40.72298 -111.8714 3 4 702 E 100 S 40.76705 -111.8707 4 5 177 East 200 S 40.76518 -111.8859 5 6 702 3rd ave 40.77264 -111.8683 6 7 2175 S 900 E 40.72372 -111.8652 7 8 803 E 2100 S 40.72556 -111.8680 8 And I've coerced it into an eventData object: > addressEvents<-as.EventData(geoTable,projection=NA) >

r - Finding closest coordinates between two large data sets

本秂侑毒 提交于 2019-12-04 05:31:53
问题 I am aiming to identify the nearest entry in dataset 2 to each entry in dataset 1 based on the coordinates in both datasets. Dataset 1 contains 180,000 rows (only 1,800 unique coordinates) and dataset 2 contains contains 4,500 rows (full 4,500 unique coordinates). I have attempted to replicate the answers from similar questions on stackoverflow. for example: R - Finding closest neighboring point and number of neighbors within a given radius, coordinates lat-long Calculating the distance

attaching customized colormap to geoshow in matlab

痴心易碎 提交于 2019-12-04 05:30:42
问题 I am trying to plot a world map in mollweide projection using geoshow command. However, I am not able to modify the colors in the plot based on cutomized colormap values. Most likely this is an issue with how axesm and geoshow commands are used together, Please help me on this. See the ref. code below: G = rand(180,360); G(1:90,:)=-1*G(1:90,:); R = georasterref('RasterSize',size(G),... 'Latlim',[-90 90], 'Lonlim', [-180 180],'ColumnsStartFrom','north'); % ref this link: http://stackoverflow

How do I enter an “empty” POINT() geometry value into a MySQL field of type POINT?

纵然是瞬间 提交于 2019-12-04 05:16:58
I have a table with a POINT geometry field. I enter latitude/longitude points into it like this: INSERT INTO table( point ) VALUES( POINT( lon_value, lat_value ); Sometimes I do not have lat/lon values to enter. I am unable to enter a blank, a NULL, or an empty POINT() ... since POINT(0,0) is actually a location on the globe, that won't work either. What is the solution here? I would use coordinates of North Pole INSERT INTO table( point ) VALUES( POINT(0.0000,90.0000); If the actual coordinates of the pole may be an issue i would change the lon value from 0.0000. 来源: https://stackoverflow.com

MongoDB geospatial query with $not

六眼飞鱼酱① 提交于 2019-12-04 04:24:58
I have a basic geospatial query working well in MongoDB. It seems that it should be easy to apply $not to get the complement... but it's not working for me. Is it simple user error? Or can MongoDB not handle this query conceptually? I could not find any such limitation in the documentation . Working query (correctly finds the 2 cities within 10 miles of the center): db.customers.find({ "location" : { $within : { $center : [[-117.15,32.72],0.15] } } }) Attempted complement query (desired result is the 1 city that is not within 10 miles): db.customers.find({ "location" : { $not : { $within : {

How can I sort a coordinate list for a rectangle counterclockwise?

霸气de小男生 提交于 2019-12-04 04:21:51
I need to sort a coordinate list for a rectangle counterclockwise, and make the north-east corner the first coordinate. These are geographic coordinates (i.e. Longitude, Latitude) in decimal form. 1 For example, here are the 4 corners of a rectangle, starting with the north-west corner and moving clockwise: [ { "lat": 34.495239, "lng": -118.127747 }, # north-west { "lat": 34.495239, "lng": -117.147217 }, # north-east { "lat": 34.095174, "lng": -117.147217 }, # south-east { "lat": 34.095174, "lng": -118.127747 } # south-west ] I need to sort these counterclockwise and change the "anchor"

Is there a reason that Cassandra doesn't have Geospatial support?

元气小坏坏 提交于 2019-12-04 02:43:36
Since Cassandra is based off of the Dynamo paper (distributed, self-balancing hash table) + BigTable and there are spatial indexes that would fit nicely into that paradigm ( quadkey or geohash ). Is there a reason that Geospatial support hasn't been implemented? You could add a GeoPoint datatype as a tuple with an internal geohash and specify a CF as containing geo data. From there you can choose the behavior as having the geo data being a secondary index, or a denormalized SCF. That could lay the ground work for geospatial development and you could start by implementing some low hanging fruit