OpenStreetMap logo OpenStreetMap

Post When Comment
Kosovo street data split into 100 street work packages

Thanks!

That is great, anyone can help!

New delivery of road data for Kosovo

Data uploading here:
http://www.archive.org/details/Kosova_Road_Data_from_iMMAP

Planimetria de Vitoria

I have created a new version of the split that emits only one layer
from the ways at a time. It stored the nodes and emits them just before the way.
this produces much smaller files and you can
tweak the constants(not parameters)
my $chunksize=100;
my $searchkey="VIA_PAV_ASFALTO";

that means, the asfalt layer will be chucked into 100 polygon files.

http://github.com/h4ck3rm1k3/TwoNickels/commit/f27405ee63a0d87ae12dc402307f3588ac52a217

perl2exe

translation :
Dear buddylist! :)

And can someone make exe-version Leshin converter osm2mp? This would greatly help me.

Because once it did, I understand that this is possible.

What will matter?

Smells like off topic!

Planimetria de Vitoria

One more thing,
you should check out the layer attribute that I added. You can see if the name of the layer is asphalt or somthing. Also one more thing to do is replace the U+1234 names in the text. I did not do that, but you can do that with a simple search and replace in the osm files.

We can extend the program and make it better; it was just a quick hack for you over new years.

mike

Working on libredwg

Hi all,

I am just starting to work on the libredwg project that can read DWG without the restrictions of the "open design thing" that means you can download it and use it.

The DWG format is a jealousy guarded binary format that changes with every release of Autocad.
http://en.wikipedia.org/wiki/.dwg

Unfortunately we are missing a specification of all the formats, and most importantly, a test case. I guess the spec from OpenDesign is good, but I heard it was buggy. Also Is it complete? I want to have test data to work with that I can understand.

The GNU project has declared creating an Autocad reader is high priority project.

My plan is follows :

1. create a set of files to use as test case.
Reuse existing test suites for SVG, Blender and other tools. I have posted links to them on the other mails that I reference at the bottom.

2. convert those test cases into DWG and DXF files and to SVG/pdf so we can understand them.

3. do that in batch for each version of autocad.

Given a large body of tests cases, inputs and outputs, it should be easier to work on the decoding of this data.

See also :
http://mail.python.org/pipermail/pythoncad/2010-January/000974.html
http://lists.gnu.org/archive/html/libredwg/2010-01/msg00013.html
osm.org/user/h4ck3rm1k3/diary/9160

Planimetria de Vitoria

I have made a splitter routine for you to split up the huge osm file into chunks

The splitter is here :
http://github.com/h4ck3rm1k3/TwoNickels/blob/master/split.pl

you can change the constant 1000000 to something else.

Also you can increase the memory of java
-Xms400m -Xmx1800m for mimimum 400 and max 1800 mb.

Here are the chunks :
http://bitbucket.org/h4ck3rm1k3/openstreetmap-data-brasil/src/b285f6f88846/

code

my $count=1;

sub begin
{
open OUT , ">OUT_${count}.osm";
$count++;
print OUT '' . "\n";
print OUT '' . "\n";
}

sub end
{
print OUT '' . "\n";
close OUT;
}

my $id=0;

begin;

sub emit
{
my $rem =$id % 100000;
if ($rem==0)
{
warn "$id and $rem $_";
end;
begin;
next;
}
}

