PostGIS

GeoServer won't write to my PostgreSQL updateable view

我们两清 提交于 2019-12-19 10:35:32
问题 Following on from this earlier question I'm on PostgreSQL 8.4 and am having trouble with updatable views. I have a view: CREATE VIEW filedata_view AS SELECT num, id, ST_TRANSFORM(the_geom,900913) AS the_geom FROM filedata And want to update it from my application throw Geoserver. But get a error: <ServiceExceptionReport version="1.2.0" xmlns="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/ogc http://schemas.opengis

Reuse computed select value

混江龙づ霸主 提交于 2019-12-19 08:54:34
问题 I'm trying to use ST_SnapToGrid and then GROUP BY the grid cells (x, y). Here is what I did first: SELECT COUNT(*) AS n, ST_X(ST_SnapToGrid(geom, 50)) AS x, ST_Y(ST_SnapToGrid(geom, 50)) AS y FROM points GROUP BY x, y I don't want to recompute ST_SnapToGrid for both x and y . So I changed it to use a sub-query: SELECT COUNT(*) AS n, ST_X(geom) AS x, ST_Y(geom) AS y FROM ( SELECT ST_SnapToGrid(geom, 50) AS geom FROM points ) AS tmp GROUP BY x, y But when I run EXPLAIN , both of these queries

Setting up Django with GeoDjango Support in AWS Beanstalk or EC2 Instance

自古美人都是妖i 提交于 2019-12-19 04:21:45
问题 So I have at one point had this going via Beanstalk, using Amazon Instance (2013.09) ami-35792c5c . At the time this ebextension scripts worked great when placed in the root of your repo in .ebextensions/ 00_repo.config packages: rpm: pgdg-redhat93-9.3-1: 'http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-redhat93-9.3-1.noarch.rpm' remi: 'http://rpms.famillecollet.com/enterprise/remi-release-6.rpm' files: "/etc/yum.repos.d/pgdg-93-redhat.repo": mode: "000644" owner: root group: root

Openlayers-3 WFS-T (Post feature to postgis via geoserver)

﹥>﹥吖頭↗ 提交于 2019-12-18 17:11:53
问题 I have a problem with posting features from ol3 into postgis db via geoservers wfs.When i run this code, i only manage to insert gid(pk) and bin columns but the_geom(Geometry) column is empty. function addInteraction() { draw = new ol.interaction.Draw({ features: featureOverlay.getFeatures(), type: /** @type {ol.geom.GeometryType} */ (typeSelect.value) }); draw.on('drawend', function(evt) { var feature = evt.feature; feature.set('bin', 0); var fid = feature.getId(); var node = format

Openlayers-3 WFS-T (Post feature to postgis via geoserver)

﹥>﹥吖頭↗ 提交于 2019-12-18 17:11:16
问题 I have a problem with posting features from ol3 into postgis db via geoservers wfs.When i run this code, i only manage to insert gid(pk) and bin columns but the_geom(Geometry) column is empty. function addInteraction() { draw = new ol.interaction.Draw({ features: featureOverlay.getFeatures(), type: /** @type {ol.geom.GeometryType} */ (typeSelect.value) }); draw.on('drawend', function(evt) { var feature = evt.feature; feature.set('bin', 0); var fid = feature.getId(); var node = format

How to calculate 3D distance (including altitude) between two points in GeoDjango

倖福魔咒の 提交于 2019-12-18 17:00:07
问题 Prologue: This is a question arising often in SO: 3d distance calculations with GeoDjango Calculating distance between two points using latitude longitude and altitude (elevation) Distance between two 3D point in geodjango (postgis) I wanted to compose an example on SO Documentation but the geodjango chapter never took off and since the Documentation got shut down on August 8, 2017, I will follow the suggestion of this widely upvoted and discussed meta answer and write my example as a self

PostgreSQL latitude longitude query

女生的网名这么多〃 提交于 2019-12-18 10:34:11
问题 i have latitude and longitude columns in location table in PostgreSQL database, and I am trying to execute distance query with a PostgreSQL function. I read this chapter of the manual: https://www.postgresql.org/docs/current/static/earthdistance.html but I think I'm missing something there. How should I do that? Are there more examples available 回答1: This module is optional and is not installed in the default PostgreSQL instalatlion. You must install it from the contrib directory. You can use

postgresql – osm2pgsql:函数AddGeometryColumn不存在

北城以北 提交于 2019-12-18 03:12:48
我想使用工具 Osm2pgsql 将 OSM file 导入PostgreSQL数据库(Windows,Postgres版本9.2). 当我运行以下命令 osm2pgsql.exe --create -d mydb artyom.xml -U myuser -W --style default.style 我得到错误 SELECT AddGeometryColumn('planet_osm_point', 'way', 900913, 'POINT', 2 ); failed: FEHLER: Funktion addgeometrycolumn(unknown, unknown, integer, unknown, integer) existiert nicht LINE 1: SELECT AddGeometryColumn('planet_osm_point', 'way', 900913, ... ^ HINT: Keine Funktion stimmt mit dem angegebenen Namen und den Argumenttypen ├╝b erein. Sie m├╝ssen m├Âglicherweise ausdr├╝ckliche Typumwandlungen hinzuf├╝gen. Error occurred, cleaning up

Can I ask Postgresql to ignore errors within a transaction

拈花ヽ惹草 提交于 2019-12-17 19:58:28
问题 I use Postgresql with the PostGIS extensions for ad-hoc spatial analysis. I generally construct and issue SQL queries by hand from within psql. I always wrap an analysis session within a transaction, so if I issue a destructive query I can roll it back. However, when I issue a query that contains an error, it cancels the transaction. Any further queries elicit the following warning: ERROR: current transaction is aborted, commands ignored until end of transaction block Is there a way I can

GeoDjango on Windows: “Could not find the GDAL library” / “OSError: [WinError 126] The specified module could not be found”

为君一笑 提交于 2019-12-17 06:11:18
问题 I've been trying to setup my windows computer such that I can have a local postgreSQL with PostGIS extension. With this installed I hope to be able to create a project with geodjango locally before putting it in the cloud. I have been working with Django for a little while now on my local machine with the SQLite DB, but since the next project will partly be based on coordinate based data I wanted to setup the right environment. Import note: I've installed mini-conda to run in a seperate