geospatial

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

纵然是瞬间 提交于 2019-12-06 18:58:45
问题 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? 回答1: 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

mongodb and geospatial schema

坚强是说给别人听的谎言 提交于 2019-12-06 16:56:21
im breaking my head with mongo and geospatial, so maybe someone has some idea or solution how to solve this: my object schema is like this sample for geoJSON taken from http://geojson.org/geojson-spec.html . { "name":"name", "geoJSON":{ "type":"FeatureCollection", "features":[ {"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[100,0],[101,0],[101,1],[100,1],[100,0]]]},"properties":{}}, {"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[100,0],[101,0],[101,1],[100,1],[100,0]]]},"properties":{}}, {"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[100,0],

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

℡╲_俬逩灬. 提交于 2019-12-06 16:29:50
问题 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

Mongodb 2dsphere index for nested array field

ⅰ亾dé卋堺 提交于 2019-12-06 15:59:57
I have created collection and a object is looks like this. [_id] => MongoId Object ( [$id] => 53087f483b15eaeb6c3c9869 ) [time_from] => 2014-02-22 00:00:00 [time_to] => 2014-02-22 00:10:00 [checkin] => Array ( [0] => Array ( [time_frame] => 2014-02-22 00:00:56 [user_id] => 1 [loc] => Array ( [type] => Point [coordinates] => Array ( [0] => 73.43 [1] => 42.22 ) ) ) [1] => Array ( [time_frame] => 2014-02-22 00:00:56 [user_id] => 2 [loc] => Array ( [type] => Point [coordinates] => Array ( [0] => 73.10 [1] => 42.97 ) ) ) } I need to create "2dsphere" index for 'loc' field. The checkin field has all

SQL Server Geography Point

。_饼干妹妹 提交于 2019-12-06 14:35:03
I have recently been researching the SQL Server spatial data types and have decided to try and store my long, lat points in a geography field. However I cannot figure out how to insert the data into the field, I have tried using stuff like "POINT(double, double), 0" and weird stuff like that, but no success. Also im curious as to what the purpose of the ID argument specified in the geography functions. Thanks, Alex. Have you looked at the examples from MSDN? From geography (Transact-SQL) : IF OBJECT_ID ( 'dbo.SpatialTable', 'U' ) IS NOT NULL DROP TABLE dbo.SpatialTable; GO CREATE TABLE

kdtree for geospatial point search

China☆狼群 提交于 2019-12-06 14:23:08
问题 I'm attempting to find nearest neighbors for point geometry with latitude and longitude information available to me. After much search I concluded that using a kd-tree based approach would be the best option. I have so far tried three different approaches with kd-tree, none of which have worked. Using mercator (UTM) projections. This was least useful as the distance calculation turned out to be completely wrong particularly since the points are spread all over the globe. Using latitude and

a failed attempt at placing a dot over an image based on known lat and lng points

主宰稳场 提交于 2019-12-06 13:33:36
I apologize for the vague title, I really can't figure out a batter way to sum it up. Suggestions are more than welcome. I'm working on a project that really doesn't NEED a google map, it'd just create extra overhead for this project. But, I can't figure out how to do this WITHOUT google maps... so far. If I were to place a graphical overlay of a floor plan into google maps, I could use a browser location to approximate a users position. For this, it's a VERY large place, so there's room for some poor accuracy. Now what I'm trying to do is knowing the bounding of that overlay, place the image

Improving performance of spatial MySQL query

耗尽温柔 提交于 2019-12-06 12:10:38
问题 I have a query that returns all records, ordered by distance from a fixed point, compared to a POINT field in my MySQL 5.7 database. For a simple example, lets say it looks like this: SELECT shops.*, st_distance(location, POINT(:lat, :lng)) as distanceRaw FROM shops ORDER BY distanceRaw LIMIT 50 My actual query also has to do a few joins to get additional data for the results. The issue is, that in order to sort the data by distance, it needs to calculate the distance over every single record

Why is crop sometimes introducing NAs on a categorical raster?

房东的猫 提交于 2019-12-06 10:56:04
library(raster) r <- raster('glc2000_v1_1') # http://forobs.jrc.ec.europa.eu/products/glc2000/products/glc2000_v1_1_Grid.zip extent(r) # class : Extent # xmin : -180.0045 # xmax : 179.9955 # ymin : -56.01339 # ymax : 89.99554 ext <- extent(-69,-63,-3,3) r1 <- crop(r,ext) #Warning message: #In .getRat(x, ratvalues, ratnames, rattypes) : NAs introduced by coercion If I try to crop a smaller area, it works fine. ext <- extent(-68,-64,-2,2) r1 <- crop(r,ext) # works fine This error is preventing me from saving the file with writeRaster, but I have no idea of what's going on. Another user found the

MongoDB Geospatial Query Count Issue (Always 100)

旧时模样 提交于 2019-12-06 10:32:57
问题 It appears there is an issue with the count operation on a geospatial query that contains more than 100 results. If I run the following query I still get a count of 100 no matter what. db.locations.find({"loc":{$nearSphere:[50, 50]}}).limit(1000).count() I understand that the default size limit on a query that uses the "near" syntax is 100 but it appears you cannot return more than that. Am I doing something wrong or is there a workaround for this? 回答1: Try "within" instead of "near". This