atlefren / sosi.js

LIbrary to read SOSI files in Javascript
MIT License
28 stars 12 forks source link

Support for attributes after ..REF lines; LINJE geometry; #3

Closed relet closed 11 years ago

relet commented 11 years ago

for a geometry like

.FLATE 184:
..OBJTYPE OrtofotoAreal
..FTEMA 9460
...BILDE-NR 7606_4
..GML-FOTO-DATO1 20110127
..REF :138 :30 :-157 :-95
..GML-FOTO-DATO2 20111101
..INFO 7606_4_10m_z35.zip
..FOTO-DATO 20111101
..INFO 7606_4_10m_z35.zip
..NØ
7675000 624996

all lines after the first ..REF were parsed as references, resulting in NaN refs and lost data. The patch detects if one of the following lines again starts with dot notation.

I also added LINJE as a synonym for KURVE in older SOSI files. And I fixed the legacy Proj4js import of definitions.

-- sorry for bundling the pull requests, the changes happened fast. :)

atlefren commented 11 years ago

Great!

I'm definitely learning something new about SOSI through this project!

I guess you've run the tests, but I would like to run them myself before I merge this request. I'll see if I can do that tonight when I'm back with my other pc

relet commented 11 years ago

Me too... ;) Just parsing a few real life SOSI files and fixing whatever get coughed up - technically I can't even guarantee I'm working after spec here. But they say you should be flexible in what you can parse and rigid in what you produce.

I haven't gotten the tests to run yet (as in, getting buster to work for me, not as in, passing the tests), so please do that first.

relet commented 11 years ago

Interesting - I didn't realize a pull request can point to HEAD and update. I guess that's actually a good thing. The remaining changes are short and explained in the commit descriptions.