GithubHelp home page GithubHelp logo

milgraphics's Introduction

Milgraphics

Military Tactical Graphics

This is a work in progress with the goal of being able to render tactical graphics in the web browser.

The library is still in initial development and should not be used in production environments. The goal is to release an initial version during the summer of 2017. What this initial version will include will be decided at a later stage.

Main idea

The main idea is to initially being able to convert input definition geometries to simple GeoJSON geometries.

Input

First data will be input in GeoJSON, at the moment the data will be defined with the same geometries as in 2525D, the data specification will be published as TacticalJSON.

The library includes a parser for SitaWare SLF/SPF files just to be able to get some test data from an external source.

Output

Points will be points with style information for different libraries (Cesium/OpenLayers etc.)

Lines will be lines, might have style information about simple label placement.

Polygons will be polygons, might have style information about simple label placement.

Other geometries (arrows and other complex geometries) will be converted to lines or polygons so that they can be displayed on a map and make sense.

The over all main idea is to keep it simple from the beginning and then move forward where it is needed.

Feedback

Please add issues for feedback and ideas

Technology

Milgraphics is built on top of milsymbol and adds functionality for reading tactical data in GeoJSON and outputting it in different ways that makes it easy to use in webmaps.

Contact

Milsymbol is created and maintained by Måns Beckman

Licensing

MIT, See license.txt for details

milgraphics's People

Contributors

kjellmf avatar spatialillusions avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

milgraphics's Issues

Add input format GeoJSON

This is the first thing that will be implemented. It will take GeoJSON as input and return GeoJSON to the main class, sort of something like that.

draw tactical symbol example

hello, @spatialillusions and @kjellmf

I have a question.
I'm using a normal 2D canvas(no 3D map, no cesium, no openLayers)
So I used the svg type.
However, some returned images were marked with a 'question mark' as shown below.
The function I used seems to be 'multipoint' returns a 'question mark'.
In short, can you tell me the function that I can draw for 'multipoint'? Or is there an example?

[The result I wanted]
Arrow
circle

[Reality]
image

[My Render Code]

let myTactical= ['GFT*I-----****X','GFT*N-----****X','GFT*D-----****X','G*T*F-----****X','G*T*AS----****X','G*T*E-----****X','G*T*O-----****X','G*T*Q-----****X', 'G*T*S-----****X','G*G*OAF---****X','G*T*B-----****X','G*T*H-----****X','G*T*Y-----****X','G*T*C-----****X','G*T*X-----****X','G*T*J-----****X','G*T*UC----****X']; 

--> (each symbolElement)

let renderedContent = new ms.Symbol(myTactical[symbolElement], { size: size, uniqueDesignation: element, additionalInformation: element, infoFields: "textInfo" }).asSVG();

ctx.beginPath();
ctx.drawImage(myTactical[symbolElement], x1, y1, x2 - x1, y2 - y1);
ctx.stroke();

Thank you...😒

Featured Tactical Graphics List

2525C
TACGRP.C2GM.SPL.LNE.AMB,
TACGRP.TSK.NEUT,
TACGRP.TSK.OCC,
TACGRP.C2GM.DEF.PNT.OBSPST.CBTPST,
TACGRP.FSUPP.PNT.TGT.PTGT,
TACGRP.FSUPP.PNT.C2PNT.FSS,
TACGRP.FSUPP.PNT.C2PNT.*
TACGRP.MOBSU.OBST.MNE.* (all mines)
TACGRP.TSK.* (All tasks)

Add input format SLF

Because it was an easy way to get access to some sample data I made a parser for SitaWare SLF files. Can't read all location types yet, but working on it and it works for all points, lines, and polygons. (And some mulitpoint symbols.)

Make geometry converters return label points

Geometry converters should return not just the converted geometry, but an object containing information about where labels should be placed on the geometry. It should support multiple labels.

Add simple canvas output

For test and display it would be nice to have an optional output that outputs a canvas image of the rendered geometry, this would make the rendering documents much nicer.

Keep original TacticalJSON anchor points

As an experiment I'm working on a simple Leaflet layer for milgraphics. One of the things I want to render is the anchor points that define the geometry of the graphics. Here's an example:
image

Unfortunately, the original anchor points are not available in the GraphicsLayer object because they are overwritten by the converted geometry:(https://github.com/spatialillusions/milgraphics/blob/master/src/graphicslayer.js#L8)

  feature.graphic = new ms.Graphic(feature);
  feature.geometry = feature.graphic.geometry;

Maybe you could keep the original anchor points in feature.geometry and instead use feature.graphic.geometry in asOpenLayers and asCesium? Another option is to create a copy of the anchor points and store them as an attribute on the feature object. An advantage of the current approach is that it is simple to render the converted graphic in an arbitrary GeoJson render.

Add Weapon/Sensor Range Fan

As an experiment I have created two new javascript files to create both Weapon/Sensor Range Fan Circular and Weapon/Sensor Range Fan Sector with an appropriate weapon symbol at the anchor point.

Here are the results of my experiment:
Circular:
image

Sector:
image
I am totally new to Github, so please advise as to how I can propose adding the new files and the files that I have modified to expose the new functionality?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.