Hi,
I took the parish layer from
http://www.ugandaclusters.ug/geo-im.htm
and I would like to overlay that on top of OSM.
The paris layer is projected in WSG84 or EPSG 4326 and OSM (and Gmaps) is in
EPSG 900913 (or i found, EPSG 3785 which is suposedly almost the same).
I tried quite a bit of options in QGIS, but i can not find how i get from the
WSG84 coordinates to the lat/lon coordinates that OSM uses.
I did find some people on the internet with the same issue, but as soon as
strings start looking like
<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 <>
I am sort of overwhelmed.
Is there an easy way of doing this transformation with a FOSS tool?
--
rgds,
Reinier Battenberg
Director
Mountbatten Ltd.
+256 758 801 749
www.mountbatten.net
Re: [Mapping Uganda] transformation to other projection question
Hi Rainer,
This is an issue that comes up again and again. The newer spherical
Mercator projection is not supported by many of the tools out there.
The easiest way to do this (which does not sound that easy but really
is) is to setup your own WMS server that allows for the latest
projections. You load the raw data as its native projection and set the
output WMS to spherical Mercator by appending "SRS=EPSG:900913" to the
WMS request in Open Layers.
1) Download and install a WMS (GeoServer - which is my favorite,
MapServer, Degree, etc)
2) Make sure the PRO4J library has the latest projections. If not just
add: "<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 <>" to the EPSG file.
3)In the WMS request of Open Layers append on the correct EPSG code and
the WMS will reproject the data on the fly.
Hope this helps. -Jubal
Re: [Mapping Uganda] transformation to other projection question
sorry, that other transformation tool was from the good old US military:
http://earth-info.nga.mil/GandG/geotrans
--
rgds,
Reinier Battenberg
Director
Mountbatten Ltd.
+256 758 801 749
www.mountbatten.net
Re: [Mapping Uganda] transformation to other projection question
Reiner.Thanks for the links. You have gotten me thinking more about my
ElectionsTracker App. Never seen that Afganistan site before.
On 26 April 2010 22:22, Reinier Battenberg <
reinier [dot] battenberg [at] mountbatten [dot] net> wrote:
Re: [Mapping Uganda] transformation to other projection question
Thanks Jubal,
I am so looking forward to running our own geoserver (we do have an old copy
stashed somewhere)
But my businesscase currently is that I would like to import the parishes one
by one into a WKT field in Drupal. One page for each parish, and with the other
fields in the parishes dataset, I would be able to group these pages by
Subcounty & District. And for each (sub)list of parishes, we can generate a
map on the fly, including the Parishes outline. We can also change the coloring
& outline based on other data we have in the website. (like number of
bananas/parish if that is what we store)
We can also, when people create a page/record of another type, for example
'LC1', let them select the parish where this person is located. (or the
District or Subcounty)
This way I will be able to do some nice reporting, using Drupal Magic, and
plot the result on a map at the same time.
For those of you not familiar with Drupal Magic, here is a nice example:
http://afghanistanelectiondata.org/
In another example, we are now working on a site that plots clinics on a map.
We can plot the clinics, and filter the page on Services that a clinic offers
(Pharmacy, Malaria Testing, First Aid, etc). All that data is stored in
Drupal, including the geodata, which makes it super-easy for us to filter.
let me read up on pro4j though, it seems that is also a direction to look into
(for the not so easy solution)
--
rgds,
Reinier Battenberg
Director
Mountbatten Ltd.
+256 758 801 749
www.mountbatten.net
Re: [Mapping Uganda] transformation to other projection question
Hi,
I found a few things. One of them is a free transformation tool that does
points.
I need polygons in a shapefile, so i continued, and stumbled across this gem of
webdesign, and all the way down
http://d.hatena.ne.jp/hajime_create/20091123/1258994371
it says
How to convert from wgs84 to spherical mercator with ogr2ogr
ogr2ogr -f "ESRI Shapefile" -t_srs "EPSG:900913" main_spherical.shp main.shp
where ''main.shp'' is the source file
I tried that on the Ugandan Regions shapefile (we have 4 regions) and here is
the result:
ogr2ogr -skipfailures -f "ESRI Shapefile" -s_srs "EPSG:4326" -t_srs
"EPSG:900913" uganda_regions_mercator.shp uganda_regions.shp
which results in:
Failed to reproject feature 0 (geometry probably out of source or destination
SRS).
Failed to reproject feature 1 (geometry probably out of source or destination
SRS).
Failed to reproject feature 2 (geometry probably out of source or destination
SRS).
Failed to reproject feature 3 (geometry probably out of source or destination
SRS).
Problem could be, that i manually have to pick a projection, as the projection
is not set in the shapefile. Is there anyone who knows what the projection of
these files is?
--
rgds,
Reinier Battenberg
Director
Mountbatten Ltd.
+256 758 801 749
www.mountbatten.net
Re: [Mapping Uganda] transformation to other projection question
sorry, that u cant use Wins. I would also have pointed you to
MapWindow GeoTools which impelments the use of Proj4 dll in a simpler
way....buts uses MS Wins.
Temprary Tool
Please try to use:http://franson.com/coordtrans/index.asp?ref=google&gclid=CNPHo5GTpKECFVMB4wodhmeSww.
I will direct you to another tool.
Re: [Mapping Uganda] transformation to other projection question
Hi. I once created my own Coordinate Transformation tool. but i lost
the project files and exe too.
I had to look at this tool from fransisco:
http://franson.com/coordtrans/index.asp?ref=google&gclid=CNPHo5GTpKECFVM...
and some other excel file. I got to learn much.
So, even though it takes 7 days for it to expire. i know its the best
out there. Try it.
regards
Sam Kea
Re: [Mapping Uganda] transformation to other projection question
Hi Sam,
Thanks for that tip. I will defenitly consider it when push comes to shove.
As I dont run windows and tend to use FOSS for everything we do in the office, I
was wondering whether there are any FOSS tools that can do the same trick.
AFAIK you could have a shot at it with ogr2ogr, but i am not really sure how.
--
rgds,
Reinier Battenberg
Director
Mountbatten Ltd.
+256 758 801 749
www.mountbatten.net