Skip to main content

Questions tagged [sqlalchemy]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
17 views

Cannot load a geodataframe (from a shapefile) into PostgreSQL (as table) via SQLAlchemy

I would like to publish a shapefile from a directory to GeoServer by using the Python library geoserver-rest. I understand that in order to do so, I need also to load the shapefile as geodataframe (...
Tms91's user avatar
  • 185
0 votes
1 answer
44 views

How to install GeoAlchemy2 on qgis 3.28.15 and use its libraries on qgis console?

I have installed GeoAlchemy2 and SqlAlchemy by using the osgeo command, but I am still not able to import the related libraries on the qgis console. from geoalchemy2 import *
Nihar Sahoo's user avatar
3 votes
1 answer
285 views

From Geodataframe to PostGIS

I have a geodataframe which I am trying to save to a postgis database. I have already created a connection to postgis in pgAdmin (username, password, localhost and table) from geoalchemy2 import ...
bravopapa's user avatar
  • 485
1 vote
1 answer
379 views

Geodataframe.to_postgis() with Flask and tracking SQLAlchemy Models

I have the following situation: My application front end will receive a shapefile input and have to save it to a PostGIS database. After that, the application backend will start a series of tasks that ...
Pedro Cury's user avatar
3 votes
1 answer
50 views

How to map a single PostGIS function to multiple Spatialite functions with GeoAlchemy2

In PostGIS we have ST_Affine(geom, a, b, d, e, xoff, yoff) but in Spatialite this functionality is split across 2 functions: ATM_Transform( geom , affine_matrix ), and ATM_Create(a, b, d, e, xoff, ...
iwishiwasaneagle's user avatar
1 vote
1 answer
493 views

Calculating the distance For each Row with respect to a Common Point

I have two models with no relation Port and a WareHouse each with a lat and long fields. I want to be able to get the distance for each warehouse from the Port and maybe get the closest e.t.c. This is ...
StackEdd's user avatar
  • 113
4 votes
3 answers
167 views

Points which are beyond certain distance from multiple points

I have two tables - first is a list of positions (points) and second is a list of cities (cities). I am using PostGIS and can find all points outside 10nm of New York by using the SQL statement - ...
user3367601's user avatar
0 votes
1 answer
259 views

Inserting GeoDataFrame into existing schema

Is there a straightforward way to insert a GeoDataFrame into an existing schema? I love the geopandas.GeoDataFrame.to_postgis but this creates a new schema. I only need to insert a table into an ...
user18140022's user avatar
1 vote
2 answers
2k views

Setting CRS/SRID using the to_postgis function with GeoPandas?

So, I'm trying to update a PostGIS table after doing some reverse geocoding and other column manipulation I'm running into the find_srid() - could not find the corresponding SRID error. Based on my ...
nizz0k's user avatar
  • 324
7 votes
1 answer
527 views

Uploading a geodataframe with some missing geometries using 'to_postgis'

I have a GeoDataFrame with plenty of info, including a 'geometry' column. Some of the rows have no geometry data... I simply don't have it. I decided to leave those rows as 'None' or 'NoneType' in the ...
Frank Jimenez's user avatar
1 vote
0 answers
3k views

Calculating distance between 2 Shapely Points in Meters

I am trying to calculate the distance (in meters) between 2 lon/lng points of type shapely.geometry.point.Point using Python and Shapely. These 2 points are returned from PostGIS by SQLAlchemy/...
Nyxynyx's user avatar
  • 1,687
2 votes
1 answer
1k views

Change PostGIS Column from Geometry to Geography

I have a PostGIS table with a column of type Geometry(POINT) and SRID 0 that must be changed to the type Geography(POINT) as it will be used to store lat/lon values. How can we make this alteration to ...
Nyxynyx's user avatar
  • 1,687
3 votes
1 answer
657 views

geopandas to_postgis: ValueError: geom (geometry(MULTILINESTRING,4326)) not a string

I have a GeoPandas GeoDataFrame with a column named geom having MultiLineString values as such: print(gdf.to_markdown()) # using package 'tabulate' to display a markdown table | | uid | key | ...
swiss_knight's user avatar
  • 10.4k