Closed jfoclpf closed 1 year ago
async extract(geopackage: GeoPackage, tableName: string): Promise<any> {
const geoJson = {
type: 'FeatureCollection',
features: [],
};
const iterator = geopackage.iterateGeoJSONFeatures(tableName);
for (const feature of iterator) {
geoJson.features.push(feature);
}
return Promise.resolve(geoJson);
}
For that don't you need to know the tableName
beforehand?
@jfoclpf you need to know the table's name to request its features. If you want to get the feature table names in the GeoPackage, you can call the getFeatureTables method on the geopackage object.
https://ngageoint.github.io/geopackage-js/classes/geopackage.html#getfeaturetables
const featureTables = geopackage.getFeatureTables();
Can you show how to convert GeoPackage file to geojson file in Node/Js
Documentation is very scarce
Thank you