Brasil Coordinates Transform
Posted by h4ck3rm1k3 on 1 January 2010 in English. Last updated on 2 January 2010.Skippern asked me to help him with some autocad files of Vitoria, ES, Brasil.
They were donated in an unreadable format.
I had asked who could convert the file, and Balrog-Kun was able to do that very quickly. osm.org/user/balrog-kun
osm.org/user/h4ck3rm1k3/diary/9096
Then I had the dfx files, which are ascii records. with the tool from dime dxf2vrml/dxf2vrml I could convert the dfx to vrml, which gives me the points and the ways, no names.
I have been debugging the code from dime, and found that the MText and Hatch records are not being translated, which I am working on hacking. That means that when I am finished, we will have a tool to automate the conversion of DFX to OSM for this town. I want to be able to produce the streets and areas from the autocad file.
Now the first step was to get the projection of the points into lat/long. This is the second time I had to use the cs2cs tool and it was easier.
The trick is to get the parameters right :
cs2cs +proj=utm +south +ellps=intl +zone=24K +units=m +proj=tmerc -f "%.7f
Here is an example convert :
echo 364786.8965740744 7753334.811439441 | cs2cs +proj=utm +south +ellps=intl +zone=24K +units=m +proj=tmerc -f "%.7f"
results are: (long, lat )
-40.2950446 -20.3128901 0.0000000
see also :
With this tool, you just enter in the coords and get the UTM zone to plug into the parameters of the UTM tool!
http://www.fcc.gov/mb/audio/bickel/DDDMMSS-decimal.html
Take the deg, min seconds and plug it in here to get the utm
http://www.cibolasar.org/UTMConverter.shtml
another page :
http://www.dmap.co.uk/ll2tm.htm
Here are some pictures :
What I did :
1. took the output of the dfx2 and extracted out the points. (../openstreetmap/brazil/Planimetria_de_Vitoria-points.osm)
358245.88 7753585.5
358246.06 7753584
2. ran cs2cs to convert the data:
cat ../openstreetmap/brazil/Planimetria_de_Vitoria-points.osm | cs2cs +proj=utm +south +ellps=intl +zone=24K +units=m +proj=tmerc -f "%.7f" | perl parse.pl > test.osm
3. The perl script produces a osm file:
my $id=0;print "\n";
while (<>)
{
chomp;
$id--;
if (/([\-\d\.]+) ([\-\d\.]+) ([\-\d\.]+)/)
{
print "\n";
}
else{
die $_;
}}
print "\n";
Discussion
Comment from h4ck3rm1k3 on 1 January 2010 at 21:28
Data File:
http://filebin.ca/ewytu/test.osm