spatial-query

Querying SQL Server geospatial data from R

狂风中的少年 提交于 2021-02-08 20:52:47
问题 Edited: I have added login details to a demo SQL Server 2017. I am querying an SQL Server from R using the FreeTDS driver (preferred over the Microsoft odbc driver as it supports Windows authentication in Linux). I'm struggling to interpret the geometry column with st_read . The connection is initiated as such: library(odbc) library(DBI) library(sf) username <- 'SO-user' sql_server_ip <- '35.214.169.110' password <- 'SQLaskingfortrouble?!' con <- dbConnect(odbc(), Driver = "FreeTDS", Server =

Parametrizing geometry sql command c# in ASP.NET, not working

蓝咒 提交于 2021-01-28 14:58:24
问题 I have used this string and tested it with string concatenation.But as you know it is not safe to use this to format an sql command. SqlCommand param = new SqlCommand(); param.CommandText = "INSERT INTO Circle (Center_Point, Circle_Data) VALUES (geometry::STGeomFromText('POINT(@center_lat @center_lng)',0),geometry::STGeomFromText('POLYGON((@polygon))',0));"; param.Parameters.Add(new SqlParameter("@center_lat", center_lat)); param.Parameters.Add(new SqlParameter("@center_lng", center_lng));

Parametrizing geometry sql command c# in ASP.NET, not working

本秂侑毒 提交于 2021-01-28 14:55:59
问题 I have used this string and tested it with string concatenation.But as you know it is not safe to use this to format an sql command. SqlCommand param = new SqlCommand(); param.CommandText = "INSERT INTO Circle (Center_Point, Circle_Data) VALUES (geometry::STGeomFromText('POINT(@center_lat @center_lng)',0),geometry::STGeomFromText('POLYGON((@polygon))',0));"; param.Parameters.Add(new SqlParameter("@center_lat", center_lat)); param.Parameters.Add(new SqlParameter("@center_lng", center_lng));

What is a good data structure for storing and searching 2d spatial coordinates in Java

随声附和 提交于 2021-01-20 19:26:14
问题 I am currently writing a plugin for a game where one feature includes the ability to set areas defined by 2 two dimensional coordinates ( The upper left and lower right areas of a rectangle). These regions are then to be stored, and will have various other data associated with each region. As the player is moving about the world, I need to determine when he enters one of these regions from only the coordinates of the player, and the method of doing so must be efficient, as this will end up

What is a good data structure for storing and searching 2d spatial coordinates in Java

这一生的挚爱 提交于 2021-01-20 19:19:45
问题 I am currently writing a plugin for a game where one feature includes the ability to set areas defined by 2 two dimensional coordinates ( The upper left and lower right areas of a rectangle). These regions are then to be stored, and will have various other data associated with each region. As the player is moving about the world, I need to determine when he enters one of these regions from only the coordinates of the player, and the method of doing so must be efficient, as this will end up

What is a good data structure for storing and searching 2d spatial coordinates in Java

感情迁移 提交于 2021-01-20 19:17:28
问题 I am currently writing a plugin for a game where one feature includes the ability to set areas defined by 2 two dimensional coordinates ( The upper left and lower right areas of a rectangle). These regions are then to be stored, and will have various other data associated with each region. As the player is moving about the world, I need to determine when he enters one of these regions from only the coordinates of the player, and the method of doing so must be efficient, as this will end up

Spatial Datatype (geometry) to GeoJSON

蹲街弑〆低调 提交于 2020-12-29 04:12:17
问题 I want to convert geom ( geometry ) datatype to GeoJSON. How could I do that? For example, the geometry in WKT: POLYGON((455216.346127297 4288433.28426224,455203.386722146 4288427.76317716,455207.791765017 4288417.51116228,455220.784166744 4288423.30230044,455216.346127297 4288433.28426224)) To the following GeoJSON: { "type": "Polygon", "coordinates": [ [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ], [ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2,

Spatial Datatype (geometry) to GeoJSON

筅森魡賤 提交于 2020-12-29 04:11:48
问题 I want to convert geom ( geometry ) datatype to GeoJSON. How could I do that? For example, the geometry in WKT: POLYGON((455216.346127297 4288433.28426224,455203.386722146 4288427.76317716,455207.791765017 4288417.51116228,455220.784166744 4288423.30230044,455216.346127297 4288433.28426224)) To the following GeoJSON: { "type": "Polygon", "coordinates": [ [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ], [ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2,

Spatial Datatype (geometry) to GeoJSON

只愿长相守 提交于 2020-12-29 04:11:39
问题 I want to convert geom ( geometry ) datatype to GeoJSON. How could I do that? For example, the geometry in WKT: POLYGON((455216.346127297 4288433.28426224,455203.386722146 4288427.76317716,455207.791765017 4288417.51116228,455220.784166744 4288423.30230044,455216.346127297 4288433.28426224)) To the following GeoJSON: { "type": "Polygon", "coordinates": [ [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ], [ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2,

Fetching Multipoint Spatial Data in MySQL

有些话、适合烂在心里 提交于 2020-01-16 10:57:53
问题 I didn't find any answer how to select every point in multipoint data type in MySQL. I have multipoint that contains many points and I want to select every point by query and I can't figure it out. Any ideas? Table structure: Image Example data: Image In MySQL documentation I've found only this, but it didn't help: https://dev.mysql.com/doc/refman/8.0/en/fetching-spatial-data.html 回答1: If you are using MySQL >= 8.0.2, an option may be: DELIMITER // CREATE PROCEDURE `sp_test`(`p_id` BIGINT