Skip to content

Commit

Permalink
Update CHANGELOG
Browse files Browse the repository at this point in the history
  • Loading branch information
ingalls committed Jul 29, 2024
1 parent 2ea155c commit 66639c9
Show file tree
Hide file tree
Showing 3 changed files with 733 additions and 548 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@

## Version History

### v5.3.0

- :bug: If no `esriFeature.geometry` is returned, skip the Feature

### v5.2.0

- :bug: Fix `null` parsing as date in geometry parser
Expand Down
21 changes: 17 additions & 4 deletions lib/geometry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,14 @@ export default class Geometry extends EventEmitter {
for (const feature of data.features) {
if (!this.set.has(feature.attributes[this.oidField])) {
this.set.add(feature.attributes[this.oidField]);
this.emit('feature', this.toGeoJSON(feature));

try {
const feat = this.toGeoJSON(feature);
this.emit('feature', feat)
} catch (err) {
// This usually errors if it's an attribute only feature
if (process.env.DEBUG) console.error('Invalid Feature', feature);
}
}
}

Expand Down Expand Up @@ -166,7 +173,13 @@ export default class Geometry extends EventEmitter {
for (const feature of data.features) {
if (!this.set.has(feature.attributes[this.oidField])) {
this.set.add(feature.attributes[this.oidField]);
this.emit('feature', this.toGeoJSON(feature));
try {
const feat = this.toGeoJSON(feature);
this.emit('feature', feat)
} catch (err) {
// This usually errors if it's an attribute only feature
if (process.env.DEBUG) console.error('Invalid Feature', feature);
}
}
}
}
Expand All @@ -191,12 +204,12 @@ export default class Geometry extends EventEmitter {
const properties: GeoJsonProperties = {}
for (const prop in esrifeature.attributes) {
const schema: JSONSchema6Definition = this.schema.properties[prop];

if (
typeof schema !== 'boolean'
&& schema.format === 'date-time'
&& esrifeature.attributes[prop]
) {
) {
properties[prop] = new Date(esrifeature.attributes[prop]).toISOString();
} else {
properties[prop] = esrifeature.attributes[prop];
Expand Down
Loading

0 comments on commit 66639c9

Please sign in to comment.