PostGIS

Calculating distance between a gps location and postgis geography value using a function?

烈酒焚心 提交于 2021-02-19 07:44:08
问题 I have lat and long values for a user. I have addresses of various locations saved in db. I want to find the nearest offers based on a radius value. I am using postgis. Currently my location column is of type geography. What is the format in which I should enter the data into "location" column geography type when I have only latitude and longitude? I cannot use postgis functions since I am using graphql to do data insert. I have been tearing my hair apart trying to write a function for this

How to enable Postgis Query in Spark SQL

浪尽此生 提交于 2021-02-18 19:09:58
问题 I have a PostgreSQL database with Postgis extension, so I can do queries like: SELECT * FROM poi_table WHERE (ST_DistanceSphere(the_geom, ST_GeomFromText('POINT(121.37796 31.208297)', 4326)) < 6000) And with Spark SQL, I can query the table in my Spark Application (in Scala) like: spark.sql("select the_geom from poi_table where the_geom is not null").show The problem is, Spark SQL doesn't support Postgis extension. For example, when I query the table using Postgis function ST_DistanceSphere ,

【笔记】.NET开发环境下使用PostgreSQL+Oracle_fdw 实现两个数据库之间数据交互操作(一)

会有一股神秘感。 提交于 2021-02-18 15:26:55
一 前言 以往公司开发的地理信息系统数据都是存储在oracle中,然而在地图数据的分析和计算中一直存在不小的问题,所以今次我们尝试使用PostgreSQL+PostGIS来解决这一问题。 本篇笔记的目的就是记录在研究这一开发路径期间的“学习的内容”、“遇到的问题和解决过程”以及“简单的实践内容”以备忘。 笔记中可能会出现部分术语概念不准确,还请您能耐心指正或者忽略,反正这是为了我自己能看懂的笔记,你爱看不看。 二 安装 1.环境 Windows7 64位操作系统(公司工作的台式机,探索阶段暂时使用,以后可能会转到Windows系统的服务器上去)。 已安装了Oracle 11g客户端,这里将不在介绍oracle的安装。 2.步骤 基本还是准寻下一步原则,第二步注意一下语言的选择。 SQL安装完毕后自动弹出Stack Builder引导安装PostGIS等其他扩展。 我这里只选择了自己需要的 PostGIS 版本进行了安装。 详细可以参考同事整理的安装文档: https://www.jianshu.com/p/3b1a4cd8e72e 三 遇到的第一个问题 前一天用着好好的数据库,第二天服务就死活链接不上了,而且在pgAdime里没有报任何错误,就很奇怪。 在尝试了修改配置文件、分析服务管理器启动产生的日志等最终还是没有奏效,索性 卸载干净重新安装 ,居然就好了。。。

《ODF走进名企之滴滴站:开源数据库最新发展技术之涓滴成河》邀您一起参加~~~

六眼飞鱼酱① 提交于 2021-02-16 13:10:31
滴滴作为一家科技驱动的创新企业,致力于回馈开发者社区、打造开源生态,建立企业创新品牌和技术领导力。目前,滴滴在开源项目上做了很多方面的探索和实践,积极参与业界的开源项目,不断对外输出内部的优秀项目。 《ODF走进名企之滴滴站:开源数据库最新发展技术之涓滴成河》邀您一起参加~~~ 滴滴开源的愿景 拥抱开放 - 通过主动开源,加速开放创新,构建开放生态圈。 创造价值 - 促进各领域的合作和技术发展,构建更多可扩展的产品。 合作共赢 - 共享技术,合作开发,将更好的技术带给世界,共同促进数字世界、智能世界的加速发展。 活动时间 2018年8月4日(周六) 14:00 - 18:00 活动地点 尚东数字山谷B区2号楼4层英菲尼迪会议室 日程安排 Time Table 13:30-13:55 活动签到 13:55-14:00 嘉宾致辞&主办方致辞 14:00-14:45 齐楠 《Redis多机房支持》 14:45-15:30 杜修文 《 MySQL InnoDB Cluster详解》 15:30-16:15 赵平 《流式处理实践之路》 16:15-16:30 茶歇 16:30-17:15 冯若航 《PostGIS在探探中的应用》 17:15-18:00 张冬洪 《Pedis 5.0 新特性解读 》 嘉宾议程 齐楠 | 滴滴基础架构部门高级专家工程师 现任滴滴基础架构部,负责队列,接入层

