
Product
Announcing Precomputed Reachability Analysis in Socket
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
net.mahmutkocas:osmparser
Advanced tools
Parsing ".osm" file which is either exported from "openstreetmap.org" or generated in similar manner with Open Street Map.
implementation group: 'net.mahmutkocas', name: 'osmparser', version: '[VERSION]'
OSMParser has static function called "parseXML(String)", by passing file path one can easily parse the XML file.
OSMDocument osmDocument = OSMParser.parseXML(file);
OSMDocument provides parsed OSM Nodes, Ways and Relations with getter methods.
Map<Long, OSMNode> nodeMap = osmDocument.getNodes(); // Returns nodes.
Map<Long, OSMWay> wayMap = osmDocument.getWays(); // Returns ways.
Map<Long, OSMRelation> relationMap = osmDocument.getRelations(); // Returns relations.
Returned values are maps. Keys are the IDs of the elements. By calling ".values()" method, one can get values.
List<OSMNode> nodes = nodeMap.values(); // Raw Node List.
Ex:
List<BasicRouteModel> routeModels = osmDocument.getType(Tag.Type.HIGHWAY) // Only returns highways.
Possible BasicRouteModels are OSMNode, OSMWay, OSMRelation. Also see "isTypeAll" and "isTypeAny".
Ex:
// Assuming routeModels contain at least one item.
List<LatLon> highway = routeModels.get(0).getPath();
Note: OSM's XML file may not contain all the information about "Relation"s it provides. So "getPath()" method may throw NullPointerException for these relations.
FAQs
Open Street Map XML Parser written in Java
We found that net.mahmutkocas:osmparser demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 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.
Product
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
Product
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.
Product
Add secure dependency scanning to Claude Desktop with Socket MCP, a one-click extension that keeps your coding conversations safe from malicious packages.