atlefren / sosi.js

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

Support BUEP geometry type #14

Closed atlefren closed 10 years ago

atlefren commented 10 years ago

as LineString

relet commented 10 years ago

There is code for that in kartverket:buep (or datatypes).

However, when dumping to TopoJSON, I get the error below, for example for testfile2.sos - this might be related to the definition of joints/knutepunkter in the arc or something else. I haven't looked close enough at the TopoJSON dumper yet that I could tell what the issue is.

SOSI.js.js:4233
                        if (feature.geometry instanceof ns.Polygon) {
                                   ^
TypeError: Cannot read property 'geometry' of undefined
at null.<anonymous> (/root/norgeskart.no/lib/src/sosi.js/dist/SOSI.js.js:4233:36)
at Array.map (native)
at Function._.map._.collect (/root/norgeskart.no/lib/src/sosi.js/node_modules/underscore/underscore.js:97:56)
at null.<anonymous> (/root/norgeskart.no/lib/src/sosi.js/dist/SOSI.js.js:4230:38)
at Array.map (native)
at Function._.map._.collect (/root/norgeskart.no/lib/src/sosi.js/node_modules/underscore/underscore.js:97:56)
at ns.Sosi2TopoJSON.ns.Base.extend.getPolygons (/root/norgeskart.no/lib/src/sosi.js/dist/SOSI.js.js:4224:22)
at ns.Sosi2TopoJSON.ns.Base.extend.dumps (/root/norgeskart.no/lib/src/sosi.js/dist/SOSI.js.js:4161:33)
at ns.Base.extend.dumps (/root/norgeskart.no/lib/src/sosi.js/dist/SOSI.js.js:4281:52)
at /root/norgeskart.no/lib/src/sosi.js/dist/SOSI.js.js:4319:37
atlefren commented 10 years ago

partially solved in #19 , closing now and opening a new issue for the TopoJSON error