PostGIS

How to intelligently degrade or smooth GIS data (simplifying polygons)?

爱⌒轻易说出口 提交于 2019-12-28 07:40:03
问题 I have detailed US county maps, from the TIGER LINE data sets. How might I sample, smooth, or degrade the data so that I get straighter, more boxy, less "noisy" shapes to represent the geographical features -- in this case just county boundaries and state lines, but maybe also in the general case? The sampling could happen at rendering time if that can be done efficiently, or a parallel data set could be generated and stored. I am using PostGIS, and the lines are multi-polylines generated by

Postgis - migration from 1.5 to 2.3 - workaround

此生再无相见时 提交于 2019-12-25 04:07:15
问题 Fellows, I already had a really hard time trying to make a migration from a postgis 1.5 to 2.3. Actually I had many attempts to do that with all version of postgis: 2.0, 2.1, 2.2 and now 2.3. As I have spent a few weeks with that, and as I am ready to drop that I keep using my old version of postgresql and postgis, I hope my question finds a echo somewhere... I only want to migrate one table field, a geometry field. So before trying to do that, I would like to hear if any of you have

Parse error in PostgreSQL parametrised query from C# but works in pgAdmin III

 ̄綄美尐妖づ 提交于 2019-12-25 04:04:10
问题 I am trying to execute a parametrised query from C# and I get the error: ERROR: XX000: parse error - invalid geometry with the hint "POLYGON((:m" <-- parse error at position 11 within geometry But when I run the query in pgAdmin III replacing the parameters with their values the query works. The code is command.CommandText = "SELECT area_code FROM area WHERE ST_INTERSECTS(ST_GeographyFromText('POLYGON((:minx :miny, :minx :maxy, :maxx :maxy, :maxx :miny, :minx :miny))'), shape) AND area_type

Update PostGIS extensions on Heroku

拜拜、爱过 提交于 2019-12-25 02:54:15
问题 Everything worked fine, but some time ago rails app response a error. PG::UndefinedFile: ERROR: could not access file “$libdir/postgis-2.1": No such file or directory Also now I can't create database backup, it's crashed on table which working whit postgis. Backup will creating if exclude this table. pg:psql -c "\dx postgis" postgis 2.1.7 I tried to find a solution to this problem and what I found was: ALTER EXTENSION postgis UPDATE; ALTER EXTENSION postgis_sfcgal UPDATE; ALTER EXTENSION

Connect postgreSQL+postGIS docker container from my local network

情到浓时终转凉″ 提交于 2019-12-25 00:45:09
问题 I have built a docker container from docker hub with : docker run --name some-postgis -e POSTGRES_PASSWORD=mysecretpassword -d mdillon/postgis docker run -it --link some-postgis:postgres --rm postgres \ sh -c 'exec psql -h "$POSTGRES_PORT_5432_TCP_ADDR" -p "$POSTGRES_PORT_5432_TCP_PORT" -U postgres' An inspect : $ docker inspect b89c7f54e76a [ { "Id": "b89c7f54e76aa82bd142e1eb45a1f12008bf2ee2f94e392b08b386493b58891f", "Created": "2017-08-08T14:34:02.375576229Z", "Path": "docker-entrypoint.sh"

Psycopg ppygis select query

拥有回忆 提交于 2019-12-24 22:30:31
问题 I'm trying to setup a basic working postgis setup with python ppygis package. >>> import psycopg2 >>> import ppygis >>> connection = psycopg2.connect(database='spre', user='postgres') >>> cursor = connection.cursor() >>> cursor.execute('CREATE TABLE test (geometry GEOMETRY)') >>> cursor.execute('INSERT INTO test VALUES(%s)', (ppygis.Point(1.0, 2.0),)) >>> cursor.execute('SELECT * from test') >>> point = cursor.fetchone()[0] >>> print point 0101000000000000000000F03F0000000000000040 >>> I

How to map PostGis geometry column as wkt with nHibernate not using nHibernate spatial

杀马特。学长 韩版系。学妹 提交于 2019-12-24 22:04:04
问题 I need to read a postgis geometry column as wkt using nHibernate. I know I could use nHibernate Spatial, but that is not an option in my case. I have seen this post: Best way to map a hidden property in NHibernate (fluent) where the wkt is stored in another column and he uses triggers to update the actual geometry. However the project owners do not want to have an extra column for this purpose. I found this thread as well: Use PostGIS columns transparently in Hibernate, but no has provided an

Why does PostgreSQL combine series in a wrong way?

别等时光非礼了梦想. 提交于 2019-12-24 15:33:25
问题 I got some strange behavior of combined generate_series. In 2 different polygons that I tried to fill with a grid, one grid was much rarer: The query was like this: SELECT osm_id , generate_series(floor(st_xmin(way))::int, ceiling(st_xmax(way))::int, 150) x, generate_series(floor(st_ymin(way))::int, ceiling(st_ymax(way))::int, 150) y from osm_polygon order by osm_id, x, y; I tried tracing the problem, and just entered min/max coordinates. Generate series from min/max values create correct

Is there any way to run Flyway task excluding some tables?

∥☆過路亽.° 提交于 2019-12-24 15:06:59
问题 I'm currently using Flyway to manage migrations on an application which uses Postgis (PostgreSQL geospatial extension). This plugin uses a table called spatial_ref_sys which is located in the same schema the application uses too, when I call mvn flyway:clean I'm getting an error indicating that Flyway was unable to delete this table (it was created using user postgres); if I change the owner to my application database user, then the error changes to: ERROR: cannot drop table spatial_ref_sys