geospatial

Insert a circle into geometry data type

你离开我真会死。 提交于 2019-12-21 06:30:18
问题 I'm about to start using geometry or geography data types for the first time now that we have a development baseline of 2008R2 (!) I'm struggling to find how to store the representation for a circle. We currently have the lat and long of the centre of the circle along with the radius, something like :- [Lat] [float] NOT NULL, [Long] [float] NOT NULL, [Radius] [decimal](9, 4) NOT NULL, Does anyone know the equivalent way to store this using the STGeomFromText method, ie which Well-Known Text

Snap a point to the closest point on a line segment using sf

*爱你&永不变心* 提交于 2019-12-21 05:49:08
问题 I would like to snap a point to the closest point on a road segment using sf::st_snap . However, the function seems to return the wrong result, it's snapping my point to a point at the start of the road segment. Any ideas on how to fix this? Reproducible example provided below, including a comparision of the results I get when using sf::st_snap vs maptools::snapPointsToLines Using sf::st_snap # Max distance cut_dist = 200 # meters # snap points to closest road new_point <- sf::st_snap(point1,

How do I convert a geodetic location to an ECF position that works with the terrain model in Cesium

妖精的绣舞 提交于 2019-12-21 05:48:14
问题 I'm trying to put a point at the top of Mount Everest in Cesium. My most likely candidate as of last night was the code I borrowed to do geodetic to ecef conversion (from PySatel.coord). Upon review this morning, it appears to be correct: a = 6378.137 b = 6356.7523142 esq = 6.69437999014 * 0.001 e1sq = 6.73949674228 * 0.001 f = 1 / 298.257223563 def geodetic2ecef(lat, lon, alt): """Convert geodetic coordinates to ECEF. Units are degrees and kilometers. """ lat, lon = radians(lat), radians(lon

Get places in radius of a certain point using SQL geography

邮差的信 提交于 2019-12-21 04:49:29
问题 I have an SQL table column with the Geography type: create table dbo.Events ( Id int identity not null constraint PK_Events_Id primary key clustered (Id), Localization geography not null ); How can I get all events in a radius of 40 km? Is this possible? Thank You, Miguel 回答1: Assuming you have latitude and longitude of the point from which you want to search: DECLARE @Origin GEOGRAPHY, -- distance defined in meters @Distance INTEGER = 40000; -- center point SET @Origin = GEOGRAPHY:

R_Extracting coordinates from SpatialPolygonsDataFrame

烈酒焚心 提交于 2019-12-21 01:29:12
问题 Is it only me who have the problem with extracting coordinates of a polygon from SpatialPolygonsDataFrame object? I am able to extract other slots of the object ( ID , plotOrder ) but not coordinates ( coords ). I don't know what I am doing wrong. Please find below my R session where bdryData being the SpatialPolygonsDataFrame object with two polygons. > bdryData An object of class "SpatialPolygonsDataFrame" Slot "data": ID GRIDCODE 0 1 0 1 2 0 Slot "polygons": [[1]] An object of class

Create a SqlGeography polygon-circle from a center and radius

谁都会走 提交于 2019-12-20 20:01:40
问题 I would like to save a circle in a sql-server 2008 geography field, using c#. In c# I have a latitude, a longitude and a radius but I just can't find a way to calculate the polygon that would represent the circle and create a SqlGeography from it. I have tried to following function to create the polygon: private List<Coordinate> getCirclePoints(Coordinate center, int radius, int speed) //speed 1: draws 360 sides, 2 draws 180 etc... { var centerLat = (center.Latitude * Math.PI) / 180.0; //rad

Is it against license to publish Oracle and SQL Server performance test? [closed]

梦想的初衷 提交于 2019-12-20 18:05:04
问题 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 7 years ago . I would like to make a performance test on spatial index in Oracle and SQL Server. I would like to include it in my Master of Science work. Is it against dbms's license to publish that kind of results ? Maybe someone have already met that kind of problem ? I am not keen on digging through boring license stuff ;)

Is it against license to publish Oracle and SQL Server performance test? [closed]

…衆ロ難τιáo~ 提交于 2019-12-20 18:04:33
问题 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 7 years ago . I would like to make a performance test on spatial index in Oracle and SQL Server. I would like to include it in my Master of Science work. Is it against dbms's license to publish that kind of results ? Maybe someone have already met that kind of problem ? I am not keen on digging through boring license stuff ;)

Indexing a mysql table for geo lookup using latitude/longitude

余生长醉 提交于 2019-12-20 09:45:53
问题 I have a legacy innodb table Listing containing a business with latitude/longitude. Given an input latitude/longitude (below 51.2167/4.41667), the query is to return the first active, enabled, not-deleted 30 businesses in order of proximity (kilometers). A join with the accounts table is made to check the validity of the listing. select listing.* from listing listing , account account where listing.account_id = account.id and listing.active = 1 and listing.approved = 1 and listing.deleted = 0

Which algorithm can efficiently find a set of points within a certain distance of a path?

拟墨画扇 提交于 2019-12-20 09:23:54
问题 Given a set of points s (a set of x,y coordinates) and a path that is made up of line segments joining a set of points l , describe an efficient algorithm that can be used to find a subset of points from s that are within the specified distance d of the path l . A practical application of this may be to find a list of restaurants within 10 miles anywhere along a road trip path between cites. For example, in the following diagram, the points in green would be included in the search results.