Cartographic Label Placer

Cartographic Label Placer

Place names by priority and inspect text-box, exclusion-zone and viewport collisions.

1. Names and viewport

FeatureCollection with Point, LineString or Polygon in 2D longitude-latitude order. Each label needs a name and 0–100 priority; 10–28px fontSize is optional.

Viewport and text size

Priority 75+ adds 2px to the base size; priority 25 or below subtracts 2px. A feature fontSize overrides this policy. Changes require recalculation; no external map tile is used.

Comments & questions

Cartographic Label Placer

Give GeoJSON Point, LineString or Polygon features a name and importance. The placer measures text width and height in your browser, generates candidate positions and checks rotated text boxes against other labels, map boundaries and forbidden polygons. Higher-priority names go first; labels that cannot fit remain in an explicit rejection report. Coordinates stay in your browser.

Key features

  • Canvas TextMetrics measurements for Arial text and rotated-box collision detection
  • Eight point positions, readable line angles and interior polygon candidates
  • Rejects candidates crossing exclusion polygons, their holes or the map edge
  • Reports rejected names with reason counts and conflicting feature IDs
  • Local SVG map, position GeoJSON and JSON collision report downloads
  • WGS 84 longitude-latitude input; up to 64 labels, 16 forbidden zones and 1,200 coordinates

How to use

  1. Use properties.name and a 0–100 properties.priority for each label; mark forbidden Polygons with properties.kind=forbidden.
  2. Open the example or a GeoJSON file, then set west, south, east and north viewport bounds, pixel dimensions and base font size.
  3. Run placement and inspect the map, placed names, rejected reasons and approximate map scale.
  4. Download the SVG map, label-position GeoJSON and collision JSON report separately.

Use cases

  • Reduce city and station name overlap on a small map
  • Keep river names readable along line direction
  • Review names inside a park while excluding reserved areas
  • Audit failed label placements before printing

Frequently asked questions

Will every map label be placed?

No. This deterministic greedy placer fixes higher-priority labels first. When all candidates lie outside the map, in a forbidden zone or overlap another label, it reports the rejection. It does not promise a global optimum.

How are line and polygon names positioned?

Line names use segments longer than the measured text and rotate into a readable upright angle. Polygon names use interior candidates; the entire text box must fit inside the outer ring and outside holes.

How accurate is the scale?

Scale is approximate, using spherical distance at the viewport centre and 96 dpi. Placement projects lon/lat linearly onto a rectangle. Antimeridian crossings, polar regions, large extents and survey work are out of scope.

Can exported SVG text change in another viewer?

Yes. Placement measures Arial/sans-serif in this browser. Another SVG renderer may substitute a different font and change the shape, so review the final output environment.

Are files or coordinates sent to a server?

No. Editing, measuring text and creating downloads take place in this browser tab. No external map tiles are loaded.

Privacy

GeoJSON and coordinates are processed in this browser tab only. There is no server upload, external map tile or automatic storage.

References

Related Tools

GeoJSON Map EditorGeoJSON Topology AuditorImage WatermarkWasm Module InspectorHreflang Matrix CheckerAST Query PlaygroundContainer Build GraphDependency Graph ExplorerSemver Range LabCron Schedule AuditorPatch Review WorkbenchSource Map ExplorerLocalization Catalog AuditorStructured Data ReviewerHTTP Archive AnalyzerWebhook Signature LabProtobuf Schema WorkbenchGraphQL Schema LabAvro Schema EvolutionLocal SQL WorkbenchSchema Form BuilderMesh Repair WorkbenchPipe Network LabRobot Arm Kinematics LabThermal Network LabBeam Response LabGear Train DesignerTolerance Stackup LabSensor Calibration FitPCB Stackup PlannerDigital Filter DesignerNetwork Reachability MapSun Shadow MapGPS Error SimulatorDigital Logic SimulatorAnalog Circuit LabMechanism Linkage LabAnalysis Mesh GeneratorOpenAPI Contract InspectorDatabase Migration PlannerDimensional Equation CheckerTruss Force LabBoolean Minimization LabControl Response LabQueueing Simulation LabGeofence Event SimulatorCoordinate Reference LabSurvey Traverse LabRaster Classification LabChoropleth Design LabMap Print ComposerRaster Reprojection LabElevation Contour MakerTerrain Viewshed LabWatershed DelineatorMap Tile PackagerText File Encoding WorkbenchFilesystem Portability AuditorSBOM License ExplorerFile Signature Auditornpm Lockfile Conflict ResolverSource Secret AuditorOffline Web Package BuilderCertificate Chain InspectorTorrent Metainfo InspectorChunked File PackagerEncrypted File VaultDuplicate File FinderArchive WorkbenchDesign Token ManagerSpacing Token DesignerResponsive Type SystemPackaging Dieline DesignerSVG Icon Sprite PackerFlex Layout PlaygroundCSS Grid PlaygroundRegex Equivalence LabMarkdown Repository AuditorLog Template MinerResponsive Layout AuditorEmail Template PreviewInternal Link GraphState Machine TesterPetri Net SimulatorGit History VisualizerCurl Request WorkbenchBinary Protocol DesignerHex File EditorBinary Patch WorkbenchFile Signature WorkbenchAPI Mock SandboxSchema Column MapperEvent Log SessionizerER Diagram DesignerTime Series Gap AuditorStratified Data SplitterData Lineage DesignerDecision Tree LabData Anonymization WorkbenchData Expectation RunnerJSON Schema ValidatorBasket Pattern AnalyzerRobots Policy TesterSEO HTML AuditorAccessibility Structure AuditorSyndication Feed WorkbenchIndexNow Payload BuilderCrawl Log AnalyzerCSP Policy WorkbenchSearch Performance AnalyzerCSV Formula Risk AuditorCORS Response SimulatorCache Header LabCookie Policy InspectorWeb Vitals Trace LabSitemap Health AuditorBatch File RenamerFile Manifest VerifierFolder Space MapFolder Difference ReviewerRoute Order OptimizerPolygon Overlay LabSpatial Table JoinGPX Track AnalyzerTrack Privacy RedactorCSV Table JoinCSV Pivot WorkbenchScientific Data ProfilerTabular Cleaning WorkbenchRecord ReconciliationData Dictionary BuilderCanonical Graph AuditorRedirect Plan TesterHTTP response and ping reference testBrowser and System InformationJSON ↔ YAML ConverterXML ↔ JSON ConverterHTML FormatterJavaScript MinifierMock Data Generator.gitignore GeneratorLicense GeneratorUser-Agent ParserPassword Strength CheckerCode to ImageXML FormatterHTTP Status Code LookupMIME Type LookupJS & SQL String EscapeCSS Box Shadow GeneratorCSS Gradient GeneratorIndent ConverterNumber Base ConverterUnicode Escape ConverterUnicode InspectorJSON Structure DiffMarkdown Table GeneratorBase64 EncoderJSON FormatterURL EncoderSQL FormatterCron Expression GeneratorRegex TesterUUID GeneratorHash GeneratorTimestamp ConverterJWT DecoderHTML Entity ConverterMarkdown PreviewCSS MinifierMeta Tag GeneratorJSON ↔ CSVCase ConverterImage to Base64
Explore all Dev Tools tools →Image/Media →Text/Convert →Life/Fun →