geospatial

Combine (union?) and simplify/reduce DbGeometry records for GeoJson

旧城冷巷雨未停 提交于 2019-12-24 04:37:10
问题 I have a number of spatial entities in a table, with a geometry field called Boundaries . I want to produce a GeoJson file with the simplified shapes/geometries. This is my first attempt: var entities = await db.Entities.ToListAsync(); dynamic geoJson = new ExpandoObject(); geoJson.type = "FeatureCollection"; var features = new List<dynamic>(); foreach (var entity in entities) { // simplify (uses SqlGeometry.Reduce) var simplified = Utilities.Geo.Simplify(entity.Boundaries, tolerance); //

Faceted search with geo-index using CouchDB

耗尽温柔 提交于 2019-12-24 01:53:59
问题 CouchDB offers the ability to perform faceted search via Lucene. I would like to perform a faceted search where one of the facets is geospatial (e.g. within 30km of a lat/long). Is this possible, and if so how? 回答1: Check out GeoCouch it's a fork of CouchDB that supports geospatial queries/indexes. 来源: https://stackoverflow.com/questions/9101367/faceted-search-with-geo-index-using-couchdb

elasticsearch rails - illegal latitude value

青春壹個敷衍的年華 提交于 2019-12-24 01:14:21
问题 When trying to search from latitude dynamically from records in my index I've been getting an illegal latitude value. When looking at my index I can't see any invalid latitude and longitude values, so I'm guessing it's an error in my code. Exact error; {"type":"query_parsing_exception","reason":"illegal latitude value [269.99999983236194] for [geo_distance]","index":"addresses","line":1,"col":172}}]},"status":400} Model code for search; def self.search(query) __elasticsearch__.search( { query

STintersects() to find the Intersection point

妖精的绣舞 提交于 2019-12-23 19:18:17
问题 I have two sql server geometry -ies which I am using to check if they intersect. If they do I need the intersection point. Currently I can get only Boolean output where if it intersects = 1 and if it does not intersect it will give =0 . Is there any way I can find the intersection of two shapes in geometry ? Update this question led to my next question concerning how can one check if a point (lat/long) exists in a region which has 4000 points (lat/long). Can one use stcontains or stintersects

Faceting on distance in solr- how to generate links that search withing a given range of distance

穿精又带淫゛_ 提交于 2019-12-23 18:41:45
问题 It is fairly simple to generate facets for ranges or 'buckets' of distance in Solr: http://wiki.apache.org/solr/SpatialSearch#How_to_facet_by_distance What isnt described is how to generate the links for these facets If this is the query to return everything within 5km : &q= : &fq={!geofilt sfield=store}&pt=45.15,-93.85&d=5 -what then would be the syntax to search for everything between 5 and 10km ? Basically I can generate distance facets, but I dont know how to generate the links for the

How to combine multiple LineString rows into a single row collection

南笙酒味 提交于 2019-12-23 13:06:41
问题 I'm using SQL Server 2008 and the Geometry datatype to store a list of UK a roads, which I've imported from the Ordanance Survey STRATEGI data set. Each road is split into multiple rows, which each contain a single line (A Linestring made up of one segment) . For instance the A369 is made up of 18 seperate lines, as shown in the image below: What I'd like to do it collect all the seperate rows containing portions of a road and create a new row which holds all the combined individual lines as

Why are coordinates of polygon GeoJSON Objects stored in an array of array?

五迷三道 提交于 2019-12-23 12:41:15
问题 As seen in the Official documentation page, "Schema" of the polygon GeoJSON Object is as below: db.someCollection.insert({ type: "Polygon", coordinates: [ [ [ 0 , 0 ] , [ 3 , 6 ] , [ 6 , 1 ] , [ 0 , 0 ] ] ] }); why cannot it be simply as shown below: Type A db.someCollection.insert({ type: "Polygon", coordinates: [ [ 0 , 0 ] , [ 3 , 6 ] , [ 6 , 1 ] , [ 0 , 0 ] ] }); I assume the reason might be to store multiple geofences....am i right? Something like: Type B db.someCollection.insert({ type:

How to insert DbGeography to SQL Server using dapper

风流意气都作罢 提交于 2019-12-23 12:19:08
问题 I've created the model using System.Data.Entity.Spatial; public class Store { public int Id { get; private set; } public string Name { get; set; } public string Address { get; set; } public DbGeography Location { get; set; } } Inserting to DB using (SqlConnection conn = SqlHelper.GetOpenConnection()) { const string sql = "INSERT INTO Stores(Name, Address, Location) " + "VALUES (@Name, @Address, @Location)"; return conn.Execute(sql, store); } i get the exception type System.Data.Entity.Spatial

Which longitude/latitude adjustments do I need to enlarge my map to the northwest and to the southeast?

[亡魂溺海] 提交于 2019-12-23 06:07:14
问题 This is related to my earlier question I want to add a "shim" to my map so that the extreme pushpins aren't half-in bounds, half out-of-bounds. I'm on the right track (no pun intended), but my logic is faulty. I wrote this method: // Adapted from Brundritt and Boonaert: https://stackoverflow.com/questions/26937358/can-i-adjust-my-bing-maps-view-locationrect-bounding-box-by-a-small-amount public static Location GetAShimLocation(IList<Location> locations, bool IsForNorthwestCorner) { const

How to calculate the Azimuth between two points in PostGIS?

£可爱£侵袭症+ 提交于 2019-12-23 05:17:37
问题 I have a GIS API based on OpenLayers. I have been trying to implement Azimuth calculation in JavaScript and I needed some way to calculate the Azimuth in order to perform tests. I started using PostGIS, but there seem to be many ways to calculate the Azimuth between two points. I show you three of them and, some return different results. -- Example 1 - Result 90 SELECT ST_Azimuth( ST_Transform(st_geomfromtext('POINT(-81328.998084106 7474929.8690234)', 900913), 4326), ST_Transform(st