Coder Social home page Coder Social logo

Type error in terraformer about agstoshapefile HOT 2 OPEN

tannerjt avatar tannerjt commented on June 5, 2024
Type error in terraformer

from agstoshapefile.

Comments (2)

vahtos avatar vahtos commented on June 5, 2024

This is old, but I am also having this issue.

agsout -s ./services.txt -o . -S
Number of features for service i07_WellCompletionReports: 994757
Getting chunks of 100 features, will make 9948 total requests
/usr/local/lib/node_modules/agsout/node_modules/terraformer/terraformer.js:674
        throw new Error("Unknown type: " + geojson.type);
        ^

Error: Unknown type: undefined
    at new Primitive (/usr/local/lib/node_modules/agsout/node_modules/terraformer/terraformer.js:674:15)
    at Object.parse (/usr/local/lib/node_modules/agsout/node_modules/terraformer-arcgis-parser/terraformer-arcgis-parser.js:330:12)
    at convert (/usr/local/lib/node_modules/agsout/index.js:166:33)
    at Parser.parser.onValue (/usr/local/lib/node_modules/agsout/node_modules/JSONStream/index.js:109:32)
    at Parser.proto.emit (/usr/local/lib/node_modules/agsout/node_modules/jsonparse/jsonparse.js:337:8)
    at Parser.proto.pop (/usr/local/lib/node_modules/agsout/node_modules/jsonparse/jsonparse.js:332:8)
    at Parser.proto.onToken (/usr/local/lib/node_modules/agsout/node_modules/jsonparse/jsonparse.js:402:12)
    at Parser.parser.onToken (/usr/local/lib/node_modules/agsout/node_modules/JSONStream/index.js:128:12)
    at Parser.proto.write (/usr/local/lib/node_modules/agsout/node_modules/jsonparse/jsonparse.js:135:34)
    at Stream.<anonymous> (/usr/local/lib/node_modules/agsout/node_modules/JSONStream/index.js:23:12)
    at Stream.stream.write (/usr/local/lib/node_modules/agsout/node_modules/through/index.js:26:11)
    at Request.ondata (internal/streams/legacy.js:16:26)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:188:7)
    at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/agsout/node_modules/request/request.js:1080:12)
    at emitOne (events.js:96:13)
    at IncomingMessage.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:176:18)
    at IncomingMessage.Readable.push (_stream_readable.js:134:10)
    at HTTPParser.parserOnBody (_http_common.js:123:22)
    at TLSSocket.socketOnData (_http_client.js:377:20)
    at emitOne (events.js:96:13)

Services.txt
http://gis-proxy.water.ca.gov/arcgis/rest/services/Environment/i07_WellCompletionReports/FeatureServer/0|i07_WellCompletionReports|100

from agstoshapefile.

vahtos avatar vahtos commented on June 5, 2024

After reviewing the error and source code, it looks like the it is happening in this function:

			if(!feature.geometry) {
				console.log("Feature Missing Geometry and is Omitted: ", JSON.stringify(feature))
				return null;
			}
			const gj = {
				type: 'Feature',
				properties: feature.attributes,
				geometry: TerraformerArcGIS.parse(feature.geometry)
			}
			return gj
		}

If a feature in the dataset does not have geometry(feature.geometry is undefined), then TerraformerArcGIS.parse is being passed undefined, instead of a geometry object. But I am confused because it looks like that's being checked for, so I don't understand how this error is happening...

from agstoshapefile.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.