All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 190 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7, 8  Next
Author Message
 Post subject: Re: Some custom SVG plane icons...
PostPosted: Tue Oct 18, 2016 3:36 pm 
Offline
FlightAware Member
FlyingPeteNZ - FlightAware user avatar

Joined: Thu Aug 04, 2016 10:47 pm
Posts: 157
Location: Auckland, New Zealand
MikeMathee wrote:
IAUCKLAN63 wrote:
I have applied this one to ZK-KFB...


I like this!
How do you apply an icon to a specific aircraft?


I have made my own JSON database based on the scripts in the Mutability tools folder, that DB correlates ICAO addresses with aircraft type and registration, not hard to invent a new type of aircraft and associate it with a different graphic in the markers.js file :)

Here is the except in the JSON DB from the C8.json file:

"20E1":{"r":"ZK-JRR","t":"GA8"},"20E2":{"r":"ZK-BLD","t":"C172"},"20E3":{"r":"ZK-MFS","t":"GLID"},"20E4":{"r":"ZK-ISO","t":"H500"},"20E5":{"r":"ZK-KFB","t":"SMAG"},"20E8":{"r":"ZK-RAG","t":"COY2"},"20E9":{"r":"ZK-ABC","t":"RYST"},"20EA":{"r":"ZK-DAE","t":"DA40"},"20EB":{"r":"ZK-JLB","t":"PA18"}...

And the markers.js file:
// Small Jets
'GLF5': _glex, // close enough
'GL5T': _glex,
'GLF6': _glex,
'GLEX': _glex,
'G550': _glex,
'CL50': _glex,
'CL60': _glex,
'C10T': _glex,
'C510': _glex,
'C25C': _glex,
'C550': _glex,
'FA7X': _glex,
'F900': _glex,
'SMAG': _smaug,


Top
 Profile  
 
 Post subject: Re: Some custom SVG plane icons...
PostPosted: Tue Oct 18, 2016 9:23 pm 
Offline
FlightAware Member
MikeMathee - FlightAware user avatar

Joined: Sun Sep 11, 2016 12:35 pm
Posts: 50
IAUCKLAN63 wrote:
I have made my own JSON database...

Thank you I'm going to try this, although it does not look as easy as I'd hope it to be.


Top
 Profile  
 
 Post subject: Re: Some custom SVG plane icons...
PostPosted: Wed Oct 19, 2016 2:10 pm 
Offline
FlightAware Member
FlyingPeteNZ - FlightAware user avatar

Joined: Thu Aug 04, 2016 10:47 pm
Posts: 157
Location: Auckland, New Zealand
MikeMathee wrote:
IAUCKLAN63 wrote:
I have made my own JSON database...

Thank you I'm going to try this, although it does not look as easy as I'd hope it to be.


It's not too bad, there is a sample CSV file there, just need to follow that format. Then running the command pretty easy on PiAware:

sudo python csv-to-json.py vrs.csv db

Where DB above is the output directory, I just do this in my home then delete the DB directory contents in the HTML directory then copy the new one in its place. Best to start a new browser in private mode as the cache on that DB in internet browsers is pretty sticky.


Top
 Profile  
 
 Post subject: Re: Some custom SVG plane icons...
PostPosted: Thu Oct 20, 2016 4:27 pm 
Offline
FlightAware Member
MikeMathee - FlightAware user avatar

Joined: Sun Sep 11, 2016 12:35 pm
Posts: 50
IAUCKLAN63 wrote:
It's not too bad...


Success! :D

Got it working on a test aircraft, now I can start my own DB of local aircraft that frequent reception area with the correct aircraft icon applied to them.

Thank you very much!


Top
 Profile  
 
 Post subject: Re: Some custom SVG plane icons...
PostPosted: Thu Oct 20, 2016 6:59 pm 
Offline
FlightAware Member
FlyingPeteNZ - FlightAware user avatar

Joined: Thu Aug 04, 2016 10:47 pm
Posts: 157
Location: Auckland, New Zealand
MikeMathee wrote:
IAUCKLAN63 wrote:
It's not too bad...


Success! :D

Got it working on a test aircraft, now I can start my own DB of local aircraft that frequent reception area with the correct aircraft icon applied to them.

Thank you very much!


Excellent!

I run a command on my pi collecting info on aircraft spotted, it is listing to port 30005 and filtering an output to a text file, it has been a process of refinement as initially I dumped everything to a text file but there are a lot of regulars around here I don't need.

To start with I used the following command:
sudo wget -O - -q http://172.16.30.202:30003 | egrep --line-buffered 'MSG,1' >> new.txt
172.16.30.202 is the local IP of my PI, this dumps message 1 which includes identification information but no MLAT stuff, message 6 seems to be good at getting everything.

Once I got a good DB going I added a filter for regularly seen aircraft:

sudo wget -O - -q http://172.16.30.202:30003 | egrep --line-buffered 'MSG,6' | grep 'C8' | grep -Ev 'C818C9|C818DA|C818DB|C81958|C81959|C8195A|C8195B|C8195C|C819DC|C819DD|C819DE|C819DF|C819E0|C81A5A|C81A5B|C81A90|C81A91|C81A92|C81AC0|C81B24|C81BB3|
C81C9E|C81C9F|C80EA9|C80FAA|C8101F|C81239|C8169D|C8169E|C8169F|C816BF|C816DC|C816DD|C81708|C8178B|C8178C|C81845|C8186E|C8187E|C8187F|C81880|C81881|
C81882|C81883|C81884|C81885|C818F2|C818FE|C81D7E|C81D80|C81D82|C81D8E|C81D9D|C81E05|C81E22|C81E27|C81E2C|C82081|C82089|C820B6|C820CE|C820CF|C820D1|
C820D2|C820D4|C820F2|C820F4|C8210D|C8215F|C8216E|C821C1|C821EE|C8221A|C82258|C82268|C82269|C822E4|C82347|C8234F|C8143E|C8143F|C81440|C81441|C81463|
C81464|C81465|C814BB|C815E3|C8163C|C81816|C82009|C8200A|C8200B|C820AB|C821BA|C821F8|C82284|C822EC|C822ED|C82315|C82335|C82336|C82349|C82379|C8237A|
C81CF6|C81CF7|C81CF8|C81DD5|C81DD6|C81DD7|C81DF4|C81DF5|C87F04|C87F05|C87F06|C87F07|C87F09|C87F0B|C87F1D|C87F1E|C87F1F|C81306|C81871|C81BEA|C88003
C88004|C88006|C88007|C88019|C8801A|C8806A|C8806F|C87EE0|C822AF|C822C6|C81415|C81E1C|C82226|C822E9|C822EA|C82337|C82396|C81BEA|C81E45|C87F00|C87F01|
C87F02|C87F04|C87F05|C87F06|C87F07|C87F09|C87F0B' >> new.txt

If you build the above in a text editor and paste the command it's not too bad, I get the list of knowns as an extract from an Excel SS.

I pull the text file every few days and add the new aircraft to my DB.


Top
 Profile  
 
 Post subject: Re: Some custom SVG plane icons...
PostPosted: Fri Oct 21, 2016 12:42 am 
Offline
FlightAware Member
MikeMathee - FlightAware user avatar

Joined: Sun Sep 11, 2016 12:35 pm
Posts: 50
IAUCKLAN63 wrote:
Excellent!
I run a command on my pi collecting info on aircraft spotted...


This great!

I've been wondering I could catch the aircraft in my area since I can't watch the screen 24/7.

I'm going to give this a try!


Top
 Profile  
 
 Post subject: Re: Some custom SVG plane icons...
