Hot answers tagged

16 votes
Accepted

Convert GPS coordinates to Web Mercator EPSG:3857 using python/pyproj

from pyproj import Proj, transform print(transform(Proj(init='epsg:4326'), Proj(init='epsg:3857'), -0.1285907, 51.50809)) # longitude first, latitude second. # output (meters east of 0, meters north ...
sgillies's user avatar
  • 8,978
15 votes

Repairing broken GDAL and PROJ.4 on Ubuntu?

In https://gis.stackexchange.com/questions/158457/gdal2tiles-how-to-make-filenames-of-tiles-to-represent-xyz-coordinates, somebody mentions doing: sudo ln -s /usr/lib/libproj.so.0 /usr/lib/libproj.so ...
Akhorus's user avatar
  • 381
13 votes
Accepted

Transforming geostationary satellite image to lon/lat

Your attempt is designed to fail. If you look at the image, you see the data arranged as a circle, with black triangles in the corners of the square, where the satellite view goes right into orbit. In ...
AndreJ's user avatar
  • 76.3k
13 votes
Accepted

To project, or not to project? Extracting raster values with R

Reprojecting rasters is usually a bad thing to do. It involves a non-reversible transformation from one grid system to another grid system that can have a non-linear relationship to the first. Hence ...
Spacedman's user avatar
  • 61.5k
12 votes
Accepted

Repairing broken GDAL and PROJ.4 on Ubuntu?

