geography

Smoothing GPS tracked route-coordinates

假装没事ソ 提交于 2019-12-03 17:06:47
I have some data of coordinates that I recorded. Unfortunatelly they seem to be not realy good. They jump sometimes over the map. So now I´m searching for some flattening or filtering algorithm that would make the route look more realistic. Currently my only filter is to calculate the max possible meters travelled in a second (in bus or car or walking) and compare them with the coordinates, throwing those away, that are just not possible within a timeframe. So if a person can walk up to 2.5 meters in a second, and I have two coords that are 10 meters away from each other and they were recorded

How to correct Polygon Ring Orientation using C# Entity Framework 5 DbGeography Spatial Data

谁都会走 提交于 2019-12-03 14:16:32
I'm working with the new Entity-Framework 5 using the Spatial data type DbGeography as part of my model for storing in one instance, a POINT and in another instance a POLYGON. When setting the value of my POLYGON all saves with no error however this is only the case if I draw the Polygon on the map in a clockwise order. If I draw the POLGON in an anti-clockwise direction I get an error the the sql level indicating that the data is an invalid geography type. Now after doing my own research into the problem, it appears to stem from the geography data type being quite strict in terms of a

Getting all zip codes within an n mile radius

别来无恙 提交于 2019-12-03 13:51:09
问题 What's the best way to get a function like the following to work: def getNearest(zipCode, miles): That is, given a zipcode (07024) and a radius, return all zipcodes which are within that radius? 回答1: There is a project on SourceForge that could assist with this: http://sourceforge.net/projects/zips/ It gives you a database with zip codes and their latitude / longitude, as well as coding examples of how to calculate the distance between two sets of coordinates. There is probably a better way

Grouping geographical shapes

ぃ、小莉子 提交于 2019-12-03 11:54:12
I am using Dundas Maps and attempting to draw a map of the world where countries are grouped into regions that are specific to a business implementation. I have shape data (points and segments) for each country in the world. I can combine countries into regions by adding all points and segments for countries within a region to a new region shape. foreach(var region in GetAllRegions()){ var regionShape = new Shape { Name = region.Name }; foreach(var country in GetCountriesInRegion(region.Id)){ var countryShape = GetCountryShape(country.Id); regionShape.AddSegments(countryShape.ShapeData.Points,

How can I convert Geometry data into a Geography data in MS SQL Server 2008?

穿精又带淫゛_ 提交于 2019-12-03 11:35:50
How can I convert some Geometry data into Geography data in MS SQL Server 2008? Yes you can but the geometry datatype is more forgiving than the geography in my experience. So there is some data you might have in geometry that you can't convert. This article from Spatial Ed was very helpful explaining how to fix data problems and also has some sample queries to convert from Geom to Geog. 来源: https://stackoverflow.com/questions/279983/how-can-i-convert-geometry-data-into-a-geography-data-in-ms-sql-server-2008

PHP/MySQL: Select locations close to a given location from DB

情到浓时终转凉″ 提交于 2019-12-03 06:19:17
问题 In PHP, I have the following code for calculating the distance between two locations: <?php function distance($lat1, $long1, $lat2, $long2) { // DEGREE TO RADIAN $latitude1 = $lat1/180*pi(); $longitude1 = $long1/180*pi(); $latitude2 = $lat2/180*pi(); $longitude2 = $long2/180*pi(); // FORMULA: e = ARCCOS ( SIN(Latitude1) * SIN(Latitude2) + COS(Latitude1) * COS(Latitude2) * COS(Longitude2-Longitude1) ) * EARTH_RADIUS $distance = acos(sin($latitude1)*sin($latitude2)+cos($latitude1)*cos(

Getting all zip codes within an n mile radius

大城市里の小女人 提交于 2019-12-03 03:48:16
What's the best way to get a function like the following to work: def getNearest(zipCode, miles): That is, given a zipcode (07024) and a radius, return all zipcodes which are within that radius? There is a project on SourceForge that could assist with this: http://sourceforge.net/projects/zips/ It gives you a database with zip codes and their latitude / longitude, as well as coding examples of how to calculate the distance between two sets of coordinates. There is probably a better way to do it, but you could have your function retrieve the zipcode and its coordinates, and then step through

world map without rivers with matplotlib / Basemap?

你说的曾经没有我的故事 提交于 2019-12-03 03:47:14
问题 Would there be a way to plot the borders of the continents with Basemap (or without Basemap, if there is some other way), without those annoying rivers coming along? Especially that piece of Kongo River, not even reaching the ocean, is disturbing. EDIT: I intend to further plot data over the map, like in the Basemap gallery (and still have the borderlines of the continents drawn as black lines over the data, to give structure for the worldmap) so while the solution by Hooked below is nice,

PHP/MySQL: Select locations close to a given location from DB

情到浓时终转凉″ 提交于 2019-12-02 19:44:19
In PHP, I have the following code for calculating the distance between two locations: <?php function distance($lat1, $long1, $lat2, $long2) { // DEGREE TO RADIAN $latitude1 = $lat1/180*pi(); $longitude1 = $long1/180*pi(); $latitude2 = $lat2/180*pi(); $longitude2 = $long2/180*pi(); // FORMULA: e = ARCCOS ( SIN(Latitude1) * SIN(Latitude2) + COS(Latitude1) * COS(Latitude2) * COS(Longitude2-Longitude1) ) * EARTH_RADIUS $distance = acos(sin($latitude1)*sin($latitude2)+cos($latitude1)*cos($latitude2)*cos($longitude2-$longitude1))*6371; return $distance; } echo distance(9.9921962, 53.5534074, 9

Calculate distance between 2 lon lats but avoid going through a coastline in R

风流意气都作罢 提交于 2019-12-02 05:20:41
问题 I am trying to calculate the closest distance between locations in the ocean and points on land but not going through a coastline. Ultimately, I want to create a distance to land-features map. This map was created using rdist.earth and is a straight line distance. Therefore it is not always correct because it not taking into account the curvatures of the coastline. c<-matrix(coast_lonlat[,1], 332, 316, byrow=T) image(1:316, 1:332, t(c)) min_dist2_feature<-NULL for(q in 1:nrow(coast_lonlat)){