PostPosted: Tue Oct 25, 2016 3:18 am 
Offline
FlightAware Member
MikeMathee - FlightAware user avatar

Joined: Sun Sep 11, 2016 12:35 pm
Posts: 50
FlyingPeteNZ wrote:
If you build the above in a text editor and paste the command it's not too bad, I get the list of knowns as an extract from an Excel SS.
I pull the text file every few days and add the new aircraft to my DB.

I've managed to get your commands running.
Busy building a db for my local aircraft, don't get much traffic so it's not too much effort.

Could I ask a custom icon?
I'm receiving what I can only think of as a beacon, it's transmitting from the ground on top of a hill right in the approach to our local airport.
I would like to put a "beacon" icon on the map.
Have been thinking of something along the line of the below image on the left with the rings of the right hand image.

Image


Top
 Profile  
 
 Post subject: Re: Some custom SVG plane icons...
PostPosted: Wed Oct 26, 2016 2:18 pm 
Offline
FlightAware Member
MikeMathee - FlightAware user avatar

Joined: Sun Sep 11, 2016 12:35 pm
Posts: 50
FlyingPeteNZ wrote:
"Hey dad, why do they all have to look like airplanes? Can you make them anything?"

Sure :D
...
I have applied this one to ZK-KFB...

Temporarily applied it to B734's, caught one flying by just now :lol:

Image


Top
 Profile  
 
 Post subject: Re: Some custom SVG plane icons...
PostPosted: Wed Oct 26, 2016 4:38 pm 
Offline
FlightAware Member
FlyingPeteNZ - FlightAware user avatar

Joined: Thu Aug 04, 2016 10:47 pm
Posts: 157
Location: Auckland, New Zealand
MikeMathee wrote:
FlyingPeteNZ wrote:
If you build the above in a text editor and paste the command it's not too bad, I get the list of knowns as an extract from an Excel SS.
I pull the text file every few days and add the new aircraft to my DB.

I've managed to get your commands running.
Busy building a db for my local aircraft, don't get much traffic so it's not too much effort.

Could I ask a custom icon?
I'm receiving what I can only think of as a beacon, it's transmitting from the ground on top of a hill right in the approach to our local airport.
I would like to put a "beacon" icon on the map.
Have been thinking of something along the line of the below image on the left with the rings of the right hand image.

Image


Sure can do... I am cleaning up most to the others at the moment, sorting scaling issues etc but should sort this over weekend.


Top
 Profile  
 
 Post subject: Some custom SVG plane icons...
PostPosted: Thu Oct 27, 2016 1:25 am 
Offline
FlightAware Member
MikeMathee - FlightAware user avatar

Joined: Sun Sep 11, 2016 12:35 pm
Posts: 50
FlyingPeteNZ wrote:
Sure can do... I am cleaning up most to the others at the moment, sorting scaling issues etc but should sort this over weekend.

Much appreciated!


Top
 Profile  
 
 Post subject: Re: Some custom SVG plane icons...
PostPosted: Thu Oct 27, 2016 6:33 pm 
Offline
FlightAware Member
FlyingPeteNZ - FlightAware user avatar

Joined: Thu Aug 04, 2016 10:47 pm
Posts: 157
Location: Auckland, New Zealand
rparenton wrote:

The A350 will also need an icon as it becomes more prevalent. ICAO types:

  • A358
  • A359
  • A35K


That just became worthwhile, spotted my first A350-900 this morning :)


Top
 Profile  
 
 Post subject: Re: Some custom SVG plane icons...
PostPosted: Sat Oct 29, 2016 3:34 am 
Offline
FlightAware Member
Radiostationx - FlightAware user avatar

Joined: Mon Nov 24, 2014 2:52 pm
Posts: 180
Hi,
Read 6 pages of posts on this, seems some users are having issues.
Are these ironed out ?

Does this fix the issue I have of the b777 and a380 scale icons are too large in stock 1090mutab, especially when zooming out of map ?

If so, Can someone write a simplified guide on how to install the icons onto stock 1090 mutability please.

Thanks.


Top
 Profile  
 
 Post subject: Re: Some custom SVG plane icons...
PostPosted: Mon Oct 31, 2016 3:02 pm 
Offline
FlightAware Member
FlyingPeteNZ - FlightAware user avatar

Joined: Thu Aug 04, 2016 10:47 pm
Posts: 157
Location: Auckland, New Zealand
Radiostationx wrote:
Hi,
Read 6 pages of posts on this, seems some users are having issues.
Are these ironed out ?

Does this fix the issue I have of the b777 and a380 scale icons are too large in stock 1090mutab, especially when zooming out of map ?

If so, Can someone write a simplified guide on how to install the icons onto stock 1090 mutability please.

Thanks.


There was no conclusion really on scaling, if you to use a mix of the icons I have shared with the stock ones I suggest halving the scale on mine.

On a guide to adding icons, that is a good point.

I have been working on cleaning up all of the ones I have put here, might be able to sort a guide once that is done.

