Skip to content

Commit

Permalink
upgrade default projection of epsg:4326 to match exactly what proj4 s…
Browse files Browse the repository at this point in the history
…tores in /usr/local/share/epsg for 4326 (aka WGS84)

git-svn-id: svn+ssh://svn.mapnik.org/trunk@2130 d397654b-2ff0-0310-9e29-ba003691a0f9
  • Loading branch information
dane committed Aug 10, 2010
1 parent d2b0667 commit 09d7082
Show file tree
Hide file tree
Showing 19 changed files with 64 additions and 59 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG
Expand Up @@ -14,6 +14,11 @@ For a complete change history, see the SVN log.
Mapnik Trunk
------------

- Upgraded to the latest proj4 string literal for EPSG:4326 (WGS84) as global default projection (#333)

- Added 'mapnik_version_from_string()' function in python bindings to easily convert string representation
of version number to the integer format used in 'mapnik/version.hpp'. e.g. '0.7.1' --> 701.

- Added 'mapnik_version_from_string()' function in python bindings to easily convert string representation
of version number to the integer format used in 'mapnik/version.hpp'. e.g. '0.7.1' --> 701.

Expand Down
30 changes: 15 additions & 15 deletions bindings/python/mapnik_layer.cpp
Expand Up @@ -128,11 +128,11 @@ void export_layer()
"\n"
"The srs can be either a Proj.4 epsg code ('+init=epsg:<code>') or\n"
"of a Proj.4 literal ('+proj=<literal>').\n"
"If no srs is specified it will default to '+proj=latlong +datum=WGS84'\n"
"If no srs is specified it will default to '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs'\n"
"\n"
"Usage:\n"
">>> from mapnik import Layer\n"
">>> lyr = Layer('My Layer','+proj=latlong +datum=WGS84')\n"
">>> lyr = Layer('My Layer','+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs')\n"
">>> lyr\n"
"<mapnik._mapnik.Layer object at 0x6a270>\n"
))
Expand All @@ -146,7 +146,7 @@ void export_layer()
"\n"
"Usage:\n"
">>> from mapnik import Layer\n"
">>> lyr = Layer('My Layer','+proj=latlong +datum=WGS84')\n"
">>> lyr = Layer('My Layer','+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs')\n"
">>> lyr.envelope()\n"
"box2d(-1.0,-1.0,0.0,0.0) # default until a datasource is loaded\n"
)
Expand All @@ -163,7 +163,7 @@ void export_layer()
"\n"
"Usage:\n"
">>> from mapnik import Layer\n"
">>> lyr = Layer('My Layer','+proj=latlong +datum=WGS84')\n"
">>> lyr = Layer('My Layer','+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs')\n"
">>> lyr.visible(1.0/1000000)\n"
"True\n"
">>> lyr.active = False\n"
Expand All @@ -178,7 +178,7 @@ void export_layer()
"\n"
"Usage:\n"
">>> from mapnik import Layer\n"
">>> lyr = Layer('My Layer','+proj=latlong +datum=WGS84')\n"
">>> lyr = Layer('My Layer','+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs')\n"
">>> lyr.abstract\n"
"'' # default is en empty string\n"
">>> lyr.abstract = 'My Shapefile rendered with Mapnik'\n"
Expand All @@ -193,7 +193,7 @@ void export_layer()
"\n"
"Usage:\n"
">>> from mapnik import Layer\n"
">>> lyr = Layer('My Layer','+proj=latlong +datum=WGS84')\n"
">>> lyr = Layer('My Layer','+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs')\n"
">>> lyr.active\n"
"True # Active by default\n"
">>> lyr.active = False # set False to disable layer rendering\n"
Expand All @@ -217,7 +217,7 @@ void export_layer()
"\n"
"Usage:\n"
">>> from mapnik import Layer, Datasource\n"
">>> lyr = Layer('My Layer','+proj=latlong +datum=WGS84')\n"
">>> lyr = Layer('My Layer','+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs')\n"
">>> lyr.datasource = Datasource(type='shape',file='world_borders')\n"
">>> lyr.datasource\n"
"<mapnik.Datasource object at 0x65470>\n"
Expand All @@ -230,7 +230,7 @@ void export_layer()
"\n"
"Usage:\n"
">>> from mapnik import Layer\n"
">>> lyr = Layer('My Layer','+proj=latlong +datum=WGS84')\n"
">>> lyr = Layer('My Layer','+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs')\n"
">>> lyr.maxzoom\n"
"1.7976931348623157e+308 # default is the numerical maximum\n"
">>> lyr.maxzoom = 1.0/1000000\n"
Expand All @@ -245,7 +245,7 @@ void export_layer()
"\n"
"Usage:\n"
">>> from mapnik import Layer\n"
">>> lyr = Layer('My Layer','+proj=latlong +datum=WGS84')\n"
">>> lyr = Layer('My Layer','+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs')\n"
">>> lyr.minzoom # default is 0\n"
"0.0\n"
">>> lyr.minzoom = 1.0/1000000\n"
Expand All @@ -260,7 +260,7 @@ void export_layer()
"\n"
"Usage:\n"
">>> from mapnik import Layer\n"
">>> lyr = Layer('My Layer','+proj=latlong +datum=WGS84')\n"
">>> lyr = Layer('My Layer','+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs')\n"
">>> lyr.name\n"
"'My Layer'\n"
">>> lyr.name = 'New Name'\n"
Expand All @@ -275,7 +275,7 @@ void export_layer()
"\n"
"Usage:\n"
">>> from mapnik import layer\n"
">>> lyr = layer('My layer','+proj=latlong +datum=WGS84')\n"
">>> lyr = layer('My layer','+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs')\n"
">>> lyr.queryable\n"
"False # Not queryable by default\n"
">>> lyr.queryable = True\n"
Expand All @@ -290,9 +290,9 @@ void export_layer()
"\n"
"Usage:\n"
">>> from mapnik import layer\n"
">>> lyr = layer('My layer','+proj=latlong +datum=WGS84')\n"
">>> lyr = layer('My layer','+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs')\n"
">>> lyr.srs\n"
"'+proj=latlong +datum=WGS84' # The default srs if not initialized with custom srs\n"
"'+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs' # The default srs if not initialized with custom srs\n"
">>> # set to google mercator with Proj.4 literal\n"
"... \n"
">>> lyr.srs = '+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'\n"
Expand All @@ -304,7 +304,7 @@ void export_layer()
"\n"
"Usage:\n"
">>> from mapnik import layer\n"
">>> lyr = layer('My layer','+proj=latlong +datum=WGS84')\n"
">>> lyr = layer('My layer','+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs')\n"
">>> lyr.styles\n"
"<mapnik._mapnik.Names object at 0x6d3e8>\n"
">>> len(lyr.styles)\n"
Expand All @@ -323,7 +323,7 @@ void export_layer()
"\n"
"Usage:\n"
">>> from mapnik import layer\n"
">>> lyr = layer('My layer','+proj=latlong +datum=WGS84')\n"
">>> lyr = layer('My layer','+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs')\n"
">>> lyr.title\n"
"''\n"
">>> lyr.title = 'My first layer'\n"
Expand Down
8 changes: 4 additions & 4 deletions bindings/python/mapnik_map.cpp
Expand Up @@ -150,15 +150,15 @@ void export_map()
"Create a Map with a width and height as integers and, optionally,\n"
"an srs string either with a Proj.4 epsg code ('+init=epsg:<code>')\n"
"or with a Proj.4 literal ('+proj=<literal>').\n"
"If no srs is specified the map will default to '+proj=latlong +datum=WGS84'\n"
"If no srs is specified the map will default to '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs'\n"
"\n"
"Usage:\n"
">>> from mapnik import Map\n"
">>> m = Map(600,400)\n"
">>> m\n"
"<mapnik._mapnik.Map object at 0x6a240>\n"
">>> m.srs\n"
"'+proj=latlong +datum=WGS84'\n"
"'+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs'\n"
))

