https://github.com/ngageoint/geopackage-kml-js
GeoPackage KML Converter
https://github.com/ngageoint/geopackage-kml-js
converter geopackage kml
Last synced: 7 months ago
JSON representation
GeoPackage KML Converter
- Host: GitHub
- URL: https://github.com/ngageoint/geopackage-kml-js
- Owner: ngageoint
- Created: 2022-04-20T17:20:03.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-10-28T18:25:50.000Z (almost 3 years ago)
- Last Synced: 2024-04-28T22:22:44.868Z (over 1 year ago)
- Topics: converter, geopackage, kml
- Language: TypeScript
- Homepage: http://ngageoint.github.io/geopackage-kml-js/
- Size: 12 MB
- Stars: 1
- Watchers: 8
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## KML and KMZ files to Geopackage files
Using a Xml streaming library to read the kml file and convert the hierarchal data into relational data that GeoPackages can store.
### Installation ###
[](https://www.npmjs.com/package/@ngageoint/geopackage-kml-js)
```sh
$ npm install @ngageoint/geopackage-kml-js
```### Usage
```sh
./cli /path/to/file/to/convert.kml /path/to/file/to/create.gpkg
```### Javascript
```javascript
const { KMLToGeoPackage } = require('@ngageoint/geopackage-kml-js');
const kmlFile = './test.kml';
const geoPackageFile = './test.gpkg';
const tableName = 'features';// Convert CSV to GeoPackage feature table
const converter = new KMLToGeoPackage();
converter.convert({ kmlOrKmzPath: kmlFile, geoPackage: geoPackageFile, tableName: tableName }).then(() => {
console.log('File conversion complete');
console.log('Converted %s to %s', kmlFile, geoPackageFile);
});
```
---
### Currently Supports
- Placemark tags with and without coordinates
Stored as features in a feature table with any additional tags stored in a column of the table.
- Multigeometry tags
- Polygon tags
- inner and outer boundaries.
- LineString tags
- Point tags
- Most of Icon, Polygon and Line Style tags
- color converted to rgba
- GroundOverlay tags
- Image converision from EPSG: 4326 to EPSG: 3857 Web-mercator
- Image manipulation preformed by [Jimp](https://github.com/oliver-moran/jimp).
- Coordinate converision from [Proj4](https://github.com/proj4js/proj4js).
- Creates a tile set at appropriate from the zoomlevels.
- Starting at the zoomlevel where the GroundOverlay is covered by one tile.
- Ending where the image resolution matches that of the tile.
- This is done in steps of 2.
- Default Stylings of Google Earth.
- gx:altitudeMode
- ExtendedData
---
### Does not support but plan on supporting
- [ ] Network Links
- [ ] ScreenOverlays
- [ ] Folder and Document structure
- [ ] PhotoOverlays
- [ ] StyleMaps
- currently only captures normal style
- [ ] Region
- [x] gx:x, gx:y, gx:h and gx:w---
### Does not support and no plans to support currently
- lookAt tags
- Current it is stored as a JSON string in a column of the feature table
- Most of gx extensions
- Models tags
- Camera
- colorMode
- gx:LatLonQuad
- Google Sky
- ListStyle
- NetworkLinkControl