mirror of
https://github.com/osm2pgsql-dev/osm2pgsql.git
synced 2025-08-16 16:03:23 +00:00
Switch from 900913 to 3857
This commit is contained in:
@ -5,7 +5,7 @@ Osm2pgsql can be used in combination with [ogr2ogr](http://www.gdal.org/ogr2ogr.
|
||||
An example command to export to GeoJSON would be
|
||||
|
||||
ogr2ogr -f "GeoJSON" roads.geojson -t_srs EPSG:4326 \
|
||||
PG:"dbname=gis" -s_srs EPSG:900913 \
|
||||
PG:"dbname=gis" -s_srs EPSG:3857 \
|
||||
-sql "SELECT name,highway,oneway,toll,way FROM planet_osm_line WHERE highway IS NOT NULL"
|
||||
|
||||
Care should be taken if exporting to shapefiles, as characters may be present
|
||||
|
@ -1,4 +1,4 @@
|
||||
.TH OSM2PGSQL 1 "April 06, 2013"
|
||||
.TH OSM2PGSQL 1 "February 27, 2016"
|
||||
.\" Please adjust this date whenever revising the manpage.
|
||||
.SH NAME
|
||||
osm2pgsql \- Openstreetmap data to PostgreSQL converter.
|
||||
@ -241,7 +241,7 @@ Verbose output.
|
||||
.SH SUPPORTED PROJECTIONS
|
||||
Latlong (\-l) SRS: 4326 (none)
|
||||
.br
|
||||
Spherical Mercator (\-m) SRS:900913 +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs +over
|
||||
Spherical Mercator (\-m) SRS:3857 +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs +over
|
||||
.br
|
||||
EPSG-defined (\-E) SRS: +init=epsg:(as given in parameter)
|
||||
.PP
|
||||
|
@ -53,7 +53,7 @@ class merc_reprojection_t : public reprojection
|
||||
public:
|
||||
osmium::geom::Coordinates reproject(osmium::Location loc) const override
|
||||
{
|
||||
/* The latitude co-ordinate is clipped at slightly larger than the 900913 'world'
|
||||
/* The latitude co-ordinate is clipped at slightly larger than the 3857 'world'
|
||||
* extent of +-85.0511 degrees to ensure that the points appear just outside the
|
||||
* edge of the map. */
|
||||
double lat = loc.lat_without_check();
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include <osmium/geom/projection.hpp>
|
||||
#include <osmium/osm/location.hpp>
|
||||
|
||||
enum Projection { PROJ_LATLONG = 4326, PROJ_SPHERE_MERC = 900913 };
|
||||
enum Projection { PROJ_LATLONG = 4326, PROJ_SPHERE_MERC = 3857 };
|
||||
|
||||
class reprojection : public boost::noncopyable
|
||||
{
|
||||
|
@ -101,7 +101,7 @@ void test_regression_simple() {
|
||||
db->check_number(143.81, "SELECT ST_Area(ST_Transform(way,4326)::geography) FROM osm2pgsql_test_polygon WHERE osm_id = 157261342");
|
||||
|
||||
// Check a point's location
|
||||
db->check_count(1, "SELECT count(*) FROM osm2pgsql_test_point WHERE ST_DWithin(way, 'SRID=900913;POINT(1062645.12 5972593.4)'::geometry, 0.1)");
|
||||
db->check_count(1, "SELECT count(*) FROM osm2pgsql_test_point WHERE ST_DWithin(way, 'SRID=3857;POINT(1062645.12 5972593.4)'::geometry, 0.1)");
|
||||
}
|
||||
|
||||
void test_latlong() {
|
||||
|
Reference in New Issue
Block a user