.def_pickle(map_pickle_suite()
Expand Down Expand Up @@ -419,7 +419,7 @@ void export_map()
"Spatial reference in Proj.4 format.\n"
"Either an epsg code or proj literal.\n"
"For example, a proj literal:\n"
"\t'+proj=latlong +datum=WGS84'\n"
"\t'+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs'\n"
"and a proj epsg code:\n"
"\t'+init=epsg:4326'\n"
"\n"
Expand All @@ -428,7 +428,7 @@ void export_map()
"\n"
"Usage:\n"
">>> m.srs\n"
"'+proj=latlong +datum=WGS84' # The default srs if not initialized with custom srs\n"
"'+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs' # The default srs if not initialized with custom srs\n"
">>> # set to google mercator with Proj.4 literal\n"
"... \n"
">>> m.srs = '+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'\n"
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/mapnik_python.cpp
Expand Up @@ -508,7 +508,7 @@ BOOST_PYTHON_MODULE(_mapnik2)
">>> m = Map(256,256)\n"
">>> load_map(m,'mapfile_wgs84.xml')\n"
">>> m.srs\n"
"'+proj=latlong +datum=WGS84'\n"
"'+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs'\n"
">>> m.srs = '+init=espg:3395'\n"
">>> save_map(m,'mapfile_mercator.xml')\n"
"\n"
Expand Down
2 changes: 1 addition & 1 deletion demo/test/charplacement.py
Expand Up @@ -27,7 +27,7 @@
installed successfully before running this script.\n\n'
raise

m = Map(690,690,"+proj=latlong +ellps=WGS84")
m = Map(690,690,"+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs")

m.background = Color(255,100,100,255)

Expand Down
2 changes: 1 addition & 1 deletion demo/test/displacement.py
Expand Up @@ -27,7 +27,7 @@
installed successfully before running this script.\n\n'
raise

m = Map(690,690,"+proj=latlong +ellps=WGS84")
m = Map(690,690,"+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs")

m.background = Color(255,100,100,255)

Expand Down
2 changes: 1 addition & 1 deletion demo/test/overlap.py
Expand Up @@ -27,7 +27,7 @@
installed successfully before running this script.\n\n'
raise

m = Map(690,690,"+proj=latlong +ellps=WGS84")
m = Map(690,690,"+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs")

m.background = Color(255,100,100,255)

Expand Down
2 changes: 1 addition & 1 deletion demo/test/textspacing.py
Expand Up @@ -27,7 +27,7 @@
installed successfully before running this script.\n\n'
raise

m = Map(690,690,"+proj=latlong +ellps=WGS84")
m = Map(690,690,"+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs")

m.background = Color(255,100,100,255)

Expand Down
4 changes: 2 additions & 2 deletions include/mapnik/layer.hpp
Expand Up @@ -39,12 +39,12 @@ namespace mapnik
* Create a layer with a named string and, optionally, an srs string either
* with a Proj.4 epsg code ('+init=epsg:<code>') or with a Proj.4 literal
* ('+proj=<literal>'). If no srs is specified it will default to
* '+proj=latlong +datum=WGS84'
* '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs'
*/
class MAPNIK_DECL layer
{
public:
explicit layer(std::string const& name, std::string const& srs="+proj=latlong +datum=WGS84");
explicit layer(std::string const& name, std::string const& srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs");
layer(layer const& l);
layer& operator=(layer const& l);
bool operator==(layer const& other) const;
Expand Down
4 changes: 2 additions & 2 deletions include/mapnik/map.hpp
Expand Up @@ -95,7 +95,7 @@ class MAPNIK_DECL Map
* Creates a map with these parameters:
* - width = 400
* - height = 400
* - projection = "+proj=latlong +datum=WGS84"
* - projection = "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"
*/
Map();

Expand All @@ -104,7 +104,7 @@ class MAPNIK_DECL Map
* @param height Initial map height.
* @param srs Initial map projection.
*/
Map(int width, int height, std::string const& srs="+proj=latlong +datum=WGS84");
Map(int width, int height, std::string const& srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs");

/*! \brief Copy Constructur.
*
Expand Down
4 changes: 2 additions & 2 deletions include/mapnik/proj_transform.hpp
Expand Up @@ -47,8 +47,8 @@ class MAPNIK_DECL proj_transform : private boost::noncopyable
private:
projection const& source_;
projection const& dest_;
bool is_source_latlong_;
bool is_dest_latlong_;
bool is_source_longlat_;
bool is_dest_longlat_;
bool is_source_equal_dest_;
};
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/input/kismet/kismet_featureset.cpp
Expand Up @@ -41,7 +41,7 @@ kismet_featureset::kismet_featureset(const std::list<kismet_network_data> &knd_l
tr_(new transcoder(encoding)),
feature_id (0),
knd_list_it(knd_list_.begin ()),
source_("+proj=latlong +datum=WGS84")
source_("+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs")
{
//cout << "kismet_featureset::kismet_featureset()" << endl;
}
Expand Down
4 changes: 2 additions & 2 deletions plugins/input/osm/test.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE Map>
<Map bgcolor="#b5d0d0" srs="+proj=latlong +datum=WGS84">
<Map bgcolor="#b5d0d0" srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs">

<Style name="coast-poly">
<Rule>
Expand Down Expand Up @@ -481,7 +481,7 @@
</Rule>
</Style>

<Layer name="roads" status="on" srs="+proj=latlong +datum=WGS84">
<Layer name="roads" status="on" srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs">
<StyleName>roads-casing</StyleName>
<StyleName>footway</StyleName>
<StyleName>cycleway</StyleName>
Expand Down
16 changes: 8 additions & 8 deletions plugins/input/osm/test2.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE Map>
<Map bgcolor="#d0d0d0" srs="+proj=latlong +datum=WGS84">
<Map bgcolor="#d0d0d0" srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs">
<Style name="amenity">
<Rule>
<Filter>[amenity]='pub'</Filter>
Expand Down Expand Up @@ -466,15 +466,15 @@
</Rule>
</Style>

<Layer name="leisure" status="on" srs="+proj=latlong +datum=WGS84">
<Layer name="leisure" status="on" srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs">
<StyleName>leisure</StyleName>
<Datasource>
<Parameter name="type">osm</Parameter>
<Parameter name="file">test2.osm</Parameter>
</Datasource>
</Layer>

<Layer name="waterway" status="on" srs="+proj=latlong +datum=WGS84">
<Layer name="waterway" status="on" srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs">
<StyleName>river</StyleName>
<StyleName>stream</StyleName>
<Datasource>
Expand All @@ -483,15 +483,15 @@
</Datasource>
</Layer>

<Layer name="lakes" status="on" srs="+proj=latlong +datum=WGS84">
<Layer name="lakes" status="on" srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs">
<StyleName>lakes</StyleName>
<Datasource>
<Parameter name="type">osm</Parameter>
<Parameter name="file">test2.osm</Parameter>
</Datasource>
</Layer>

<Layer name="roads" status="on" srs="+proj=latlong +datum=WGS84">
<Layer name="roads" status="on" srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs">
<StyleName>roads-casing</StyleName>
<StyleName>footway</StyleName>
<StyleName>cycleway</StyleName>
Expand All @@ -510,23 +510,23 @@
</Datasource>
</Layer>

<Layer name="amenity" status="on" srs="+proj=latlong +datum=WGS84">
<Layer name="amenity" status="on" srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs">
<StyleName>amenity</StyleName>
<Datasource>
<Parameter name="type">osm</Parameter>
<Parameter name="file">test2.osm</Parameter>
</Datasource>
</Layer>

<Layer name="roadstext" status="on" srs="+proj=latlong +datum=WGS84">
<Layer name="roadstext" status="on" srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs">
<StyleName>roads-text</StyleName>
<Datasource>
<Parameter name="type">osm</Parameter>
<Parameter name="file">test2.osm</Parameter>
</Datasource>
</Layer>

<Layer name="text" status="on" srs="+proj=latlong +datum=WGS84">
<Layer name="text" status="on" srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs">
<StyleName>text</StyleName>
<Datasource>
<Parameter name="type">osm</Parameter>
Expand Down

0 comments on commit 09d7082

Please sign in to comment.