geospatial

why gIntersection is giving TopologyException if both polygons are valid?

爷,独闯天下 提交于 2019-12-11 04:56:50
问题 I'm trying set97 <- gIntersection(setbp,d97) and getting the error message: Error in RGEOSBinTopoFunc(spgeom1, spgeom2, byid, id, "rgeos_intersection") : TopologyException: found non-noded intersection between LINESTRING (533036 -314770, 533036 -314770) and LINESTRING (533036 -314780, 533036 -314770) at 533035.88110651996 -314769.97350772272 (setbp is a sector of a county - for census purposes - and d97 is the deforestation in brazilian Amazon up to 1997.) When I do gIsValid(d97) gIsValid

Search engine by distance

我只是一个虾纸丫 提交于 2019-12-11 04:35:29
问题 I am looking to make an option of my serach engine on my site so that users can search for items within a set distance, e.g. search items within 10 miles, or 20 miles etc. I was wondering how this could be done? The user would have to enter thier postcode, while i also have the postcode of the item's location and once they hit search there needs to be a away to work the distance between the two locations in miles and then display the results in order by distance; as in the closest item is the

Large MySQL DB (21MM records) with location data - each location has lat and long - need to run 'nearby' query

拜拜、爱过 提交于 2019-12-11 04:18:41
问题 We have a large location DB - with lat long specified for each row. The DB is hosted in MySQL. We need to run two type of queries: places nearby (sort by distance) places nearby by category (where category is a column) With the number of records growing, this query seems to slow down drastically. SELECT *, ( 3959 * acos( cos( radians(40.759105) ) * cos( radians( Latitude ) ) * cos( radians( longitude) - radians(-73.984654) ) + sin( radians(40.759105) ) * sin( radians( Latitude ) ) ) ) as

Why can shapely/geos parse this 'invalid' Well Known Binary?

我只是一个虾纸丫 提交于 2019-12-11 03:54:15
问题 I am trying to parse Well Known Binary a binary encoding of geometry objects used in Geographic Information Systems (GIS). I am using this spec from ESRI (same results here from esri). I have input data from Osmosis a tool to parse OpenStreetMap data, specifically the pgsimp-dump format which gives the hex represenation of the binary. The ESRI docs say that there should only be 21 bytes for a Point , 1 byte for byte order, 4 for uint32 for typeid, and 8 for double x and 8 for double y. An

Howto get any item (Point, LineString, Polygon) within a bounding box in mongodb

点点圈 提交于 2019-12-11 02:36:08
问题 I've a problem with a query matching items inside a BoundingBox. How it's possible to match all items of type 2dsphere (GEO JSON)? In this case I only got the data of type Point but the items of type LineString won't appear inside the result. The schema definition looks like the following example: /** * Media location values (Point, LineString, Polygon) * @property location * @type {Object} */ location:{ "type":Object, "index":"2dsphere" }, I've e.g. this items in it: [ { "_account":

Can't get Python IDLE to recognize OGR/GDAL Module

落花浮王杯 提交于 2019-12-11 02:19:01
问题 Folks, Just getting started using OGR and Python for a variety of geospatial tasks. I'm working outside of OSGEO4w, and have installed GDAL w/ Python Bindings as well as Python v. 2.7.8 on my machine. That said, I can run python and import gdal from a command-line interface but am unable to import the module when I use the IDLE environment. It returns an error telling me that the module doesn't exist. My install must be sound given that it works in the cmd prompt, so what's the deal? This is

Find records within Geofence (circle) using MySQL Spatial fields

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 02:14:09
问题 The Issue I am currently storing the latitude and longitude values for a location using the MySQL POINT field type in the format: POINT(51.507351 -0.127758) I have never before used this kind of field type, and therefore do not have any experience with the queries, and how to actually, efficiently, use the data stored. My Research I have found many links that demonstrate various methods to search for items within a specified radius. However, most of these are using independent latitude and

Using MySQL GeoSpatial data types in .NET

谁说胖子不能爱 提交于 2019-12-11 01:30:03
问题 I'm looking for information on how to use MySQL geometry types in .NET. I'm using Sub-sonic for ORM and don't really need to support much more than MySQL's POINT type. The MySQL .NET connector seems to return point data as a byte[] array in the OpenGIS WKB format. What libraries are recommended for working with this WKB format? Alternatively, since I only need support for Point, examples on converting WKB to/from a .NET type would probably suffice. Assuming I can find (or build) a class that

How do I perform a find using $geoIntersects / 2dsphere in an array subfield?

扶醉桌前 提交于 2019-12-11 01:27:47
问题 I have a collection with documents and each has a field array with polygons. I want to test if my polygon geoIntersects any of those polygons. They are all box-shaped if it helps. I will add bounty points if you add in the possibility of having my polygon in that array I'm testing. I wouldn't want it intersect with itself... Cities: {_id, buildings:[ {coo:{shape:"Polygon", coordinates:[ [0,0], [4,0], [4,5], [5,0],[0,0] ] }, {coo:{shape:"Polygon", coordinates:[ [0,0], [4,0], [4,5], [5,0],[0,0]

Howto insert geometry in h2 using sql

非 Y 不嫁゛ 提交于 2019-12-11 01:00:01
问题 Since a couple of versions, h2 does have support for spatial geometries. It's not a problem to select and insert geometries in java. But how can insert them in pure sql? Documentation shows it uses WKT. But when I try to insert in WKT I got an error. That's an example insert: insert into feature (id, name, description, geom) values (1, 'example name', 'example description', 'SRID=4326;POINT(7 52)'); Thanks for any hints! 回答1: As far as I see, the suffix SRID=4326 is not WKT (Well-Known Text),