while (<>)
{

if (/\

Working on libredwg

Does anyone have any test cases in DWG format? We need to collect very many for development of the software.
mike

More Autocad files online

Here is a Another one :
http://www.degradimi.info/dropbox/k_prishtina_com.dwg.zip

OpenStreetmap Albania started

For more todos in albania,
check this :
http://random.dev.openstreetmap.org/no-names/?zoom=14&lat=41.32779&lon=19.81968&layers=0B000

TwoNickels(dime) dxf2osm is running with polygons

Here is just one part of the map :
http://ia341329.us.archive.org/1/items/VitoriaOpenstreetmapData/OUT_1.osm.bz2

here is a pic:


http://3.bp.blogspot.com/_jN3026PBiXg/S0JO0TneI_I/AAAAAAAAORA/hpMvRExPbZY/s320/Screenshot-13.png

TwoNickels(dime) dxf2osm is running with polygons

datafile is here:
http://ia341329.us.archive.org/1/items/VitoriaOpenstreetmapData/Planimetria_de_Vitoria-polygons.osm.bz2

cs2cs help

Ahh,
Ok. Well the input and output are just

x=358376.5
y=7753537

outputs are :
ry=-20.3106
rx=-40.3564

see the main routine...
http://github.com/h4ck3rm1k3/TwoNickels/blob/master/proj/proj.cpp

it is all working now, so dont worry about it.

cs2cs help

Sorry for the confusion.

MText is the new part of the Dime (two nickels)
http://github.com/h4ck3rm1k3/TwoNickels/blob/master/src/entities/MText.cpp

I have made a simple proj tool in dime as well here, but I forget to add that to git.
http://github.com/h4ck3rm1k3/TwoNickels/tree/master/proj/

On of my problems that was in the old code was the radians, I had converted the northing and easting to radians before converting. Now I do that after I get the results.

In fact, It works with the standard proj lib now, after I made the needed changes. Here is the current code :
So I dont *need* the proj patches, all the better.

Still, the code changes to proj are good, there were alot of bad typecasts, removing the constant from chars etc.

Ideally we could have a set of templates, one for each projection and do the code inline. It would be much faster.

to answer your questions : I had posted the parameters and results here with the code :

The new code using the standard proj interface :

void convertPoint(double x, double y, double & rx, double & ry) 

{
projPJ fromProj, toProj;
if (!(fromProj = pj_init_plus("+proj=utm +south +ellps=intl +zone=24K +units=m -f \"%.7f\" ")) )
exit(1);
if (!(toProj = pj_latlong_from_proj( fromProj )))
exit(1);
int islatlon= pj_is_latlong( fromProj );
int isgeocent=pj_is_geocent( fromProj );
char * name = pj_get_def( fromProj , 0);
std::cerr << "FROm NAME:"<< name << "|" << islatlon << "|" << isgeocent << std::endl;

islatlon= pj_is_latlong( toProj );
isgeocent=pj_is_geocent( toProj );
name = pj_get_def( toProj , 0);
std::cerr << "TO NAME:"<< name << "|" << islatlon << "|" << isgeocent << std::endl;

std::cerr.precision(10);
std::cerr.width(10);
std::cerr << x << "|" << y << std::endl;
// const double D2R =DEG_TO_RAD;
double ax = x;// * DEG_TO_RAD;
double ay = y;// * DEG_TO_RAD ;
double az = 0;

/** end of "caution" section. */
std::cerr.precision(10);
std::cerr.width(10);
std::cerr << ax << "|" << ay << "|" << std::endl;
int ret = pj_transform(fromProj, toProj,1,1, &ax, &ay, &az);

std::cerr.precision(10);
std::cerr.width(10);
std::cerr << ax << "|" << ay << "|" << ret << "|" << std::endl;

ax *= RAD_TO_DEG;
ay *= RAD_TO_DEG;

std::cerr << ax << "|" << ay << "|" << ret << "|" << std::endl;
rx = ay;
ry = ax;

pj_free(fromProj);
pj_free(toProj);

}


The inputs :
358376.5 7753537

the outputs :
FROm NAME: +proj=utm +south +ellps=intl +zone=24K +units=m|0|0
TO NAME: +proj=latlong +ellps=intl|1|0
358376.5|7753537
358376.5|7753537|
-0.7043522911|-0.3544868135|0|
-40.35641357|-20.31059831|0|
-20.3106:-40.3564

the convert point goes from a UTM northing/easting to lat/lon.
mike

Proj now working

I have added the first results of the dxf-osm converted,
the points with names are created.
http://www.archive.org/details/VitoriaOpenstreetmapData

code checked in
http://github.com/h4ck3rm1k3/ProjC--
http://github.com/h4ck3rm1k3/TwoNickels

More to come.

mike

Brasil Coordinates Transform

Data File:
http://filebin.ca/ewytu/test.osm

Very fast osm processing in C++

Memory leaks using xerces transcode. It was making copies of all the strings. Have replaced/removed all the unneeded copies of the strings for comparison and parsing of ints.

I have used valgrind to debug the memory leaks. The problems are removed. Also I turned off the reverse lookup by the string of the Point and removed it from the memory representation. Will look into using a rtree or a quadtree for that later.

mike

Very fast osm processing in C++

Now, to be fair, the osm2pgsql does process the osm files in a very similar way, but it is not intended on being a generic processor.

I am working on processing a much larger file now, the entire state file and also have started looking into the bzip2 processing inline and the sax reader.

We should be able to fetch just parts of a world.osm.bz2 file and process it while downloading (using the blocks as they complete)

But that is for the future, for now I will focus on the county processing.

Well, here are the results of wordcount on the uncompressed NJ file: 18 million nodes, counted in 1.5 minutes.

wget http://downloads.cloudmade.com/north_america/united_states/new_jersey/new_jersey.osm.bz2
bunzip2 new_jersey.osm.bz2

time wc new_jersey.osm
18612601 78918048 1249629139 new_jersey.osm
real 1m21.038s

One thing that I have observed, the processing takes up the entire processor, but only one of four. That is why we need these splitting routines in general so that we can process on mutiple processors easily. Osmosis is nice, but I dont feel confortable with using it, it is pretty complex. Ideally

Now, just running my county extractor on that takes a long time. I need to find out why....

mike

Very fast osm processing in C++

I have checked in the Makefile, using gcc -O4, have now the bounding box calculation and refactored the classes.
The time make test produces:
real 0m5.927s

here are my system details :
Ubuntu 9.10
ProblemType: Bug
Architecture: i386
Date: Fri Dec 25 10:52:00 2009
DistroRelease: Ubuntu 9.10
InstallationMedia: Ubuntu-Netbook-Remix 9.10 "Karmic Koala" - Release i386 (20091028.4)
NonfreeKernelModules: nvidia
Package: gcc 4:4.4.1-1ubuntu2
ProcEnviron:
LANG=en_US.UTF-8
SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-17.54-generic
SourcePackage: gcc-defaults
Tags: ubuntu-unr
Uname: Linux 2.6.31-17-generic i686

processor : 3
vendor_id : AuthenticAMD
cpu family : 15
model : 33
model name : Dual Core AMD Opteron(tm) Processor 265
stepping : 2
cpu MHz : 1808.403
cache size : 1024 KB
physical id : 1
siblings : 2
core id : 1
cpu cores : 2
apicid : 3
initial apicid : 3
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt lm 3dnowext 3dnow pni lahf_lm cmp_legacy
bogomips : 3616.92
clflush size : 64
power management: ts fid vid ttp