what have I done wrong when implementing Leaflet draw. How to use WFST in this specific example?

雨燕双飞 提交于 2021-02-10 19:58:06
问题 I am new to this domain of GeoInformation development. I am following the below pipeline architecture flow to achieve a GIS-based application problem. PostGIS - GeoServer - Leaflet I have set up my leaflet client application which composes tiles to a map. I am also using some leaflet plugins (like Draw, zoom) in order to give users the option to mark and to draw on the map. I am able to draw and get the GeoJSON features of the drawn polygon as shown below: I am stuck after this part of

what have I done wrong when implementing Leaflet draw. How to use WFST in this specific example?

不打扰是莪最后的温柔 提交于 2021-02-10 19:57:30
问题 I am new to this domain of GeoInformation development. I am following the below pipeline architecture flow to achieve a GIS-based application problem. PostGIS - GeoServer - Leaflet I have set up my leaflet client application which composes tiles to a map. I am also using some leaflet plugins (like Draw, zoom) in order to give users the option to mark and to draw on the map. I am able to draw and get the GeoJSON features of the drawn polygon as shown below: I am stuck after this part of

Error creating a spatial database using EXTENSIONS

主宰稳场 提交于 2021-02-10 09:42:52
问题 When running psql -d mydb -c "CREATE EXTENSION postgis;" I get the following error: ERROR: could not load library "/usr/local/Cellar/postgresql/9.3.4/lib/rtpostgis-2.1.so": dlopen(/usr/local/Cellar/postgresql/9.3.4/lib/rtpostgis-2.1.so, 10): Symbol not found: _sqlite3_column_table_name Referenced from: /usr/local/lib/libgdal.1.dylib Expected in: /usr/lib/libsqlite3.dylib in /usr/local/lib/libgdal.1.dylib STATEMENT: CREATE EXTENSION postgis; System: OS X 10.9.2 All libraries were installed

Error creating a spatial database using EXTENSIONS

时光总嘲笑我的痴心妄想 提交于 2021-02-10 09:42:27
问题 When running psql -d mydb -c "CREATE EXTENSION postgis;" I get the following error: ERROR: could not load library "/usr/local/Cellar/postgresql/9.3.4/lib/rtpostgis-2.1.so": dlopen(/usr/local/Cellar/postgresql/9.3.4/lib/rtpostgis-2.1.so, 10): Symbol not found: _sqlite3_column_table_name Referenced from: /usr/local/lib/libgdal.1.dylib Expected in: /usr/lib/libsqlite3.dylib in /usr/local/lib/libgdal.1.dylib STATEMENT: CREATE EXTENSION postgis; System: OS X 10.9.2 All libraries were installed

How to insert geojson data to geometry field in postgresql

点点圈 提交于 2021-02-08 10:01:54
问题 I want to insert geoJSON to a geometry column of a table. I have already inserted CSV file to the same column following this tutorial, I wonder how to insert the geoJSON to any geometry column? I tried following this answer but could not get what is going on there. 回答1: Just use an update with the function ST_GeomFromGeoJSON: UPDATE mytable SET geom = ST_GeomFromGeoJSON(json_column); The following example inserts a GeoJSON point into a JSON column and afterwards updates the geometry column

Cannot set MODEL_NAME SpatialProxy (POLYGON) with value of type: <class 'django.contrib.gis.geos.polygon.Polygon'>

流过昼夜 提交于 2021-02-08 08:15:17
问题 When I try an API call to the url of one my models I face the following: Cannot set Allotment SpatialProxy (POLYGON) with value of type: <class 'django.contrib.gis.geos.polygon.Polygon'> I check my model's definition and data type in PGadmin. full log Traceback: File "/home/user/MyProjects/forest-venv/lib/python3.5/site-packages/django/core/handlers/exception.py" in inner 35. response = get_response(request) File "/home/user/MyProjects/forest-venv/lib/python3.5/site-packages/django/core