Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
osm-p2p-xml
Advanced tools
generate open street map xml from an osm-p2p-db query
var level = require('level')
var hyperlog = require('hyperlog')
var fdstore = require('fd-chunk-store')
var db = {
log: level('/tmp/osm-p2p/log'),
index: level('/tmp/osm-p2p/index')
}
var osmdb = require('osm-p2p-db')
var osm = osmdb({
log: hyperlog(db.log, { valueEncoding: 'json' }),
db: db.index,
store: fdstore(4096, '/tmp/osm-p2p/tree'),
size: 4096
})
var toxml = require('osm-p2p-xml')
var q = [
[ 38.89958342598271, 38.90385833966776 ],
[ -77.02514648437499, -77.01965332031249 ]
]
osm.queryStream(q)
.pipe(toxml(q))
.pipe(process.stdout)
output:
$ node osm.js
<?xml version="1.0" encoding="UTF-8"?><osm><bounds minlat="38.89958342598271" maxlat="38.90385833966776" minlon="-77.02514648437499" maxlon="-77.01965332031249"/><node lat="38.90094671136515" lon="-77.02313139881134" timestamp="2015-12-31T20:50:35.826Z" id="1db08fd46c5a7c01" version="334fd5b5114e0ae69c151978640cd5692c9fb639c7565ba48b0cd2700e1d8547"></node><way v="5" timestamp="2015-12-31T20:50:35.842Z" id="29ac0c8f50e630e9" version="57f9ec2913db5e568976372afa8997255fdb614cff48ca01565f2ddee3687bc8"><nd ref="1db08fd46c5a7c01"/><nd ref="8c50fa92c3ce91d7"/><nd ref="83c1be761a9f4148"/><nd ref="1db08fd46c5a7c01"/><tag k="area" v="yes"/></way><node lat="38.90068996279713" lon="-77.02327892030715" timestamp="2015-12-31T20:50:35.849Z" id="8c50fa92c3ce91d7" version="8f32080b4501459d8a904c568e2a0c7de92de435fab8c7d16ae2b39851046991"></node><node lat="38.90084129844752" lon="-77.02284037913323" timestamp="2015-12-31T20:50:35.855Z" id="83c1be761a9f4148" version="0443c3916e92250149c8086ed21b2265cb6af161dbf63a17e30a7d3c8a0cb0b1"></node></osm>
var toxml = require('osm-p2p-xml')
Return a transform object stream
that expects osm-p2p-db queryStream data
as input and produces osm xml output.
Node object format:
node.type
- 'node'
node.id
- id stringnode.version
- version stringnode.lat
- latitude in degreesnode.lon
- longitude in degreesWay object format:
way.type
- 'way'
way.id
- id stringway.version
- version stringway.refs
- array of node IDsRelation object format:
relation.type
- relation.type
relation.id
- id stringrelation.version
- version stringrelation.members
- array of member (node, way, or relation) IDsnpm install osm-p2p-xml
BSD
FAQs
generate open street map xml from an osm-p2p-db query
The npm package osm-p2p-xml receives a total of 11 weekly downloads. As such, osm-p2p-xml popularity was classified as not popular.
We found that osm-p2p-xml demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.