geospatial

Entity Framework Code First truncating my decimals

不想你离开。 提交于 2019-12-29 07:28:27
问题 I am using Entity Framework 6.x using the Code First approach on an MVC 5 application. In this particular situation my model (among other things) contains two properties named Latitude and Longitude: [Required, Range(-90, +90)] public decimal Latitude { get; set; } [Required, Range(-180, +180)] public decimal Longitude { get; set; } And when I performed the migration I got something like this CreateTable("ResProperty"), c => new { : Latitude = c.Decimal(nullable: false, precision: 10, scale:

Calculate endpoint given distance, bearing, starting point

你。 提交于 2019-12-28 06:46:05
问题 I am trying to find the destination point, given a starting point lat/long, bearing & distance. The calculator from this website below gives me the desired results. http://www.movable-type.co.uk/scripts/latlong.html When I try to implement the same through code, I don't get the right results. Below is my code - private GLatLng pointRadialDistance(double lat1, double lon1, double radianBearing, double radialDistance) { double rEarth = 6371.01; lat1 = DegreeToRadian(lat1); lon1 = DegreeToRadian

Buffer (geo)spatial points in R with gbuffer

一曲冷凌霜 提交于 2019-12-28 02:56:09
问题 I'm trying to buffer the points in my dataset with a radius of 100km. I'm using the function gBuffer from the package rgeos . Here's what I have so far: head( sampledf ) # postalcode lat lon city province #1 A0A0A0 47.05564 -53.20198 Gander NL #4 A0A1C0 47.31741 -52.81218 St. John's NL coordinates( sampledf ) <- c( "lon", "lat" ) proj4string( sampledf ) <- CRS( "+proj=longlat +datum=WGS84" ) distInMeters <- 1000 pc100km <- gBuffer( sampledf, width=100*distInMeters, byid=TRUE ) I get the

What's the difference between “area” and “BoundingBox” from Redis's source code

谁都会走 提交于 2019-12-25 08:56:30
问题 http://download.redis.io/redis-stable/deps/geohash-int/geohash_helper.c From the URL above, we know there are two conceptions , one is geohashBoundingBox ,and another is area,My questions is what's the difference between them and why we need them both? Also why sentence "geohashGetCoordRange(&long_range, &lat_range);" is called two times? GeoHashRadius geohashGetAreasByRadius(double longitude, double latitude, double radius_meters) { GeoHashRange long_range, lat_range; GeoHashRadius radius =

Oracle code to calculate distance between point/centroids/polygons

天大地大妈咪最大 提交于 2019-12-25 01:38:53
问题 I've centroids for customer A and customer B. Now I need to calculate distance between customer A and B into miles using centroids. How can I do it in Oracle? Right now, I'm using alteryx "distance" spatial tool for centroid distance calculation but need to convert it into oracle query. Thanks! 回答1: If you have Cartesian coordinates then the approximate distance if given by the Pythagorean theorem as already provided by Matthew. For Lat/Lon values you should use the Oracle build in SDO_GEOM

Confusion about the mask() function in the raster package

筅森魡賤 提交于 2019-12-24 23:53:17
问题 I apologise in advance for the very basic nature of this question, but I'm confused about how the mask() function works in the raster package in R. Reading the documentation for the function it sounds like cells in raster x are set to NA (the default) if these cells match a maskvalue in a mask object (the default maskvalue being NA). However, the description of the mask() function in the book Geocomputation with R by Lovelace et al. (https://geocompr.robinlovelace.net/spatial-operations.html

Summer in Greece, vol.2

早过忘川 提交于 2019-12-24 14:28:43
问题 Following this qeustion: Summer in Greece with SPARQL, since my memory runs out when executing this query, I would like to constrain the query between two regional units, but I can't group them: SELECT * #?municipality (?bwCount1+?bwCount2 as ?bwCount) WHERE { { SELECT (COUNT(?bw) as ?bwCount1) WHERE { ?regional_unit geo:έχει_επίσημο_όνομα "ΠΕΡΙΦΕΡΕΙΑΚΗ ΕΝΟΤΗΤΑ ΗΡΑΚΛΕΙΟΥ" . ?municipality1 geo:ανήκει_σε ?regional_unit . ?municipality1 geo:έχει_γεωμετρία ?geometry . ?bw geos:hasGeometry ?bw_geo

Find how many (googlemap) polygons near x distance of a point

只愿长相守 提交于 2019-12-24 11:04:15
问题 I'm working on a MYSQL/PHP system where I have the following: -- a set of latitude, longitude in the form of (lat,lng) stored as text format : (lat1,lng1)#(lat2,lng2)#(lat3,lng3) etc. which is basically a polygon drawn over a googlemap instance stored in the database. -- a table which stores in a field - a point's coordinates P(plat,plng) which is basically a point where a device is stationed I need to figure out how many polygons from the first table are within a distance of X kilometers

MongoDB geospatial index on an array (multikey + geospatial)

痞子三分冷 提交于 2019-12-24 07:07:21
问题 Here is a simplified version of my data: > db.foo.insert({"name" : "jim", "locations" : [[10,10],[3,6],[1,2]]}) > db.foo.insert({"name" : "john", "locations" : [[1,5],[2,4]]}) I would like to be able to do things like > db.foo.find( { locations : { $near : [5,5] } } ) Is there a way to create a geospatial index on an array? Doing: > db.foo.ensureIndex({locations: "2d"}) gives the following error: geo values have to be numbers: { 0: [ 1.0, 5.0 ], 1: [ 2.0, 4.0 ] } Any advice or resources would

Calculating great circle distance in r programming with high data resolution

放肆的年华 提交于 2019-12-24 05:50:10
问题 I'm new to R programming but I'm calculating the great circle distance flown by a long haul airliner and I've tried rdist.earth() from the Fields package, soDistsN1() from the sp package and other commands. Plus I've pretty much exhausted Google in my search. It's easy to do this in Matlab but I can't seem to find a way in R. The problem is when I increase the data resolution (amount of waypoints calculated) my total distance goes haywire. I'm guessing it is because of how I summarize the