After several wrong ways, including multiple reinstall of libproj0 package and even installing QGIS from sources different from the Ubuntu Software Center default (I think it's from the official QGIS ...
Pavel V.'s user avatar
  • 1,517
12 votes
Accepted

PROJ.4 How to create custom CRS to displace by x and y?

The EPSG:32719 is a UTM Zone 19 south setup with: $ grep -B1 '<32719>' /usr/share/proj/epsg # WGS 84 / UTM zone 19S <32719> +proj=utm +zone=19 +south +datum=WGS84 +units=m +no_defs <...
huckfinn's user avatar
  • 3,518
11 votes
Accepted

R-4.0.1 Not sure I understand this message: Warning message: In proj4string(x) : CRS object has comment, which is lost in output

This is not related to R 4.0.1 but to rgdal 1.5-8 and the migration to gdal 3 and proj 6. This is a very long and complex process that impact hundreds maybe thouthands of packages. All the packages ...
JRR's user avatar
  • 8,859
11 votes
Accepted

How should I handle CRS properly after the major change in PROJ library?

Please see: https://cran.r-project.org/web/packages/rgdal/vignettes/CRS_projections_transformations.html rather than the exploratory PROJ6_GDAL3 vignette, which described processes of seeing what ...
Roger Bivand's user avatar
9 votes

Repairing broken GDAL and PROJ.4 on Ubuntu?

Try: sudo apt-get install libproj-dev It solved the same error for me when using gdal_translate for extracting bands from an hdf image.
Sandino's user avatar
  • 91
9 votes

Adding Equal Earth Projection in QGIS?

This projection has been added to the 5.2.0. version of PROJ.4. If you go in QGIS to Help>>About, you'll see that it uses an earlier version of PROJ.4 If you want this projection now, you'll have to ...
Devdatta Tengshe's user avatar
9 votes
Accepted

Are proj4 strings case sensitive?

Yes, it's case sensitive. Each +parameter=value pair are normally case sensitive. For example with the parameter, there are two separate ellipsoid radius parameters R_A and R_a, which have different ...
Mike T's user avatar
  • 41.6k
9 votes
Accepted

GDAL Python - How I can determine the PROJ version used

This way: >>> from osgeo import osr >>> osr.GetPROJVersionMajor() 6 >>> osr.GetPROJVersionMinor() 2
user30184's user avatar
  • 61.9k
9 votes
Accepted

How to update CRS r object from PROJ4 to PROJ6

Your proj4 string lacks a +datum parameter, and PROJ is warning you. To remove the warning, add a +datum parameter with the correct datum that the data was defined as. This is likely to be WGS84 or ...
Spacedman's user avatar
  • 61.5k
8 votes

use proj4 to specify Robinson projection with R ggmap and ggplot2 packages?

You can now do this directly with the ggalt package: library(ggplot2) library(ggalt) library(ggthemes) wrld <- map_data("world") gg <- ggplot() gg <- gg + geom_map(data=wrld, map=wrld, ...
hrbrmstr's user avatar
  • 1,214
8 votes
Accepted

What's this PROJ4 string in WKT?

Technically, I think you have two questions. The first is just what's the WKT for this PROJ.4 string. The second is about how a CRS WKT is structured. An answer to the second question is probably too ...
mkennedy's user avatar
  • 18.7k
8 votes
Accepted

How to get map units to find current scale in OpenLayers?

The units are within the projection of the view. From a map object, you can get it using: var units = map.getView().getProjection().getUnits(); See also the API documentation of the ol.proj....
Alexandre Dubé's user avatar
8 votes
Accepted

Convert WKT coordinate reference system to PROJ4

Use the rgdal package and showP4: Your string: > ps [1] "COMPD_CS[\"Projected\", PROJCS[\"UTM_10N\", GEOGCS [ \"WGS84\", DATUM [ \"WGS84\", SPHEROID [\"WGS 84\", 6378137.000, 298.257223563 ], ...
Spacedman's user avatar
  • 61.5k
7 votes
Accepted

Which EPGS code is the actual CRS in this GeoPDF?

Your data seems to be in Haiti, using the North American Datum of 1927. QGIS and GDAL use the datum grid shift files for NAD27 for USA and Canada, but unfortunately your data is just outside the ...
AndreJ's user avatar
  • 76.3k
7 votes
Accepted

Adding Equal Earth Projection in QGIS?

In Twitter Tom Patterson posted this tweet and it works: The latest #QGIS 3.4.0 supports #EqualEarthProjection in two steps:(1) In Settings -> Custom Projections… create a custom definition with “+...
Dan's user avatar
  • 1,060
7 votes
Accepted

What is the history behind WKT and proj.4?

Wikipedia's proj.4 entry has some information. Gerald (Jerry) Evenden wrote the original proj software to convert coordinates with a command-line interface. It focused on map projections so you were ...
mkennedy's user avatar
  • 18.7k
7 votes

Build gdal with proj version 6

You are in the right track, but you need to inform gdal that you are using your own version of proj, rather than the one supplied with Ubuntu. Up until gdal v2.4.1, you would do that by providing the ...
thiagoveloso's user avatar
7 votes
Accepted

Explaining pyproj to_epsg min_confidence parameter?

This is a great question and I will do my best to answer. To begin, the init style syntax is deprecated (https://pyproj4.github.io/pyproj/stable/gotchas.html#init-auth-auth-code-should-be-replaced-...
snowman2's user avatar
  • 7,141
6 votes
Accepted

Gdal does not honor proj.4 scaling factor "+k_0"

The value for +k_0 should be around 1.0. See the table at Snyder, Map projections, page 110. You may find the source code for lcc at https://trac.osgeo.org/proj/browser/trunk/proj/src/PJ_lcc.c If you ...
AndreJ's user avatar
  • 76.3k
6 votes
Accepted

Ortelius and Nicolosi projection in QGIS

You are out of luck with your attempt, because there is no inverse projection defined in PROJ.4 for the two projections you want. QGIS depends on GDAL, and for any kind of reprojection the inverse ...
AndreJ's user avatar
  • 76.3k
6 votes

QGIS incorrectly saving polygon with custom CRS, while correctly projecting it on-the-fly

These 'artifacts' are a well known problem, and are usually the result of polygons crossing the antimeridian (180 degrees e/w) The go-to fix for this is usally ogr2ogr with the wrapdateline option. ...
Steven Kay's user avatar
  • 20.2k
6 votes

Finding correct extent of projection?

The primary source of these extents is the EPSG Geodetic Parameter Registry, e.g.: PROJ version 6+ If you have a newer version of PROJ (version 6 or later), use projinfo to extract a WKT2_2018 ...
Mike T's user avatar
  • 41.6k
6 votes
Accepted

Modifying center of equirectangular world map in QGIS?

A helpful page for customizing projections in QGIS is this one, explaining the parameters of Proj.4 projections. To get you started I would sugget the Michigan oblique Mercator projection; it should ...
Lisa's user avatar
  • 698
6 votes

How to know if a projection is correct?

the easy way to check if the projection used is correct is to add reference data from another projection and visually check for consistency. Based on the parameters of the projection, you can also ...
radouxju's user avatar
  • 49.3k
6 votes
Accepted

Different results from cs2cs and gdaltransform

See the difference: gdaltransform -s_srs epsg:4326 -t_srs epsg:3857 Enter X Y [Z [T]] values separated by space, and press Return. 53.70015N 9.12875E 5977873.35352241 1020534.697294 0 9.12875 53....
user30184's user avatar
  • 61.9k
6 votes
Accepted

Setting proj parameters of old map

The main problem is in the image warping parameters, they are not giving you the right gridded image. About the projection itself, you are using the Lambert Conical projection in the right way. You ...
Gabriel De Luca's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible