geospatial

Reading KML files into R

情到浓时终转凉″ 提交于 2019-12-09 03:22:59
问题 I'm building a workflow for reading multiple-geometry KML files into R. This is my working map, with point and path geometries. The (reproducible) R script is: library(rgdal) setwd( {SPECIFY A FOLDER} ) download.file("http://www.scribblemaps.com/maps/kml/shackleton.kml", "file.kml") (lyr = ogrListLayers("file.kml")) map = readOGR ("file.kml", layer=lyr, verbose = TRUE, drop_unsupported_fields=T, dropNULLGeometries=T) which fails with: Error in ogrInfo(dsn = dsn, layer = layer, encoding =

Mongoose aggregation with geonear

痴心易碎 提交于 2019-12-09 02:05:21
问题 I'm trying to implement paging with Mongoose geoNear command. It seem skip is not supported with geoNear, and I understand aggregation would work (with paging with a performance cost). How can I convert this to aggregation query to skip a number of documents? exports.near = function(req, res) { if(req.query.lat && req.query.lng) { var point = { type: "Point", coordinates : [Number(req.query.lng), Number(req.query.lat)] }; var queryParams = { spherical: true, skip: 0, limit: 10,

Sql Server 2008 geography LineString size limitations

懵懂的女人 提交于 2019-12-09 01:08:46
问题 today i ran into a possible size limitation of geography type Linestrings within Sql Server 2008. when i create a Linestring with STGeomFromText() that contains 567 points containing Long,Lat and Z coordinates, everything works fine. However, if i add one more point to the linestring i get an: ArgumentException 24200: The specified input does not represent a valid geography instance. I was not able to find any documentation regarding size limitations of sql server´s geography type linestrings

insert geospatial datatype( mutipolygon) in mysql with java( jdbc)

半城伤御伤魂 提交于 2019-12-08 22:37:16
问题 I am using geotools library to extract the location information. With that I am getting an object of type class com.vividsolutions.jts.geom.MultiPolygon I now want to store this field in my mysql table with a jdbc connection . When I directly try to insert it as pstmtInsert.setObject(4, geoobject) I am getting this error Exception in thread "main" com.mysql.jdbc.MysqlDataTruncation: Data truncation: Cannot get geometry object from data you send to the GEOMETRY field 回答1: MySql can't know how

Sailsjs Geospatial Solution with Waterline

喜你入骨 提交于 2019-12-08 19:25:06
问题 It seems like Sailsjs/Waterline does not currently support a POINT type or geospatial indexing with JSON. Are there any ways to customize a schema for certain adapters to support geospatial datatypes? If not, is there a way to integrate a second ORM into Waterline that does so? 回答1: In Sails.js, you need MongoDB (npm install --save sails-mongo) for geospatial indexing, plus you need to ensure the 2dindex gets created in config/bootstrap.js as such (make sure to replace modelname and

Storing 'Point' column from ShapeFile

放肆的年华 提交于 2019-12-08 19:02:28
I have a Shapefile (*.shp) which I am loading into the Database. I have a column called Point" which stores the Data in shapes. For example POLYGON ((1543297.7815 5169880.9468, 1543236.7046 5169848.3834, 1543195.0218 5169930.2767, 1543104.4989 5170101.6818, 1543056.805 5170191.9835, 1542969.1187 5170358.1396, 1542820.9656 5170638.8525, 1542820.6605 5170639.7223, 1542816.1912 5170647.8707, 1543158.2618 5170829.6437, 1543318.4126 5170915.6562, 1543559.2078 5171043.8001, 1543840.2014 5171192.4698, 1544108.917 5171336.1306, 1544271.7972 5171422.313, 1544357.0262 5171263.5454, 1544447.9779 5171091

Distance in meters between two Spacial Points in MySQL query

不羁的心 提交于 2019-12-08 18:16:02
问题 I am trying to query a MySQL database (version 5.7.15) to retrieve all locations that are within 300 meters from some coordinates (40.7542, -73.9961 in my case): SELECT * FROM location WHERE st_distance_sphere(latlng, POINT(40.7542, -73.9961)) <= 300 From the MySQL documentation: ST_Distance_Sphere(g1, g2 [, radius]) Returns the mimimum spherical distance between two points and/or multipoints on a sphere, in meters , or NULL if any geometry argument is NULL or empty. Unfortunately, the query

Problem with a column name contains a colon in PostgreSQL

空扰寡人 提交于 2019-12-08 16:39:07
问题 I downloaded the shape data from OSM. I have imported data from Shapefile into PostgreSQL without any problem but I got an error when I do the select statement. Select addr:city From location; Error: syntax error at or near ":" The problem is because of the column name contains a colon. Could anyone help me with this issue? Should I reject this shapefile in the importing process? Is the shapefile normal? 回答1: If you enclose addr:city with quotes it should work: SELECT "addr:city" FROM

Mongodb and querying that searching polygons that intersect a polygon

我怕爱的太早我们不能终老 提交于 2019-12-08 13:41:20
问题 How to write a query in Mongodb that searches polygons that intersect a polygon? 回答1: Documentation states that: Polygon searches are strictly limited to looking for points inside polygons, polygon shapes in documents can't currently be indexed in MongoDB. Blockquote So it's not yet possible, I'm afraid. 来源: https://stackoverflow.com/questions/7810008/mongodb-and-querying-that-searching-polygons-that-intersect-a-polygon

Need expert's help to solve minor change in spatial data query

半世苍凉 提交于 2019-12-08 13:04:38
问题 i have the following query to access the nearest locations around the given lat-lon. I followed Mr.Ollie's blog Nearest-location finder for MySQL to find nearest locations around given lat-long using haversine formula. But due to lack of much knowledge in spatial data query i failed to execute it properly, so looking for an expert's advice to solve this. Here is my query SELECT z.id, p.distance_unit * DEGREES(ACOS(COS(RADIANS(p.latpoint)) * COS(RADIANS(z.(x(property)))) * COS(RADIANS(p