Making maps is hard, there is just as much art to it as science. One day I decided I wanted to create some custom map layers to use for my Amateur radio APRS rig. Amateur radio geeks are quick to point out the folly of relying on the internet and cell phone data systems. So I needed to get some good quality map layers as well as be able to to display them along with all of the needed labels and icons to identify what's what.
So here are the steps I took to get this all to work.
- Don't use the pre-package versions of Xastir, compile from source in order to have all of the map support you will need. Follow these steps here and make sure you include GDAL support. https://xastir.org/index.php/HowTo:Ubuntu_14.04-17.04
- Find a shapefile map you like. For example Johnson County Kansas has a GIS department which releases up to date map Shape files. https://aims.jocogov.org/AIMSData/FreeData.aspx
- Download the maps in shapefile format and place the folder containing the map files into the /usr/local/share/xastir/maps folder. There should be multiple files per map layer(.cpg, .dbf, .prj, .shp, .shx).
- using the testdbfawk command, extract the field names in the shapefile: testdbfawk -D /usr/local/share/xastir/config -d /usr/local/share/xastir/maps/your_map/your_map.dbf
- Create a new file in /usr/local/share/xastir/config/ called "your_map.dbfawk" :
#A colon separated list of all of the fields in this shapefile
dbfinfo="field1:field2:field3:field4";
#A colon separated list of the fields that we want to do something with
dbffields="field2:field4";
BEGIN_RECORD {key=""; lanes=1; color=4; name=""; filled=0; pattern=2; display_level=1; label_level=32; label_color=8; symbol=""; font_size=3}
#a list of the fields from dbffields (above) specifically that we want to do something with.
/^field2=(.+)$/ {name="$1";}
/^field4=(.+)$/ {name="$1";}
Once finished you can enable your map in xastir and everything that has the fields listed in "dbfinfo" will get formatted with these settings.
dbffields="field2:field4";
#sets the map settings (ex. what level these are displayed, what color and background color are to be used ...etc)
BEGIN_RECORD {key=""; lanes=1; color=4; name=""; filled=0; pattern=2; display_level=1; label_level=32; label_color=8; symbol=""; font_size=3}
#a list of the fields from dbffields (above) specifically that we want to do something with.
/^field2=(.+)$/ {name="$1";}
/^field4=(.+)$/ {name="$1";}
Once finished you can enable your map in xastir and everything that has the fields listed in "dbfinfo" will get formatted with these settings.
Happy mapping!
Resources:
- XAstir.org: https://xastir.org/index.php/HowTo:DBFAWK#I_have_a_new_shapefile._How_do_I_get_it_to_display_nicely_in_Xastir_with_DBFAWK_enabled.3F
- XAstir.org: https://xastir.org/index.php/HowTo:Ubuntu_14.04-17.04
- Johnson County KS AIMS: https://aims.jocogov.org/AIMSData/FreeData.aspx
No comments:
Post a Comment