Working on the following tweaks:
- New scaling system so the sizes are all closer together
- Cleaning up the SVG paths, some are a mix of relative and absolute SVG paths, moving these to a single relative path
- Making sure the graphics are correctly centred on the 64x64 grid at the same time I am ensuring centring is correct (some were off centre
- Noting down tail location so it can be used as an anchor point, also with the above centring using 32,32 as anchor point should always work well
- Making sure the start of the path is the nose of the aircraft, this with the move to relative paths helps with repositioning if required

Oh and plugging gaps in body types, adding shorter and longer variants of most of airliners.

All this then 747-8s turn up in the skies over here, I don't have a graphic for that yet!

Must also do that beacon...


Top
 Profile  
 
 Post subject: Re: Some custom SVG plane icons...
PostPosted: Mon Oct 31, 2016 6:50 pm 
Offline
FlightAware Member
FlyingPeteNZ - FlightAware user avatar

Joined: Thu Aug 04, 2016 10:47 pm
Posts: 157
Location: Auckland, New Zealand
OK here is my first attempt to write up a guide on using the custom graphics:

Intro
To utilise the custom aircraft graphics you need three things:
- A database mapping the unique ICAO24 address to the ICAO Aircraft Code (Aircraft Type Designator)
- A customised markers.js file with the new graphics
- PiAware 3.1.0 or equivalent mutability release

Neither of these are major drama but you really need both to get the best result.

Database
The latest versions of dump1090 found in PiAware 3.1.0 and mutability both have code to look up aircraft types in one of three ways:
- Lookup the ICAO24 address in a local JSON-based database
- Use a basic aircraft type lookup (L1P, L2T etc…)
- Use the aircraft category (A1. A2 etc…)

Failing all the above a generic icon will be mapped.

There is a JSON DB included by default but it is not being maintained and for me lacked most of the local aircraft.

For the best results I build my own JSON DB (it’s not as hard as it sounds!), this has the advantage that it has most of the local aircraft in it and regular visitors to this part of the world. I was able to get a reasonably recent copy of the local register that had ICAO24s and aircraft types in it, this was a great starting point for me.

To build your own DB you need a correctly formatted CSV file with the ICAO24 to type mappings and the csv-to-json.py python script. This can be found in the tools directory in the mutability releases (not included in PiAware 3.1.0), there is also an example CSV (vrs.csv, you could add to this or replace entirely) in that directory too.
The CSV is formatted like this (you need the header icao24,r,t for the script to work):

icao24,r,t
3A21ED,F-OIPN,AT73
3A24C5,F-OJGF,A343
3A2641,F-OJSB,A320
3A266D,F-OJTN,A343
3A2DD5,F-OLOV,A343


So format is [ICAO24 address],[registration],[ICAO Aircraft Type Designator]
You can leave registration blank as the graphics will still work however registration info can be displayed in the Dump1090 web viewer.

Once you have a CSV file sorted you just need to run the python script to generate a JSON DB from it.

You can run this on your Pi (I know PiAware 3.1.0 has Python, individual mileage may vary on custom builds), or as I now do I my Windows PC.

To run on your Pi put the script and the cvs and an empty directory called db into a directory on your Pi and run the following command:

sudo python csv-to-json.py vrs.csv db

Where vrs.csv is your csv file and db is the output directory, if it worked you should get a response like this:

Read 5611 aircraft
Writing blocks: 0 1 2 3 4 5 6 7 8 9 A B C D E F C8 C80 C81 C801 C802 C803 C804 C808 C817 C818 C819 C81A C81B C81C C81D C81E done.
Wrote 32 blocks


If you look in the db directory there should be a number of .json files. To use this database just copy it over the top of the existing db directory in the html folder of Dump1090 (/usr/share/dump1090-fa/html on PiAware 3.1.0)

As mentioned in earlier this script also runs fine on my Windows PC, you just need to download Python 2.7 (tried 3.5 as well but the script won’t run in that version).

Now this is a very important step to test the new database, this database caches and a simple refresh of your browser won’t load the new DB, no amount of force refreshing seems to work either so you either need to clear your browser cache or if you use Chrome load it in Incognito as it shouldn’t cache it (I say shouldn’t but you should close and restart the Incognito sessions between DB updates as it seems to hold he DB in RAM).

So that’s the DB. I am using Excel for my source copy, got a few local NZ guys around here also “subscribing” to my DB.

Adding graphics
In order to use custom graphics you need to add them to the markers.js file in the dump1090 html (public_html in the mutability version) directory.

You can SSH on to your Pi and use Nano, or a much easier way is to use a SCP tool (such as WinSCP) to copy the file to your PC to edit it and copy it back when done (much easier and you can easily make backups of it to for those time when you do break it!)

You need to be careful with what you put in this file as a slight typo will often break it which results in a map with no planes on it, there are no useful error messages when this happens so you need to find the bug or revert to a backup. I’ll cover my common errors that break things further down.

Two things are required to use the custom graphics, first you need to insert the SVG data into the markers.js file, this is the bit that looks like this:
//A320 - Standard Scale 0.66 Meters/point
var _a320 = {
key: "a320",
scale: 0.66,
size: [64, 64],
anchor: [32, 32],
path: "m 32,1.8 0.4,0.1 0.4,0.4 0.7,1.1 0.7,1.4 0.4,1.3 0.3,1.4 0.1,1.2 0,11.6 0.3,0.8 0.3,0.3 3.7,1.9 -0.2,-1.2 0,-1.5 0.1,-1.2 0.2,-0.4 2.4,0 0.2,0.4 0.1,1.2 0,1.5 -0.3,2 -0.2,0 0,0.4 15.7,8.1 0.3,0.2 0.2,0.2 0.1,0.3 0,2.5 -0.2,0 0,-0.8 -7.5,-2.2 -0.1,0.5 -0.1,0.4 -0.1,0.2 -0.1,-0.2 -0.1,-0.4 -0.1,-0.7 -4.8,-1.4 -0.1,0.5 -0.1,0.4 -0.1,0.2 -0.1,-0.2 -0.1,-0.4 -0.1,-0.7 -2.3,-0.7 -1.1,0 -0.1,0.4 -0.1,0.2 -0.1,-0.2 -0.1,-0.4 -0.8,0 -0.1,0.7 -0.1,0.4 -0.1,0.2 -0.1,-0.2 -0.1,-0.4 -0.1,-0.7 -4,0 0,11.6 -0.1,2.9 -0.3,2 -0.3,1.7 -0.4,1.7 0.1,0.4 0.4,0.4 6.8,4.5 0.1,0.1 0.1,0.3 0,1.6 -8.2,-1.9 -0.3,1.3 -0.3,0.9 -0.2,0.7 0,0.3 -0.8,0 0,-0.3 -0.2,-0.7 -0.3,-0.9 -0.3,-1.3 -8.2,1.9 0,-1.6 0.1,-0.3 0.1,-0.1 6.8,-4.5 0.4,-0.4 0.1,-0.4 -0.4,-1.7 -0.3,-1.7 -0.3,-2 -0.1,-2.9 0,-11.6 -4,0 -0.1,0.7 -0.1,0.4 -0.1,0.2 -0.1,-0.2 -0.1,-0.4 -0.1,-0.7 -0.8,0 -0.1,0.4 -0.1,0.2 -0.1,-0.2 -0.1,-0.4 -1.1,0 -2.3,0.7 -0.1,0.7 -0.1,0.4 -0.1,0.2 -0.1,-0.2 -0.1,-0.4 -0.1,-0.5 -4.8,1.4 -0.1,0.7 -0.1,0.4 -0.1,0.2 -0.1,-0.2 -0.1,-0.4 -0.1,-0.5 -7.5,2.2 0,0.8 -0.2,0 0,-2.5 0.1,-0.3 0.2,-0.2 0.3,-0.2 15.7,-8.1 0,-0.4 -0.2,0 -0.3,-2 0,-1.5 0.1,-1.2 0.2,-0.4 2.4,0 0.2,0.4 0.1,1.2 0,1.5 -0.2,1.2 3.7,-1.9 0.3,-0.3 0.3,-0.8 0,-11.6 0.1,-1.2 0.3,-1.4 0.4,-1.3 0.7,-1.4 0.7,-1.1 0.4,-0.4 z"};


On the default file these should go after line 65 where there is a comment referencing this thread :D

A note on scaling:
I came up with a standard scaling system for the graphics I have done, this means that the drawn graphics are all correctly scaled to each other pretty much within 5% (most within 1%), This is meters per point, it is calculated using the real dimensions of the aircraft and the dimensions of the SVG image measured in points, for example:

The above A320 has a wingspan of 34.1 meters (I’m metric here) and is 37.57 meters long, the SVG graphic is 51.8 points wide by 56.7 points tall with some Excel magic (Average of real wingspan/SVG width and real length/ SVG height) I get a scale of 0.66 meters per point.

This scaling system results in graphics which are pretty much twice the size they should be when used with the default graphics, if you are using both I suggest you halve the scale, so the A320 will go from 0.66 to 0.33.

If using he above, I would make the helicopters double size too.

The next issue with scaling that this system is linear and a Cessna 172 and an Airbus A380 are slightly different in size, so as if your map is like mine and you have lots of types of aircraft of all sizes buzzing around you will get nice looking large aircraft and tiny small aircraft or oversized large aircraft if you want detail of the smaller ones. I am working on a non-linear scale for this where the C172 is still smaller than a A380 but not as much as real life.

Enough on scaling.

The next thing you need to get your graphic working is to map the ICAO aircraft type designator as looked up in the JSON to the correct SVG graphic, this is done in the following section of the markers.js file (after line 142 in the default file):
var TypeIcons = {
'A318': _a320, // shortened a320
'A319': _a320, // shortened a320
'A320': _a320,
'A321': _a320, // stretched a320

'A388': _a380,

// dubious since these are old-generation 737s
// but the shape is similar
'B731': _b738,
'B732': _b738,
'B733': _b738,
'B734': _b738,
'B735': _b738,...


The DB lookup id the first variable in the single quotes, and the SVG graphic is the second variable in with the underscore. Fairly straight forward. You seem to be able to add as many as you want, however the trick to make sure it works is the last one must not have a comma after it!

And that should be it, you should have pretty graphics now.

A quick note on what can go wrong with the markers.js file, if the web page loads with no planes then check the following:
- All the brackets, commas and semicolons are where they should be, there are enough working examples of this in the default file to reference what is correct, and don’t forget the comma issue noted above
- The SVG path referenced in the TypeIcon section doesn’t exist (usually typo)

There you go, hope that makes sense, have fun!


Top
 Profile  
 
 Post subject: Re: Some custom SVG plane icons...
PostPosted: Thu Nov 03, 2016 1:20 pm 
Offline
FlightAware Member
MikeMathee - FlightAware user avatar

Joined: Sun Sep 11, 2016 12:35 pm
Posts: 50
Is there an existing aircraft icon that would suit the BAE AVRO RJ-85 if scaled?
We have a few of them around here.
If not, could it be put on the "to do" list?


Top
 Profile  
 
 Post subject: Re: Some custom SVG plane icons...
PostPosted: Thu Nov 03, 2016 3:47 pm 
Offline
FlightAware Member
FlyingPeteNZ - FlightAware user avatar

Joined: Thu Aug 04, 2016 10:47 pm
Posts: 157
Location: Auckland, New Zealand
MikeMathee wrote:
Is there an existing aircraft icon that would suit the BAE AVRO RJ-85 if scaled?
We have a few of them around here.
If not, could it be put on the "to do" list?


Ah what they called the "Whisper Jet" down this way, there was a fleet of them, they called them that as the other major national airline had a fleet of very rowdy 737-100's that they ended up fitting hush kits to.

I had another small quad jet pop up the other day here too, couldn't find anything suitable so will add it to the list... (list not too long at the moment and I have the weekend off this time :))


Top
 Profile  
 
 Post subject: Re: Some custom SVG plane icons...
PostPosted: Fri Nov 04, 2016 3:38 am 
Offline
FlightAware Member
triggers - FlightAware user avatar

Joined: Sun Dec 21, 2014 2:37 pm
Posts: 248
Location: Oxfordshire, UK
Can the mods make this a sticky? There is so much good information in here.

Thanks


Top
 Profile  
 
 Post subject: Re: Some custom SVG plane icons...
PostPosted: Sat Nov 05, 2016 7:38 pm 
Offline
FlightAware Member
FlyingPeteNZ - FlightAware user avatar

Joined: Thu Aug 04, 2016 10:47 pm
Posts: 157
Location: Auckland, New Zealand
MikeMathee wrote:
FlyingPeteNZ wrote:
If you build the above in a text editor and paste the command it's not too bad, I get the list of knowns as an extract from an Excel SS.
I pull the text file every few days and add the new aircraft to my DB.

I've managed to get your commands running.
Busy building a db for my local aircraft, don't get much traffic so it's not too much effort.

Could I ask a custom icon?
I'm receiving what I can only think of as a beacon, it's transmitting from the ground on top of a hill right in the approach to our local airport.
I would like to put a "beacon" icon on the map.
Have been thinking of something along the line of the below image on the left with the rings of the right hand image.

Image


Here you go, took me a while as I needed to test some stuff, this was the first graphic I have tried with multiple objects, all the others are a single line with slight of hand to do complex stuff (like rotor blades and helicopter skids), will rework these now with new technique.

Also the image of the graphic below has actually been flipped but does draw correctly in PiAware (have tested), not sure about scale so kicked off at 1.00, set using the balloon's extra parameters so it doesn't rotate.

//Beacon - Standard Scale 1.0 Meters/point
Image
var _beacon = {
key: "beacon",
scale: 1.0,
size: [64, 64],
anchor: [32, 32],
path: "m 43,23.4 -0.2,1.8 -0.6,1.8 -0.8,1.5 -0.9,1.3 -1.6,-1.2 0.8,-1.1 0.7,-1.3 0.4,-1.3 0.3,-1.5 0,-1.7 -0.3,-1.5 -0.4,-1.3 -0.7,-1.3 -0.8,-1.1 1.6,-1.2 0.9,1.3 0.8,1.5 0.6,1.8 0.2,1.8 z m 6,0.5 -0.4,2.7 -0.9,2.7 -1.2,2.3 -1.2,1.8 -1.6,-1.2 1.3,-1.9 0.9,-1.8 0.8,-2.3 0.3,-2.4 0,-2.6 -0.3,-2.4 -0.8,-2.3 -0.9,-1.8 -1.3,-1.9 1.6,-1.2 1.2,1.8 1.2,2.3 0.9,2.7 0.4,2.7 z m 5.9,0.6 -0.4,3.6 -1.1,3.4 -1.5,3.3 -1.6,2.3 -1.6,-1.2 1.5,-2.1 1.4,-3 0.9,-3.2 0.4,-3.2 0,-3.8 -0.4,-3.2 -0.9,-3.2 -1.4,-3 -1.5,-2.1 1.6,-1.2 1.6,2.3 1.5,3.3 1.1,3.4 0.4,3.6 z m -24.4,7.1 -8.3,22 -0.2,0.7 0.5,0.6 2.7,0.7 4.2,0.5 5.2,0 4.2,-0.5 2.7,-0.7 0.5,-0.6 -0.2,-0.7 -8.3,-22 -0.4,-0.7 -0.4,-0.4 -0.7,-0.2 -0.7,0.2 -0.4,0.4 z m 1.5,-5.2 -1.2,-0.2 -1.1,-0.5 -0.9,-0.9 -0.5,-1.1 -0.2,-1.2 0.2,-1.2 0.5,-1.1 0.9,-0.9 1.1,-0.5 1.2,-0.2 1.2,0.2 1.1,0.5 0.9,0.9 0.5,1.1 0.2,1.2 -0.2,1.2 -0.5,1.1 -0.9,0.9 -1.1,0.5 z m -11,-3 0.2,1.8 0.6,1.8 0.8,1.5 0.9,1.3 1.6,-1.2 -0.8,-1.1 -0.7,-1.3 -0.4,-1.3 -0.3,-1.5 0,-1.7 0.3,-1.5 0.4,-1.3 0.7,-1.3 0.8,-1.1 -1.6,-1.2 -0.9,1.3 -0.8,1.5 -0.6,1.8 -0.2,1.8 z m -6,0.5 0.4,2.7 0.9,2.7 1.2,2.3 1.2,1.8 1.6,-1.2 -1.3,-1.9 -0.9,-1.8 -0.8,-2.3 -0.3,-2.4 0,-2.6 0.3,-2.4 0.8,-2.3 0.9,-1.8 1.3,-1.9 -1.6,-1.2 -1.2,1.8 -1.2,2.3 -0.9,2.7 -0.4,2.7 z m -5.9,0.6 0.4,3.6 1.1,3.4 1.5,3.3 1.6,2.3 1.6,-1.2 -1.5,-2.1 -1.4,-3 -0.9,-3.2 -0.4,-3.2 0,-3.8 0.4,-3.2 0.9,-3.2 1.4,-3 1.5,-2.1 -1.6,-1.2 -1.6,2.3 -1.5,3.3 -1.1,3.4 -0.4,3.6 z",
noRotate: true,
markerRadius: 32};


Top
 Profile  
 
 Post subject: Re: Some custom SVG plane icons...
PostPosted: Sat Nov 05, 2016 7:50 pm 
Offline
FlightAware Member
FlyingPeteNZ - FlightAware user avatar

Joined: Thu Aug 04, 2016 10:47 pm
Posts: 157
Location: Auckland, New Zealand
And here is that 747-8 that was missing from the set (I am filling the Boeing and Airbus size gaps at the moment).

A couple of new things to note here, these is one of my graphics with an optimised relative position only path, it has been centred on the 64x64 grid and the anchor point set at the middle (32x32), there is also a note in the code about tail position, this is if you want the track to originate from the tail instead of the middle, in this case the anchor would be set to 32,63.

Last thing here is on scaling, two new scale options noted in the code, my "standard" meters/point, a PiAware default, which means this graphic should scale well to the default PiAware icons, the last one is a new thing I have been working on, that is the 3in4 Non-linear scale, this one only really works if all graphics use it, it makes the smaller graphics bigger so there is not the extreme size difference of the standard linear scales. All my graphics will have this moving forward.

//747-8 - Standard Scale 1.21 Meters/point, PiAware Default Scale 0.60, 3in4 Non-linear Scale 0.96
Image
var _b748 = {
key: "b748",
scale: 0.60,
size: [64, 64],
anchor: [32, 32], //Tail position 63
path: "m 32,0.1 0.1,0 0.2,0.1 0.2,0.2 0.3,0.4 0.4,0.9 0.5,1.6 0.5,2.4 0.3,2.3 0.2,2.8 0,9.6 0.9,0.7 5.1,4.8 -0.2,-0.9 0,-1.2 0.1,-1.1 0.2,-0.2 2.3,0 0.2,0.2 0.1,1.1 0,1.2 -0.2,2 -0.1,-0.3 -0.1,0.3 -0.2,-0.3 -0.2,0.9 5.5,5.1 -0.1,-0.7 0,-1.2 0.1,-1.1 0.2,-0.2 2.3,0 0.2,0.2 0.1,1.1 0,1.2 -0.2,2 -0.1,-0.3 -0.1,0.3 -0.2,-0.3 -0.1,0.9 7.6,6.3 1,1.3 0.8,1.3 0.7,1.5 0,0.7 -2.1,-1.6 -10.8,-6.2 0,0.5 -0.1,0.5 -0.3,-0.5 -0.1,-0.7 -2.4,-1.4 0,0.4 -0.1,0.5 -0.3,-0.5 -0.1,-0.7 -0.8,-0.4 -3.6,-1.7 0,0.5 -0.1,0.5 -0.3,-0.5 -0.1,-0.7 -1.8,-0.5 0,0.5 -0.1,0.5 -0.3,-0.5 -0.1,-0.7 -2.1,-0.6 0,13.3 -0.3,3.8 -0.2,1.6 -0.4,1.9 0.2,0.4 6.8,6.6 0.2,0.3 0.1,0.3 0,1.8 -8.5,-2.5 -0.5,1.6 0,1.4 -0.1,0.1 -0.1,-0.1 0,-1.4 -0.5,-1.6 -8.5,2.5 0,-1.8 0.1,-0.3 0.2,-0.3 6.8,-6.6 0.2,-0.4 -0.4,-1.9 -0.2,-1.6 -0.3,-3.8 0,-13.3 -2.1,0.6 -0.1,0.7 -0.3,0.5 -0.1,-0.5 0,-0.5 -1.8,0.5 -0.1,0.7 -0.3,0.5 -0.1,-0.5 0,-0.5 -3.6,1.7 -0.8,0.4 -0.1,0.7 -0.3,0.5 -0.1,-0.5 0,-0.4 -2.4,1.4 -0.1,0.7 -0.3,0.5 -0.1,-0.5 0,-0.5 -10.8,6.2 -2.1,1.6 0,-0.7 0.7,-1.5 0.8,-1.3 1,-1.3 7.7,-6.4 -0.2,-0.8 -0.2,0.3 -0.1,-0.3 -0.1,0.3 -0.2,-2 0,-1.2 0.1,-1.1 0.2,-0.2 2.3,0 0.2,0.2 0.1,1.1 0,1.2 -0.1,0.7 5.5,-5.1 -0.2,-0.9 -0.2,0.3 -0.1,-0.3 -0.1,0.3 -0.2,-2 0,-1.2 0.1,-1.1 0.2,-0.2 2.3,0 0.2,0.2 0.1,1.1 0,1.2 -0.2,0.9 5.1,-4.8 0.9,-0.7 0,-9.6 0.2,-2.8 0.3,-2.3 0.5,-2.4 0.5,-1.6 0.4,-0.9 0.3,-0.4 0.2,-0.2 0.2,-0.1 z"};


Top
 Profile  
 
 Post subject: Re: Some custom SVG plane icons...
PostPosted: Sat Nov 05, 2016 8:01 pm 
Offline
FlightAware Member
FlyingPeteNZ - FlightAware user avatar

Joined: Thu Aug 04, 2016 10:47 pm
Posts: 157
Location: Auckland, New Zealand
MikeMathee wrote:
Is there an existing aircraft icon that would suit the BAE AVRO RJ-85 if scaled?
We have a few of them around here.
If not, could it be put on the "to do" list?


This one was another fun one, ended up studying up of BAe 146/Avro planes, in the end I have assumed the following:
BAe 146-100=Avro RJ70
BAe 146-200=Avro RJ85
BAe 146-300=Avro RJ100

I think the result is probably close enough, there seems to be a huge discrepancy in the graphics out there representing them, finding a single source of truth is challenging.

Anyway here you go, full set:
//BAe
Image
//BAe 146-100/Avro RJ70 - Standard Scale 0.50 Meters/point, PiAware Default Scale 0.25, 3in4 Non-linear Scale 0.55

var _r461 = {
key: "r461",
scale: 0.55,
size: [64, 64],
anchor: [32, 32], //Tail position 57
path: "m 32,6.2 0.5,0.4 0.5,0.8 0.7,1.4 0.8,2.1 0.6,1.9 0.4,2.5 0.1,5.1 0,3.3 3.1,1 -0.2,-1.1 0,-2.1 0.1,-0.7 0.2,-0.2 2.4,0 0.2,0.2 0.1,0.7 0,2.1 -0.2,1.7 -0.9,0 3.5,1.1 -0.2,-1.1 0,-2.1 0.2,-0.7 0.2,-0.2 2.2,0 0.2,0.2 0.2,0.7 0,2.1 -0.2,1.7 -0.9,0 11.6,3.9 0.5,0.3 0.3,0.6 0,2.1 -7.2,-0.8 -0.1,0.8 -0.1,0.4 -0.3,0 -0.1,-0.4 -0.1,-0.9 -4.5,-0.5 -0.1,0.8 -0.1,0.4 -0.3,0 -0.1,-0.4 -0.1,-0.9 -4.5,-0.5 -0.1,0.8 -0.1,0.4 -0.3,0 -0.1,-0.4 -0.1,-0.9 -4.1,-0.5 0,2.7 -0.3,5 -0.9,5.7 -0.7,3.1 -0.7,2.8 9.6,4.2 0.4,0.4 0.1,0.4 0,2.2 -10.8,-1 -0.2,1.1 -0.2,0 -0.2,-1.1 -10.8,1 0,-2.2 0.1,-0.4 0.4,-0.4 9.6,-4.2 -0.7,-2.8 -0.7,-3.1 -0.9,-5.7 -0.3,-5 0,-2.7 -4.1,0.5 -0.1,0.9 -0.1,0.4 -0.3,0 -0.1,-0.4 -0.1,-0.8 -4.5,0.5 -0.1,0.9 -0.1,0.4 -0.3,0 -0.1,-0.4 -0.1,-0.8 -4.5,0.5 -0.1,0.9 -0.1,0.4 -0.3,0 -0.1,-0.4 -0.1,-0.8 -7.2,0.8 0,-2.1 0.3,-0.6 0.5,-0.3 11.6,-3.9 -0.9,0 -0.2,-1.7 0,-2.1 0.2,-0.7 0.2,-0.2 2.2,0 0.2,0.2 0.2,0.7 0,2.1 -0.2,1.1 3.5,-1.1 -0.9,0 -0.2,-1.9 0,-1.9 0.2,-0.7 0.2,-0.2 2.2,0 0.2,0.2 0.2,0.7 0,1.9 -0.2,1.3 3.1,-1 0,-3.3 0.1,-5.1 0.4,-2.5 0.6,-1.9 0.8,-2.1 0.7,-1.4 0.5,-0.8 z" };

//BAe 146-200/Avro RJ85 - Standard Scale 0.50 Meters/point, PiAware Default Scale 0.25, 3in4 Non-linear Scale 0.55
Image
var _r462 = {
key: "r462",
scale: 0.55,
size: [64, 64],
anchor: [32, 32], //Tail position 60
path: "m 32,3.6 0.5,0.4 0.5,0.8 0.7,1.4 0.8,2.1 0.6,1.9 0.4,2.5 0.1,5.1 0,6.2 3.1,1 -0.2,-1.1 0,-2.1 0.1,-0.7 0.2,-0.2 2.4,0 0.2,0.2 0.1,0.7 0,2.1 -0.2,1.7 -0.9,0 3.5,1.1 -0.2,-1.1 0,-2.1 0.2,-0.7 0.2,-0.2 2.2,0 0.2,0.2 0.2,0.7 0,2.1 -0.2,1.7 -0.9,0 11.6,3.9 0.5,0.3 0.3,0.6 0,2.1 -7.2,-0.8 -0.1,0.8 -0.1,0.4 -0.3,0 -0.1,-0.4 -0.1,-0.9 -4.5,-0.5 -0.1,0.8 -0.1,0.4 -0.3,0 -0.1,-0.4 -0.1,-0.9 -4.5,-0.5 -0.1,0.8 -0.1,0.4 -0.3,0 -0.1,-0.4 -0.1,-0.9 -4.1,-0.5 0,5 -0.3,5 -0.9,5.7 -0.7,3.1 -0.7,2.8 9.6,4.2 0.4,0.4 0.1,0.4 0,2.2 -10.8,-1 -0.2,1.1 -0.2,0 -0.2,-1.1 -10.8,1 0,-2.2 0.1,-0.4 0.4,-0.4 9.6,-4.2 -0.7,-2.8 -0.7,-3.1 -0.9,-5.7 -0.3,-5 0,-5 -4.1,0.5 -0.1,0.9 -0.1,0.4 -0.3,0 -0.1,-0.4 -0.1,-0.8 -4.5,0.5 -0.1,0.9 -0.1,0.4 -0.3,0 -0.1,-0.4 -0.1,-0.8 -4.5,0.5 -0.1,0.9 -0.1,0.4 -0.3,0 -0.1,-0.4 -0.1,-0.8 -7.2,0.8 0,-2.1 0.3,-0.6 0.5,-0.3 11.6,-3.9 -0.9,0 -0.2,-1.7 0,-2.1 0.2,-0.7 0.2,-0.2 2.2,0 0.2,0.2 0.2,0.7 0,2.1 -0.2,1.1 3.5,-1.1 -0.9,0 -0.2,-1.9 0,-1.9 0.2,-0.7 0.2,-0.2 2.2,0 0.2,0.2 0.2,0.7 0,1.9 -0.2,1.3 3.1,-1 0,-6.2 0.1,-5.1 0.4,-2.5 0.6,-1.9 0.8,-2.1 0.7,-1.4 0.5,-0.8 z" };

//BAe 146-300/Avro RJ100 - Standard Scale 0.50 Meters/point, PiAware Default Scale 0.25, 3in4 Non-linear Scale 0.55
Image
var _r463 = {
key: "r463",
scale: 0.55,
size: [64, 64],
anchor: [32, 32], //Tail position 63
path: "m 32,0.9 0.5,0.4 0.5,0.8 0.7,1.4 0.8,2.1 0.6,1.9 0.4,2.5 0.1,10.7 0,3.3 3.1,1 -0.2,-1.1 0,-2.1 0.1,-0.7 0.2,-0.2 2.4,0 0.2,0.2 0.1,0.7 0,2.1 -0.2,1.7 -0.9,0 3.5,1.1 -0.2,-1.1 0,-2.1 0.2,-0.7 0.2,-0.2 2.2,0 0.2,0.2 0.2,0.7 0,2.1 -0.2,1.7 -0.9,0 11.6,3.9 0.5,0.3 0.3,0.6 0,2.1 -7.2,-0.8 -0.1,0.8 -0.1,0.4 -0.3,0 -0.1,-0.4 -0.1,-0.9 -4.5,-0.5 -0.1,0.8 -0.1,0.4 -0.3,0 -0.1,-0.4 -0.1,-0.9 -4.5,-0.5 -0.1,0.8 -0.1,0.4 -0.3,0 -0.1,-0.4 -0.1,-0.9 -4.1,-0.5 0,2.7 -0.3,9.9 -0.9,5.7 -0.7,3.1 -0.7,2.8 9.6,4.2 0.4,0.4 0.1,0.4 0,2.2 -10.8,-1 -0.2,1.1 -0.2,0 -0.2,-1.1 -10.8,1 0,-2.2 0.1,-0.4 0.4,-0.4 9.6,-4.2 -0.7,-2.8 -0.7,-3.1 -0.9,-5.7 -0.3,-9.9 0,-2.7 -4.1,0.5 -0.1,0.9 -0.1,0.4 -0.3,0 -0.1,-0.4 -0.1,-0.8 -4.5,0.5 -0.1,0.9 -0.1,0.4 -0.3,0 -0.1,-0.4 -0.1,-0.8 -4.5,0.5 -0.1,0.9 -0.1,0.4 -0.3,0 -0.1,-0.4 -0.1,-0.8 -7.2,0.8 0,-2.1 0.3,-0.6 0.5,-0.3 11.6,-3.9 -0.9,0 -0.2,-1.7 0,-2.1 0.2,-0.7 0.2,-0.2 2.2,0 0.2,0.2 0.2,0.7 0,2.1 -0.2,1.1 3.5,-1.1 -0.9,0 -0.2,-1.9 0,-1.9 0.2,-0.7 0.2,-0.2 2.2,0 0.2,0.2 0.2,0.7 0,1.9 -0.2,1.3 3.1,-1 0,-3.3 0.1,-10.7 0.4,-2.5 0.6,-1.9 0.8,-2.1 0.7,-1.4 0.5,-0.8 z" };


Top
 Profile  
 
 Post subject: Re: Some custom SVG plane icons...
PostPosted: Sun Nov 06, 2016 3:17 am 
Offline
FlightAware Member
MikeMathee - FlightAware user avatar

Joined: Sun Sep 11, 2016 12:35 pm
Posts: 50
FlyingPeteNZ wrote:
Here you go, took me a while as I needed to test some stuff, this was the first graphic I have tried with multiple objects, all the others are a single line with slight of hand to do complex stuff (like rotor blades and helicopter skids), will rework these now with new technique.

Also the image of the graphic below has actually been flipped but does draw correctly in PiAware (have tested), not sure about scale so kicked off at 1.00, set using the balloon's extra parameters so it doesn't rotate.

//Beacon - Standard Scale 1.0 Meters/point

FlyingPeteNZ wrote:
This one was another fun one, ended up studying up of BAe 146/Avro planes, in the end I have assumed the following:
BAe 146-100=Avro RJ70
BAe 146-200=Avro RJ85
BAe 146-300=Avro RJ100


Added the beacon and tweaked the scaling to my liking.
Just waiting for a BAe 146-200=Avro RJ85 to fly by... :lol:
Thank you very much!
Appreciate all your effort!


Top
 Profile  
 
 Post subject: Re: Some custom SVG plane icons...
PostPosted: Sun Nov 06, 2016 11:15 am 
Online
FlightAware Member
abcd567 - FlightAware user avatar

Joined: Sat Feb 15, 2014 3:08 am
Posts: 2155
Location: Toronto CYYZ
FlyingPeteNZ wrote:
Thought it would be nice to share :)

Created these from scratch my using a 64x64 grid overlay on a top view image of the aircraft. I have only used straight lines and I could have used integers to make them more accurate however at the scale they are being used I think they look OK.

They are quite simple graphics compared with the ones included in PiAware3 but do the trick.

I have applied these as the basis of my aircraft categories, i.e. the A320 is used for small_twin_jet which is used for A320's and B737s.

Airbus A320
(small_twin_jet)
Image

var _a320_svg =
"m 32,1 2,1 2,3 0,18 4,1 0,-4 3,0 0,5 17,6 0,3 -15,-2 -9,0 0,12 -2,6 7,3 0,2 -8,-1 -1,2 -1,-2 -8,1 0,-2 7,-3 -2,-6 0,-12 -9,0 -15,2 0,-3 17,-6 0,-5 3,0 0,4 4,-1 0,-18 2,-3 2,-1z";


Boeing 777
(large_twin_jet)
Image

var _b777_svg =
"m 32,1 2,1 1,2 0,20 4,4 0,-4 3,0 0,4 -1,2 17,12 0,2 -16,-5 -7,0 0,13 -1,5 7,5 0,2 -8,-2 -1,2 -1,-2 -8,2 0,-2 7,-5 -1,-5 0,-13 -7,0 -16,5 0,-2 17,-12 -1,-2 0,-4 3,0 0,4 4,-4 0,-20 1,-2 2,-1z";


Bombardier Q300 (Dash8)
(medium_twin_prop)
Image

var _dash8_svg =
"m 32,1 3,4 0,20 4,0 0,-5 1,-1 1,1 0,5 17,2 0,3 -17,2 0,3 -1,1 -1,-1 0,-3 -4,0 0,15 -1,8 6,0 1,1 0,3 -8,0 -1,1 -1,-1 -8,0 0,-3 1,-1 6,0 -1,-8 0,-15 -4,0 0,3, -1,1 -1,-1 0,-3 -17,-2 0,-3 17,-2 0,-5 1,-1 1,1 0,5 4,0 0,-20 3,-4z";


Beechcraft Super King Air B200
(small_twin_prop)
Image

var _b200_svg =
"m 32,1 1,0 1,2 1,4 0,5 5,0 0,-5 -1,-1 2,-2 2,2 -1,1 0,5 17,2 0,3 -17,3 0,1 -2,0 0,-1 -5,0 0,5 -2,8 6,3 0,2 -6,-1 -1,0 -6,1 0,-2 6,-3 -2,-8 0,-5 -5,0 0,1, -2,0 0,-1 -17,-3 0,-3 17,-2 0,-5 -1,-1 2,-2 2,2 -1,1 0,5 5,0 0,-5 1,-4 1,-2 z";


And lastly I use this dull triangle instead of default:
var _triangle_svg =
"m 32,0 32,64 -64,0z";

I use the existing heavy, light and rotorcraft icons for now for other types.


I decided to try this enhancement, but my knowledge is a big zero on this subject. Need step-by-step instructions:
(1) To which file above svg data should be added or do I have to create a separate file for each icon?
(2) What is path to the folder in which this file resides?


Top
 Profile  
 
 Post subject: Re: Some custom SVG plane icons...
PostPosted: Sun Nov 06, 2016 12:15 pm 
Offline
FlightAware Member
MikeMathee - FlightAware user avatar

Joined: Sun Sep 11, 2016 12:35 pm
Posts: 50
abcd567 wrote:
I decided to try this enhancement, but my knowledge is a big zero on this subject. Need step-by-step instructions:
(1) To which file above svg data should be added or do I have to create a separate file for each icon?
(2) What is path to the folder in which this file resides?

First make a backup of the html folder, just in case something goes wrong.
That markers.js file is very sensitive, I've had to revert back to the original many times. Then again, I'm a monkey see monkey do "programmer" with no programming experience.
I'm using dump1090-fa and the path to my html folder is: /usr/share/dump1090-fa/html
You don't need to play around with the database at first, you can add the specific aircraft icons which you are interested in of which the aircraft types are automatically picked up and listed in the large table on the web interface.

FlyingPeteNZ wrote:
OK here is my first attempt to write up a guide on using the custom graphics:

Intro
To utilise the custom aircraft graphics you need three things:
- A database mapping the unique ICAO24 address to the ICAO Aircraft Code (Aircraft Type Designator)
- A customised markers.js file with the new graphics
- PiAware 3.1.0 or equivalent mutability release

Neither of these are major drama but you really need both to get the best result.

Database
The latest versions of dump1090 found in PiAware 3.1.0 and mutability both have code to look up aircraft types in one of three ways:
- Lookup the ICAO24 address in a local JSON-based database
- Use a basic aircraft type lookup (L1P, L2T etc…)
- Use the aircraft category (A1. A2 etc…)

Failing all the above a generic icon will be mapped.

There is a JSON DB included by default but it is not being maintained and for me lacked most of the local aircraft.

For the best results I build my own JSON DB (it’s not as hard as it sounds!), this has the advantage that it has most of the local aircraft in it and regular visitors to this part of the world. I was able to get a reasonably recent copy of the local register that had ICAO24s and aircraft types in it, this was a great starting point for me.

To build your own DB you need a correctly formatted CSV file with the ICAO24 to type mappings and the csv-to-json.py python script. This can be found in the tools directory in the mutability releases (not included in PiAware 3.1.0), there is also an example CSV (vrs.csv, you could add to this or replace entirely) in that directory too.
The CSV is formatted like this (you need the header icao24,r,t for the script to work):

icao24,r,t
3A21ED,F-OIPN,AT73
3A24C5,F-OJGF,A343
3A2641,F-OJSB,A320
3A266D,F-OJTN,A343
3A2DD5,F-OLOV,A343


So format is [ICAO24 address],[registration],[ICAO Aircraft Type Designator]
You can leave registration blank as the graphics will still work however registration info can be displayed in the Dump1090 web viewer.

Once you have a CSV file sorted you just need to run the python script to generate a JSON DB from it.

You can run this on your Pi (I know PiAware 3.1.0 has Python, individual mileage may vary on custom builds), or as I now do I my Windows PC.

To run on your Pi put the script and the cvs and an empty directory called db into a directory on your Pi and run the following command:

sudo python csv-to-json.py vrs.csv db

Where vrs.csv is your csv file and db is the output directory, if it worked you should get a response like this:

Read 5611 aircraft
Writing blocks: 0 1 2 3 4 5 6 7 8 9 A B C D E F C8 C80 C81 C801 C802 C803 C804 C808 C817 C818 C819 C81A C81B C81C C81D C81E done.
Wrote 32 blocks


If you look in the db directory there should be a number of .json files. To use this database just copy it over the top of the existing db directory in the html folder of Dump1090 (/usr/share/dump1090-fa/html on PiAware 3.1.0)

As mentioned in earlier this script also runs fine on my Windows PC, you just need to download Python 2.7 (tried 3.5 as well but the script won’t run in that version).

Now this is a very important step to test the new database, this database caches and a simple refresh of your browser won’t load the new DB, no amount of force refreshing seems to work either so you either need to clear your browser cache or if you use Chrome load it in Incognito as it shouldn’t cache it (I say shouldn’t but you should close and restart the Incognito sessions between DB updates as it seems to hold he DB in RAM).

So that’s the DB. I am using Excel for my source copy, got a few local NZ guys around here also “subscribing” to my DB.

Adding graphics
In order to use custom graphics you need to add them to the markers.js file in the dump1090 html (public_html in the mutability version) directory.

You can SSH on to your Pi and use Nano, or a much easier way is to use a SCP tool (such as WinSCP) to copy the file to your PC to edit it and copy it back when done (much easier and you can easily make backups of it to for those time when you do break it!)

You need to be careful with what you put in this file as a slight typo will often break it which results in a map with no planes on it, there are no useful error messages when this happens so you need to find the bug or revert to a backup. I’ll cover my common errors that break things further down.

Two things are required to use the custom graphics, first you need to insert the SVG data into the markers.js file, this is the bit that looks like this:
//A320 - Standard Scale 0.66 Meters/point
var _a320 = {
key: "a320",
scale: 0.66,
size: [64, 64],
anchor: [32, 32],
path: "m 32,1.8 0.4,0.1 0.4,0.4 0.7,1.1 0.7,1.4 0.4,1.3 0.3,1.4 0.1,1.2 0,11.6 0.3,0.8 0.3,0.3 3.7,1.9 -0.2,-1.2 0,-1.5 0.1,-1.2 0.2,-0.4 2.4,0 0.2,0.4 0.1,1.2 0,1.5 -0.3,2 -0.2,0 0,0.4 15.7,8.1 0.3,0.2 0.2,0.2 0.1,0.3 0,2.5 -0.2,0 0,-0.8 -7.5,-2.2 -0.1,0.5 -0.1,0.4 -0.1,0.2 -0.1,-0.2 -0.1,-0.4 -0.1,-0.7 -4.8,-1.4 -0.1,0.5 -0.1,0.4 -0.1,0.2 -0.1,-0.2 -0.1,-0.4 -0.1,-0.7 -2.3,-0.7 -1.1,0 -0.1,0.4 -0.1,0.2 -0.1,-0.2 -0.1,-0.4 -0.8,0 -0.1,0.7 -0.1,0.4 -0.1,0.2 -0.1,-0.2 -0.1,-0.4 -0.1,-0.7 -4,0 0,11.6 -0.1,2.9 -0.3,2 -0.3,1.7 -0.4,1.7 0.1,0.4 0.4,0.4 6.8,4.5 0.1,0.1 0.1,0.3 0,1.6 -8.2,-1.9 -0.3,1.3 -0.3,0.9 -0.2,0.7 0,0.3 -0.8,0 0,-0.3 -0.2,-0.7 -0.3,-0.9 -0.3,-1.3 -8.2,1.9 0,-1.6 0.1,-0.3 0.1,-0.1 6.8,-4.5 0.4,-0.4 0.1,-0.4 -0.4,-1.7 -0.3,-1.7 -0.3,-2 -0.1,-2.9 0,-11.6 -4,0 -0.1,0.7 -0.1,0.4 -0.1,0.2 -0.1,-0.2 -0.1,-0.4 -0.1,-0.7 -0.8,0 -0.1,0.4 -0.1,0.2 -0.1,-0.2 -0.1,-0.4 -1.1,0 -2.3,0.7 -0.1,0.7 -0.1,0.4 -0.1,0.2 -0.1,-0.2 -0.1,-0.4 -0.1,-0.5 -4.8,1.4 -0.1,0.7 -0.1,0.4 -0.1,0.2 -0.1,-0.2 -0.1,-0.4 -0.1,-0.5 -7.5,2.2 0,0.8 -0.2,0 0,-2.5 0.1,-0.3 0.2,-0.2 0.3,-0.2 15.7,-8.1 0,-0.4 -0.2,0 -0.3,-2 0,-1.5 0.1,-1.2 0.2,-0.4 2.4,0 0.2,0.4 0.1,1.2 0,1.5 -0.2,1.2 3.7,-1.9 0.3,-0.3 0.3,-0.8 0,-11.6 0.1,-1.2 0.3,-1.4 0.4,-1.3 0.7,-1.4 0.7,-1.1 0.4,-0.4 z"};


On the default file these should go after line 65 where there is a comment referencing this thread :D

A note on scaling:
I came up with a standard scaling system for the graphics I have done, this means that the drawn graphics are all correctly scaled to each other pretty much within 5% (most within 1%), This is meters per point, it is calculated using the real dimensions of the aircraft and the dimensions of the SVG image measured in points, for example:

The above A320 has a wingspan of 34.1 meters (I’m metric here) and is 37.57 meters long, the SVG graphic is 51.8 points wide by 56.7 points tall with some Excel magic (Average of real wingspan/SVG width and real length/ SVG height) I get a scale of 0.66 meters per point.

This scaling system results in graphics which are pretty much twice the size they should be when used with the default graphics, if you are using both I suggest you halve the scale, so the A320 will go from 0.66 to 0.33.

If using he above, I would make the helicopters double size too.

The next issue with scaling that this system is linear and a Cessna 172 and an Airbus A380 are slightly different in size, so as if your map is like mine and you have lots of types of aircraft of all sizes buzzing around you will get nice looking large aircraft and tiny small aircraft or oversized large aircraft if you want detail of the smaller ones. I am working on a non-linear scale for this where the C172 is still smaller than a A380 but not as much as real life.

Enough on scaling.

The next thing you need to get your graphic working is to map the ICAO aircraft type designator as looked up in the JSON to the correct SVG graphic, this is done in the following section of the markers.js file (after line 142 in the default file):
var TypeIcons = {
'A318': _a320, // shortened a320
'A319': _a320, // shortened a320
'A320': _a320,
'A321': _a320, // stretched a320

'A388': _a380,

// dubious since these are old-generation 737s
// but the shape is similar
'B731': _b738,
'B732': _b738,
'B733': _b738,
'B734': _b738,
'B735': _b738,...


The DB lookup id the first variable in the single quotes, and the SVG graphic is the second variable in with the underscore. Fairly straight forward. You seem to be able to add as many as you want, however the trick to make sure it works is the last one must not have a comma after it!

And that should be it, you should have pretty graphics now.

A quick note on what can go wrong with the markers.js file, if the web page loads with no planes then check the following:
- All the brackets, commas and semicolons are where they should be, there are enough working examples of this in the default file to reference what is correct, and don’t forget the comma issue noted above
- The SVG path referenced in the TypeIcon section doesn’t exist (usually typo)

There you go, hope that makes sense, have fun!


Top
 Profile  
 
 Post subject: Re: Some custom SVG plane icons...
PostPosted: Sun Nov 06, 2016 1:29 pm 
Online
FlightAware Member
abcd567 - FlightAware user avatar

Joined: Sat Feb 15, 2014 3:08 am
Posts: 2155
Location: Toronto CYYZ
@MikeMathee:
Thank you very much for your help and prompt reply. I have missed FlyingPeteNZ's post you quoted. Thanks again.


Top
 Profile  
 
 Post subject: Re: Some custom SVG plane icons...
PostPosted: Sun Nov 06, 2016 1:45 pm 
Offline
FlightAware Member
FlyingPeteNZ - FlightAware user avatar

Joined: Thu Aug 04, 2016 10:47 pm
Posts: 157
Location: Auckland, New Zealand
abcd567 wrote:
@MikeMathee:
Thank you very much for your help and prompt reply. I have missed FlyingPeteNZ's post you quoted. Thanks again.


Have fun! I am waiting on what is happening with 3.2.0 before reposting all the tweaks I have been done, for the most part it was just cleanup and gap-plugging, oh and that new scale.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 190 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7, 8  Next

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: eastofottawa, Google [Bot], knoso0, lorro, lwqcz, mcklai, remondolinski and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to: