Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

texttogeojson

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

texttogeojson

Convert text into geojson vector files

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

Text to GeoJSON

Convert Text to GeoJSON vector format

This glyphs of the characters are extracted and the glyph's coordinates are converted to spatial coordinates. That's it. Uses opentypes.js to read font files. Live demo app: https://sreekmtl.github.io/textToGeoJSON-demo/

Warning: Still in development

1. Usage

import textToGeoJSON from 'texttogeojson'

await textToGeoJSON(text, fontPath, anchorPoint, options).then(geojson=>{
//rest of the code
})

Arguments:

  • text : String to convert
  • fontPath : path to ttf/otf files
  • anchorPoint : [X, Y] Only supports EPSG:3857 (Web mercator projection) as of now
  • options : { textSize: Number, smoothness: Number (Number of points in a bezier curve) }

2. Warnings

I haven't tested all kinds of fonts yet. Right now it only reads M,L,Q, C and Z of glyph paths. Only tested with ttf and otf fonts yet.

3. Screenshots

alt text alt text alt text

Keywords

FAQs

Package last updated on 05 Oct 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc