Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [geoalchemy]

GeoAlchemy provides extensions to SQLAlchemy to work with spatial databases.

0
votes
1answer
52 views

How to cast Geometry to Geography in PostGIS/Postgres with sqlalchemy + geoalchemy

Some PostGIS functions behave differently based on the arguments types. Example: ST_Distance will calculate projected units distances for geometry arguments and meters distances for geography ...
2
votes
1answer
139 views

GeoAlchemy get closest point to another point

I have loaded into my db the cities1000.txt available here. I am attempting to create a query using GeoAlchemy to return the nearest city when I pass in Lat and Long. I currently have the query setup ...
2
votes
2answers
533 views

Creating a geoTIFF from PostGIS raster column

I am able to retrieve raw raster data from a PostGIS raster in a PostgreSQL database using SQL Alchmey. I can get the raw data directly from the database. Now I would like to create a geoTIFF file ...
4
votes
1answer
2k views

Converting geoalchemy2.elements.WKBElement to WKT

I have a geoalchemy2.elements.WKBElement that comes from a query on a Postgres/PostGIS view. I want to convert this to WKT, or otherwise encode it so that it is (Geo)JSON serialisable. How can I ...
2
votes
1answer
131 views

Polygons generated using python-script appear stretched?

We are trying to generate a grid of hexagons that is supposed to span the whole of Germany. The code we are using to generate this grid is as follows (excluding some sqlalchemy related parts): from ...
1
vote
1answer
651 views

Write GeoJSON As Feature Object in Postgis

I'm trying to create a geofence/circle from a lat/long set and I'm close except that the GeoJSON that PostGIS creates differs in structure from the client library that our front-end uses. Here is my ...
1
vote
2answers
781 views

Casting between PostGIS types in GeoAlchemy

I'm working with OpenStreetMap data, and loading it into a PostGIS database using osm2pgsql. The issue that I am currently dealing with is that osm2pgsql stores the shape as a geometry type. I'm ...
0
votes
1answer
496 views

SQLAlchemy Error on insert

I am trying to add a point with GeoAlchemy 2. However I am getting getting error on insert action saying ---sqlalchemy.exc.InternalError: (psycopg2.InternalError) parse error - invalid geometry HINT:...
3
votes
0answers
354 views

How to add ST_GeomFromEWKT in mysql?

I am using geoalchemy2 with mysql database. I have a polygon field. While inserting I am getting this error - from appmain import application from flask_sqlalchemy import SQLAlchemy db = SQLAlchemy(...
0
votes
2answers
61 views

Shapely Not Determining Point in State

I am pulling State geometry data from a database (populated from Shapefiles) to find what state a coordinate pair is in. I was originally using GeoAlchemy, but tens of thousands of queries to ...
3
votes
0answers
213 views

How to use pythons' GeoAlchemy2 to filter on dynamically generated Points?

I'm trying to do something like this SQL query in Geoalchemy2: SELECT district_polygons.district FROM markers, district_polygons WHERE ST_Contains(district_polygons.multi_poly, Point(markers....
4
votes
0answers
390 views

Using ST_AsText() without session object

I am storing gps locations as feature in a restfull api. The locations are linked by foreign key to "place" objects in a flask/sqlalchemy/geoalchemy framework. I would like to print a user readable ...
0
votes
1answer
218 views

Creating Map from database

I'd like some general advice on creating dynamic maps. I have a bunch of geospatial points saved on SQL Server and PostgreSQL. People will enter new data into the databases from time to time. I want ...
1
vote
3answers
2k views

GeoAlchemy: AttributeError: type object 'ColumnProperty' has no attribute 'ColumnComparator'

I installed GeoAlchemy using easy_install but when trying to import it returns the following: Traceback (most recent call last): File "", line 1, in import geoalchemy File "C:\...
1
vote
1answer
439 views

Fastest way to add shapely geometries to a PostGis database using geoalchemy2

I am looking for the absolute fastest approach to adding +10,000 shapely geometry objects to a PostGIS database using geoalchemy2. I'm having no speed issues when uploading to a localhost postgres ...
0
votes
2answers
939 views

GeoAlchemy pg_function.geojson cannot be decoded with json.loads

I asked this quesiton over on StackOverflow and thought it might make more sense to post it here given it's GIS nature. Given this function: features being a list of SQLAlchemy objects template ...
12
votes
4answers
2k views

How to use PostGIS to handle complex geoprocessing workflows?

Our organization is considering moving our geoprocessing workflow to PostGIS. We are currently using ArcGIS, with a plethora of custom Python tools used in ModelBuilder. We're moving most of our data ...