derhuerst / parse-gml-polygon

Convert a GML Polygon into GeoJSON.
https://github.com/derhuerst/parse-gml-polygon
ISC License
11 stars 2 forks source link

Example examples/xml-file.js does not work #6

Closed highsource closed 6 years ago

highsource commented 6 years ago
parse-gml-polygon-upstream\examples>node xml-file.js
parse-gml-polygon-upstream\index.js:150
        if (!exterior) throw new Error('invalid ' + _.name + ' element')
                       ^

Error: invalid gml:Polygon element
    at parsePolygonOrRectangle (parse-gml-polygon-upstream\index.js:150:23)
    at parse (parse-gml-polygon-upstream\index.js:228:17)
    at EventEmitter.parser.once (parse-gml-polygon-upstream\examples\xml-file.js:18:17)
    at EventEmitter.emit (parse-gml-polygon-upstream\node_modules\eventemitter3\index.js:129:35)
    at EventEmitter.handleLexerData (parse-gml-polygon-upstream\node_modules\xml-reader\dist\reader.js:72:28)
    at EventEmitter.emit (parse-gml-polygon-upstream\node_modules\eventemitter3\index.js:129:35)
    at emit (parse-gml-polygon-upstream\node_modules\xml-lexer\dist\lexer.js:84:15)
    at parse-gml-polygon-upstream\node_modules\xml-lexer\dist\lexer.js:118:13
    at step (parse-gml-polygon-upstream\node_modules\xml-lexer\dist\lexer.js:234:9)
    at EventEmitter.lexer.write [as parse] (parse-gml-polygon-upstream\node_modules\xml-lexer\dist\lexer.js:240:13)
derhuerst commented 6 years ago

I think this is caused by pladaria/xml-reader#9.

highsource commented 6 years ago

Let's remove stream:true for a while?

derhuerst commented 6 years ago

Let's remove stream:true for a while?

Although I'm really inclined to remove the example (the world doesn't need more shitty code that freezes or even crashes with 100mb of GML), it is a relevant use case that people want to parse a GML file. I will adapt it heavy-heartedly. 😢

derhuerst commented 6 years ago

Fixed by 362e55b.