Skip to main content

Questions tagged [st]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
2 answers
24 views

How to use ogr2ogr -clipdstsql?

This works (A), $ ogrinfo -dialect SQLITE -sql "SELECT ST_Buffer(ST_GeomFromText('POLYGON ((120.81313 24.18337 ... Layer name: SELECT OGRFeature(SELECT):0 POLYGON ((120.702569638856 24....
Dan Jacobson's user avatar
0 votes
1 answer
47 views

St_nearest_point

I have two dataframe with coordination values, I want to match each point of my dataset2 with the nearest point in my dataset1, then use its value. I tried transfered them into sf object then using ...
user24010620's user avatar
2 votes
0 answers
158 views

ST_Transform returning different results in PostGIS 2.4 and PostGIS 3.0

I am facing a problem with the function st_transform()and here is my analysis of this pb: Example of SQL query with different results depending on PostGIS version: select st_astext(st_transform(...
moobster's user avatar
1 vote
1 answer
515 views

Error in valid.viewpor: invalid 'yscale' in viewport

I have one month of data that I converted to STDFDF. #set the spatial location of the regions Data.loc <- data.frame(Stat = c("Firmo","Citta dei Ragazzi", "Rende", ...
Elena Iakimova's user avatar
1 vote
1 answer
432 views

Write shapefile from list in R

I have imported a shapefile in R using myshape<-st_read("myshapefile.shp") This generated a list with 2 variables by n observations: DN and geometry. I've then performed some zonal ...
Mutewinter's user avatar
1 vote
0 answers
165 views

Color a tile while creating in PostGIS

I am trying to create a tile using PostGIS. Although I am able to create a tile but facing difficulty when coloring it. I want to color the tile means I want to color the geometry with different ...
data en's user avatar
  • 145
1 vote
1 answer
406 views

Is there anything making PostGIS ST_INTERSECTION faster(or something wrong with my approach)?

Basically I have 2 tables: The first is lucc gometry(about 10'000'000 rows called lucc_indicies) The other is fishnet grid (10'000'000 rows called cells_gba_100m) I want to statis lucc geometry ...
yougao's user avatar
  • 45
2 votes
1 answer
98 views

Postgis dissolve boundaries and calculate mean values

I like to combine two layers and calculate/summarize data from one to another. So, I have values for the subtypes (yellow lines) and the area of the subtypes. Now I like to calculate a mean value for ...
oppia04's user avatar
  • 735
0 votes
0 answers
166 views

st_transform does not work

I am trying to transform a geometry from srid 4326 to 26915. SELECT ST_Transform(s.geompos, 26915) FROM sites s But i got error : ERROR: could not form projection (LWPROJ) from 'srid=4326' to 'srid=...
عبد القادر كعوان's user avatar
1 vote
1 answer
280 views

R Distance from Point to Line: Negative if within shape

I'm working with Brazilian deforestation data - specifically two sf objects: A point shapefile on environmental fines (centroid of land plots that have been fined for deforestation). A polygon of (...
cstock's user avatar
  • 29
1 vote
0 answers
66 views

How to assign point feature values to line features?

I have two datasets, one being a point feature dataset and the other being a line feature dataset. Each point feature contains a traffic count value that I want to assign to the corresponding line ...
Foeke Boersma's user avatar
1 vote
2 answers
132 views

Undesirable behavior of PostGIS function st_isvalid

I deal with forest inventory geodatabase that contains a lot of polygons. Those polygons come from some software that allows topologically incorrect data. So I should check the polygons. Performing ...
Vadym's user avatar
  • 811
2 votes
1 answer
52 views

St_intersection doesn't give the correct response

I have two LineString and I want take their intersection. I don't understand why PostGIS doesn't give me the correct answer. select ST_Intersection(st_geomfromtext('LINESTRING(2.9363672 36.769075,2....
عبد القادر كعوان's user avatar
0 votes
1 answer
1k views

st_rasterize (template smaller than sf object)

I need to rasterize an sf object that at the end must have the same cell size and be on the same grid of a defined raster object "template", because, eventually, I want to merge them. The ...
user36756's user avatar
2 votes
1 answer
1k views

Combining a feature collection of MULTILINESTRINGs into one closed polygon in R

I have a shapefile consisting of 262 rows of MULTILINESTRINGs. Combined this shapefile (the political boundary of the arctic region) wraps the world and I would like to check for a large set of ...
L Smeets's user avatar
  • 167
3 votes
1 answer
2k views

st_write fails for object created with st_difference using R?

Using publicly available sea area shapefiles bahamas: http://www.marineregions.org/gazetteer.php?p=details&id=8404 ("eez.zip") watl: http://www.marineregions.org/gazetteer.php?p=details&id=...
dez93_2000's user avatar
  • 1,079
3 votes
2 answers
2k views

PostGIS ST_Split is not working

I want to split/cut polygon into 2 polygons by line.I am using PostGIS ST_Split functionality.Below is code tried so far with reference,passing two edge point coordinates creating line, by that line ...
Veena Hosur's user avatar
5 votes
2 answers
24k views

How to use st_buffer?

I would like to calculate a buffer of 5km around country polygons. However, I somehow always get a warning and an error. Here is a reproducible example code. library(sp) library(sf) library(tmap) ...
S Front's user avatar
  • 349
0 votes
2 answers
4k views

Problem with the ST_Area in PostGIS [duplicate]

I have a question with a query in PostGIS. I try to calculate the area from a polygon. It actually works but the area-result is not correct. My Query is: SELECT name, ST_Area(way)/10000 AS hectares ...
Ayron's user avatar
  • 43
3 votes
1 answer
3k views

How is ST_Azimuth (in PostGIS) calculated?

What algorithms are internally calculated in PostGIS? Can you explain it with simple code? (I want to know the standard of true north.)
myskbj's user avatar
  • 91
1 vote
1 answer
190 views

sfcgal ST_Volume Issue

ST_Volume works with shape data pasted into the query in this form: SELECT (abs(ST_Volume(design)) - abs(ST_Volume(ST_3DIntersection(design,scan)))) FROM (SELECT (ST_MakeSolid('...
craigL's user avatar
  • 121
2 votes
0 answers
178 views

Odd output for PostGIS st_snap

I'm trying to snap a line theme to a point theme using PostGIS with a filter so they only snap to records with the same reference number. The query I'm using is as follows (this is a sample of the ...
Ian's user avatar
  • 41
1 vote
1 answer
2k views

ST_AsRaster for polygon

Having a hard time to get a raster from a polygon ST_AsRaster(ST_Buffer(ST_GeomFromText('POLYGON((-30 40, -20 30, -25 20, -23 10, -30 40))', 4326), 50),ARRAY['8BUI'],ARRAY[118]); This line is giving ...
moffittime's user avatar
2 votes
1 answer
1k views

ST_Transform error

I am getting an error from ST_Tranform while using ST_Intersection: No function matches the given name and argument types. You might need to add explicit type casts. select ST_Intersection(...
moffittime's user avatar
1 vote
1 answer
1k views

Finding all polygons inside of a polygon

How to find all the polygons inside of a polygon? I tried ST_Intersects and ST_Contains but they are booleans variables. I have a list of polygons in WKT format, so I am trying to pull all the ...
moffittime's user avatar
4 votes
1 answer
69 views

Are ESRI spatial views regenerated whenever they are queried?

If a spatial view contains data "joined" from multiple tables, will all the tables be queried whenever a query is executed against the spatial view? We have some spatial views and whenever we run a ...
DenaliHardtail's user avatar
1 vote
2 answers
408 views

Updating table setting a CASE with ST_Intersection

I add a new geometry column to the "mad" table so I could update it with the polygons from an Intersection with the polygons of the table "clip". Since my database is huge an it was taking a lot of ...
Alejandra's user avatar