Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an Julia function to transform coordinate reference system (e. g. st_transform in R)?

I have an .shp file with ETRS89 / Poland CS92 coordinates and I want to transform it to WGS84[long/lat].
Example of transformation for a point:

ETRS89 / Poland CS92: (184074.7, 682954.7) --> WGS84: (14.18703, 53.91454)

In R it could be done using st_transform function from sf library:

st_transform(polska_grid, "+proj=longlat +ellps=WGS84+datum=WGS84")

Is there function like st_transform in Julia?

Thank you in advance!

like image 513
NykPol Avatar asked Nov 21 '25 06:11

NykPol


1 Answers

There is the reproject function from ArchGDAL that gets further extended by GeoDataFrames. That will offer a similar transform to sf, like so:

import GeoDataFrames as GDF
import GeoFormatTypes as GFT

df = GDF.read("path/to/a.shp")
df.geometry = GDF.reproject(df.geometry, GFT.EPSG(2180), GFT.EPSG(4326))

This example uses GeoDataFrames.jl v0.3.

Relevant documentation is here:

  • https://www.evetion.nl/GeoDataFrames.jl/dev/tutorials/ops/#Reprojection
  • https://yeesian.com/ArchGDAL.jl/dev/projections/
like image 169
visr Avatar answered Nov 23 '25 19:11

visr



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!