Spatial

Transform/ Project a geometry from one SRID to another

荒凉一梦 提交于 2019-11-29 10:48:07
I have a database table which currently holds geometric data in SRID 27700 (British National Grid). While retrieving the data however I need to transform it to SRID 4326 (WGS84). Is there any way to apply a function such as ST_Transform found in PostGIS to my data in order to get the result I need? NOTE: The solution needs to be able to be implemented using T-SQL and not stored procedures etc. I have to be able to construct a statement and have it saved in a table as a string field for retrieval later. This is because my solution is database agnostic. The way I am currently doing this in

Difference between Microsoft.OData.Core and Microsoft.Data.OData

╄→гoц情女王★ 提交于 2019-11-29 10:47:40
I am working on Web Api with OData enabled. I started working by referring to ( only the relevant dlls to the question are mentioned ) Microsoft.AspNet.WebApi.OData Microsoft.Data.OData Microsoft.Data.Edm System.Spatial But when I found out OData is by default case-sensitive , I look for a solution of case insensitive and I have gone through few post Support OData Uri case insensitive parse & ODataLib 6.7.0 Release then finally landed into nuget package Microsoft.OData.Core 6.9.0 which seems to be solving my problem. Here my confusion starts , It has its own collection related libraries under

Spatial Data in PostgreSQL

随声附和 提交于 2019-11-29 10:45:39
问题 PostgreSQL supports a variety of geometric types out of the box, along with lots of geometric operators and GiST indexes which seem to offer spatial indexing of data. And then there's also PostGIS, which is an extension to PG. What is the difference between the built-in spatial support in PG and PostGIS? If my application needs to store geographical coordinates (points, areas, polygons) and then efficiently do queries (such as point-in-polygon, polygon intersection), do I need PostGIS or can

Mysql spatial distance using POINT - Not working

戏子无情 提交于 2019-11-29 09:49:08
问题 My goal is to use mysql POINT(lat,long) to find nearby entities in the database. I'm trying to do something like in the bottom of this tutorial http://www.scribd.com/doc/2569355/Geo-Distance-Search-with-MySQL . Here is what I have got: Table: CREATE TABLE mark ( id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(20) DEFAULT NULL, loc POINT NOT NULL, SPATIAL KEY loc (loc) ) ENGINE=MyISAM; Inserting some test-data: INSERT INTO mark (loc,name) VALUES (POINT(59.388433,10.415039),

mysql 索引

孤街浪徒 提交于 2019-11-29 09:37:41
记录一些关于mysql的实践信息 索引类型分为:FULLTEXT、NORMAL、SPATIAL、UNIQUE 索引方法:BTREE、HASH FULLTEXT:全文索引,只针对英文有效,提升使用like %xxx%检索效率 NORMAL:一般索引, SPATIAL:空间索引,使用RTREE的方式,存储几何二进制大数据搜索。 组合索引:就是多个字段组成一个索引叫组合索引,需要注意组合索引有最左优先算法,比如(A,B,C)查询条件中(A)、(A,B)、(A,B,C)会使用索引,(B)、(C)、(B,C)的查询都不会使用索引。同时使用组合索引时,需要注意select后面的字段会影响是否走索引,需要多用EXPLAIN来检查查询情况,尤其是带有OR的查询语句。 组合索引中限制条件比较多,得多检查下索引使用情况。 来源: https://my.oschina.net/uwith/blog/3105365

Rules engine for spatial and temporal reasoning?

浪尽此生 提交于 2019-11-29 05:19:55
I have an application that receives a number of datums that characterize 3 dimensional spatial and temporal processes. It then filters these datums and creates actions which are then sent to processes that perform the actions. Rinse and repeat. At present, I have a collection of custom filters that perform a lot of complicated spatial/temporal calculations. Many times as I discuss my system to individuals in my company, they ask if I'm using a rules engine. I have yet to find a rules engine that is able to reason well temporally and spatially. (Things like: When are two 3D entities ever close?

MySQL - Find points within radius from database

泄露秘密 提交于 2019-11-29 04:36:38
I have a table which has a POINT column containing the latitude and longitude of various locations. I then also have a users location from geo-location in the browser. What I need to be able to do is find all records from the table where the POINT value in the is within a 10 km radius (or X km radius), ordered by distance with the closest first. My table has a SPATIAL index on the POINT column. I'm currently working on a project where I'm calculating distances between multiple locations. I'm using the following query for selecting object_id's which are within a given radius. SELECT id, ( 6371

Adding scale bar to ggplot map

前提是你 提交于 2019-11-29 04:09:31
I've produced this map in ggplot2 : library(maptools); library(ggplot2) data(wrld_simpl) world <- fortify(wrld_simpl) worldUk <- subset(world, id=="GBR") ggplot() + geom_path(aes(long, lat, group=group), data=worldUk, color="black", fill=NA) + coord_equal() Using photoshop, I've added a scale bar to the map. How can I add a similar scale bar using ggplot2 ? This post adds a scale bar, but the bar doesn't refer to distance: scale bar and north arrow on map-ggplot2 There is a library called ggsn , which allows you to customize the scale bar and north arrow. ggplot() + geom_path(aes(long, lat,

How to Import shape file into MySQL

情到浓时终转凉″ 提交于 2019-11-29 03:11:11
问题 I need to import the spatial data in shape file into MySQL tables. I am able to import into PostGreSQL. Any pointers for MySQL. I need the data in MySQL table. 回答1: try this whit FWtool instaled ogr2ogr -f MySQL MySQL:database_name,host=localhost,user=root,password=1234 C:\route_path\line.shp -nln datatable_name -update -overwrite -lco engine=MYISAM try install for better result in any proces Osgeo4w http://trac.osgeo.org/osgeo4w/ 回答2: I have just used the ogr2ogr command line tool to import

How to extract data from a RasterBrick?

∥☆過路亽.° 提交于 2019-11-29 02:25:56
I have a RasterBrick consisting of monthly rainfall data over 7 years, so it has 7 layers with 12 slots each: rainfall <- brick("Rainfall.tif") > rainfall class : RasterBrick dimensions : 575, 497, 285775, 7 (nrow, ncol, ncell, nlayers) resolution : 463.3127, 463.3127 (x, y) extent : 3763026, 3993292, -402618.8, -136213.9 (xmin, xmax, ymin, ymax) coord. ref. : +proj=sinu +lon_0=0 +x_0=0 +y_0=0 +a=6371007.181 +b=6371007.181 +units=m +no_defs data source : in memory names : layer.1.1, layer.2.1, layer.1.2, layer.2.2, layer.1, layer.2, layer min values : 239.6526, 499.8343, 521.0316, 617.2896,