[{"id":0,"href":"/posts/newblog/","title":"Propex HS2000 thermostat; temperature setting chart","section":"Blog","content":"Hugo uses the excellent Go html/template library for its template engine. It is an extremely lightweight engine that provides a very small amount of logic. In our experience that it is just the right amount of logic to be able to create a good static website. If you have used other template systems from different languages or frameworks you will find a lot of similarities in Go templates.\nThis document is a brief primer on using Go templates. The Go docs provide more details.\nIntroduction to Maps # Go templates provide an extremely simple template language. It adheres to the belief that only the most basic of logic belongs in the template or view layer. One consequence of this simplicity is that Go templates parse very quickly.\nA unique characteristic of Go templates is they are content aware. Variables and content will be sanitized depending on the context of where they are used. More details can be found in the Go docs.\nBasic GIS # Golang templates are HTML files with the addition of variables and functions.\nGo variables and functions are accessible within {{ }}\nView this post on Instagram "},{"id":1,"href":"/docs/gnis-bezier/","title":"GNIS Bézier","section":"Docs","content":" GNIS Bézier Project # Overview # The GNIS (Geographic Names Information System) is the authoritative* source of information for place names in the United States. It is a fantastic dataset and despite the fact that there seems to be no reasonable way to get errors fixed–namely grossly misplaced peaks and elevation values–it has proven to be a valuable resource for cartographers. All of the features in the GNIS dataset are point features even if they represent features that are distinctly linear.\nOne of the things that I love about the original USGS topo 1:24k maps and I lament about the new US Topo products is the lack of feature labels on bézier curves that are now printed as straight block labels instead. I know that there are funding issues, usability issues, etc., but nevertheless, I hate to see this art fade away. For smaller features this isn’t quite as much of an issue, but for larger features like mountain ranges, a single point label on a particular quad is poor at best and quite misleading in my opinion.\nRailroad Canyon label from the original quad map versus US topo on the right. Long mountain ranges rendered on a bézier curve multiple times to accurately depict the feature (left) versus a single point text label to label the whole range (right). SO! What are we as enterprising cartographers to do to resurrect these great labels and use them for our modern cartographic work? Well, that’s what this project is all about.\nThe Project # This project aims to tap into the skills, time, and expertise of the cartographic community to build a rich, multi-scale dataset of these linear features. Together we can all work on a particular part of the country and then combine our efforts into a single dataset of linear feature labels. It carries an open source license and will be available in the public domain for all to use.\nI’ve downloaded the GNIS point dataset and isolated the feature types that I think would benefit from being represented as a linear feature instead of a point feature. Mountain ranges are the obvious example, but other feature types including valleys, canyons, plains, and gulches are included as well. I’ve converted these selected point features into linear features and retained all of the attributes.\nThe GNIS feature types included in the GNIS-Bézier project A GNIS-bézier feature for the Crazy Mountains with attached attributes in Adobe Illustrator with MAPublisher. Help! # If you’ve made it this far, maybe you are the type of person that wants to contribute to the GNIS-Bézier project. Great! Let’s make this dataset together and make it free for everyone so we can all have better maps in our lives for years to come!\nStep 1. Choose an Area # The first step to contributing to the project is to choose an area to work on. I’ve broken the country up into blocks that will allow for a ~360 square kilometer area to be worked on at a time. These constraints are based on the maximum artboard size that Adobe Illustrator supports when this area is displayed at ~1:50,000. Use the map below to identify an unclaimed block (click to enlarge). Any of the blocks below that are NOT filled with blue are unclaimed and up for grabs. Send me an email to jamierob @ gmail dot com to claim one. The Video below will help explain the data behind the project and choosing a piece of the country for you to work on.\nIn progress map: Blue=taken, Yellow=available. Updated 10/04/2020 Project Overview Video\nStep 2. Download the data for your block # After you have your block, it will take me a little while to prep the documents for you. I have a semi-automated procedure that stitches together all of the original quad maps, de-collars and re-projects them, and then strips out a lot of the colors except for the relevant ones to placing the labels. The topo images and the GNIS-Bézier features are then put into an Adobe Illustrator document and ready to go. Once that is done I’ll post the files to the github project page and you can either download it or check it out. Don’t let a lack of git knowledge keep you from pitching in! Here is the repository if you want to check out the work so far.\nStep 3: Edit the features # Once you get the features from me, you’re ready to get your hands dirty and move some lines. You’ll need basic knowledge of Adobe Illustrator, file management, and an attention to detail. There are some custom path scripts that really help to refine the bézier curves. An extension for Adobe Illustrator called MAPublisher is also required, but if you don’t have one–that’s ok–you can get a 14-day trial from Avenza and hopefully that should be sufficient for you to complete your block. The video below explains the procedure for downloading and editing your block of data in Adobe Illustrator. The basic steps to remember are:\nEdit the two nodes to make each line feature match the shape of the physical feature in question. Add new nodes as necessary but only if needed.\nAttributes – When the line is finished, update the ‘workstatus’ attribute for the feature as follows:\n2a. x – The edit is complete and no other work is needed. It falls completely within the block being edited.\n2b. q – you have a question about the feature. Someone else should take a look at it.\n2c. e – The feature goes off of the edge of the block you are editing. When this feature is merged into the nation-wide document, this will need to be edited/fixed.\n2d. Delete – If you think that the feature is just too small or silly to warrant an actual linear feature label, just delete the feature.\nRemember: These are very small illustrator files from a size perspective because they do not have embedded images or saved with PDF compatibility. If you try to save it with PDF compatibility checked or embed the images, it will probably choke.\nEditing and Contributing Video\nStep 4: Submit your work back to the project # When you’re finished editing your block, either send the .ai file back to me or make a pull request and commit it via git. I’ll combine it into the full usa .ai document and we’ll slowly build up the dataset for the whole country. If/when all of the blocks are completed, we’ll have a single .ai document with bézier lines, with attributes for the whole country. We can assign map scale to features based on the line length and/or if the label text will fit on the line at a given scale. I haven’t quite sorted that part out yet. Finally, the dataset can then be exported out to other geodata formats so it can be used in other applications. The reason for starting in Illustrator with MAPublisher is to have the clean, bézier features first because when the features are exported (likely to shapefile), nodes will be added along the curves.\nThank you for reading and please consider working on a block if you’re interested! If you have any questions please post them below or send me an email.\n// * authoritative from a European colonization standpoint. The GNIS dataset contains place names from after Europeans arrived on Turtle Island and created names for these features. Many indigenous place names are not represented and some current place names are racist. I fully support efforts to rename these features to provide long overdue respect and recognition of the original names that were attached to these features.\n"},{"id":2,"href":"/docs/mapublisher/","title":"MAPublisher","section":"Docs","content":" MAPublisher/Adobe Illustrator # MAPublisher is an extension for Adobe Illustrator that allows Cartographers to directly import spatial data into an .ai document while retaining spatial information and feature attributes. This allows for rescaling, reprojection, and generating labels from attribute tables among many other things.\nCheck out tips and tricks here for making maps in Illustrator with the MAPublisher extension.\n"},{"id":3,"href":"/docs/illustrator/txt-regex-replace-script/","title":"Batch Regex Replace Script","section":"Illustrator","content":" Batch Regex Replace Script # Disclaimer: This script is really niche, but has come in handy when dealing with lots of text objects that contain labels driven by multiple attribute fields. Ok, into the weeds:\nLabeling with multiple attribute fields. Sometimes I’ll need to label a set of hundreds of points with multiple attribute fields. MAPublisher can do this easily enough, but I often don’t want them to be broken up into separate text objects. Aligning and moving them around accurately can be quite a chore. Luckily, it’s easy enough to concatenate attributes together into a new field and then label the points with that field. Other text can be added in as well. For example, to concatenate The Name field and Population field together into a newly created citypoplbl field, along with some other text (more on this later), we could do the following: (Name)\u0026amp; \u0026quot;$Pop.$\u0026quot; \u0026amp;(Population)\nto get:\nNow we can use MAPublisher to label with the citypoplbl field:\nBatch mode? This example with only three points would be simple enough to manually adjust character styles to each bit of text that we want–but what if this was a map with 2,000 labels? The tedium would be untenable, and i’d likely revert to separate point text objects for each attribute so they could be styled individually, but then I’d be dealing with alignment issues.. So, what if there was a way to target parts of the point text object string and apply a character style to just that part? Well, dear map nerd, your script has arrived. Read on!\nUsing the Batch Regex Character Style replace script. Once you get the apply_Style_With_RegExp.jsx script from the git repo, put it in a location that is accessible, or in the \u0026hellip;/Scripts/ folder of your illustrator installation. Make some Character styles that you want to use:\nSelect the text objects that you want to target with the script and run it. You’ll be prompted for a regular expression to search with, and a dropdown list of the document Character Styles to apply one to the text found with the regex pattern. This will work with any regular expression, but to make this easy to target, we’ve put ‘$’ into our label string so we can easily target each part of the label string.\nRegular expressions are so powerful. I find them totally infuriating sometimes, but when they work, they can save you heaps of time with data processing and now with styling maps as well. regex101.com is an invaluable tool for testing and learning regular expressions.\nSo, first we want to style all of the city names with the City Name Character Style. We’ll use ‘^’ to search from the start of the string, ‘\\w’ to look for any word character, and then ‘*’ to find as many word characters as we can. Since we have a non-word character, ‘$’, after the City Name, the search will find all of the city names and nothing else:\nWe see that we’ve applied the ‘City Name’ character style to those parts of the string:\nNow to style the ‘Pop.’ bit. We could use a really fancy regular expression to find all characters between ‘$’ and ‘$’, but since we know they are all ‘Pop.’ in this case, we can just search for that:\nsuccess!\nNow for the population value. This regular expression is pretty ugly and I’m sure it could be done more efficiently, but it works. In hindsight, using ‘$’ for the ‘catch’ character is not ideal because it also means ‘end of string’ in regex.\n\\.\\$(.*)$ \\. #literally match a period \\$ #literally match a dollar sign symbol (.*) # \u0026#39;.*\u0026#39; #any number of any characters # \u0026#39;()\u0026#39; used to make this the pattern to actually match $ #target the end of the string And now we’ve got all three parts of the label styled with our three separate character styles:\nReplace the dollar signs. Finally, use the standard Illustrator Find and Replace tool to replace the ‘$’ symbols with normal spaces: Map on! Once again, many thanks to the talented and generous @shspage_en for working on this script with me.\nTLDR and scrolled to the bottom–link to the script\n"},{"id":4,"href":"/docs/mapublisher/mp-glyph-symbol-replace/","title":"Batch replace glyphs/font shields with ai symbols in MAPublisher LabelPro","section":"MAPublisher","content":" Batch replace glyphs/font shields with ai symbols in MAPublisher LabelPro # Replace text glyph shields with your own Illustrator symbols en-masse! What is this magic? We’ll use a custom shields file, a selection trick, and a script to make it happen. If this is interesting to you, read on..\nOverview # When I make maps with Avenza MAPublisher, one of the common things that I need to do is place shield labels on roads. This is possible with an extra extension to the base MAPublisher license called MAP LabelPro. It’s worth noting that this requires an additional up-front cost and annual maintenance fee.\nIn the MAP LabelPro setup dialogue, you can choose from sets of pre-built shields to use:\nThese are nice to have but have some limitations. They are actually generated from a bundled .ttf font file, and the shield objects themselves are hard to deal with because of this. Note the shield underlined like a text object and the Label-EZSymbols font associated with it:\nI need a lot more control over the style of the shields (as I expect most cartographers do), so the options are to: (1) make your own custom ‘shields’ .ttf font files (export your .ai shield art to .svg and turn it into a .ttf file) or (2) find a way to replace the ones that are placed with MAP LabelPro with your own normal .ai shield symbols. I attempted option 1, but it turned into a ton of fiddly conversion work, time wasted, and the end product was still a text object that I didn’t really want in the first place. So, option 2 is what we’ll work out below.\nMake a custom .lsf file for your shields. # Navigate to your MAPublisher prefs (Illustrator\u0026gt;MAPublisher Preferences). Click on MAP LabelPro and see where your rules, styles, and symbols are at. By default this is set to: /Applications/Avenza/MAPublisher 9.9/MAPublisher Plug-in/LabelPro/Symbols/ I highly recommend setting this in a custom location on your disk. Then you can keep track of everything, make it a git repo if you want to, and not lose it all when upgrading MAPublisher versions.\nMake a copy of the .lsf file that best matches your use case. I make print maps, so ‘generic_shields_cmyk.lsf’ will work for me.\nName it something that you will recognize. I’ll name mine ‘aca_shields_cmyk.lsf’\nEdit the .lsf file with custom shields. # Crack open your new .lsf file in your favorite text editor. This file describes the properties of each symbol. Let’s look at one below:\nThe first three lines are the header info. Leave everything as-is. The only thing to take into account here is that as you build your .lsf file with different symbol sets, you need to set NumSymbols=XX to the number of symbols in your file.\nEach block of code after that represents the properties of a single shield. For the example above:\nLine Descriptions Line 5: the number of the symbol in the file. sequential from top to bottom.\nLine 6: the link to the .ttf file with the shield text objects. leave this alone.\nLine 7: the link to the shield .png file. this is just the display icon in the MAP Label Pro dialogue. leave this alone.\nLine 8: the name of the shield that will appear in the labelPro dialogue\nLine 9: The number of glyphs that make up the shield. it’s important that this matches the glyph defs coming next\nLine 10-11: the glyph ids coming from the .ttf file in windows 1251 character encoding (ie-“1=50”) followed by C,M,Y,K values for the glyph\nLine 12: the alignment of the text on top of the shield. (left,bottom,top,right)\nThat is kind of a mess, but not to worry, we are going to keep it simple. Remember that these text shields are just a method to get objects into our illustrator document. we’re going to replace them with our own illustrator symbols. All we really care about is the SymbolName, NumGlyphs, and CMYK value. So, copy one of those blocks and edit it:\nSet Your SymbolName to represent one of you .ai shield symbols, ‘State Route Business’ in this case.\nSet the NumGlyphs to 1. this is important because we want to keep the replacement simple and a single glyph is easy to target.\nSet Glyph to “1=50 CMYK CMYK values”. This example represents a grayish blue 41,0,12,35. We’ll use this color to represent all shields on our map that we want to use our State Highway Business Route shield for. Yours will likely be different. This is important because we will use this color as a target later on during the replacement. I’m not sure why there is a leading ‘0.” in front of the CMYK value–just roll with it.\nYou’ll repeat this process for each shield that you want to be able to place with LabelPro and then replace with one of your own symbols. Remember to number the symbol entries sequentially, and then edit the header with the number of symbol entries that you have in the file. Setup LabelPro with your shields. # Open up a MAPublisher document with some road data that you want to label with. In a perfect world (haha) you’ll have an attribute representing the shield type (State/Federal/County, etc) and another with the number of the route. Click the LabelPro button, add your line layers, setup your attributes and sql, and then in the “Label With Symbol” section:\nYou should see your new .lsf file represented: And all of the shield entries that you made in the file: Label! # Run your LabelPro rules and check out your output. Remember that the goal here is to have a shield placed with a single glyph, with a fill color representing a certain class of shield that we want to replace with our own shields. For example, below I’ve used this green color to represent a shield class of “I” (interstate), and a value that is 2 digits long:\nI’ve used this blue color to represent a “MT” (or any State Route), and a value is 3 digits long:\nSetup Replacement Key # Now you have a map full of strangely colored shields. Make a new layer that will serve as the replacement ‘key’. This will be something that you want to keep around to copy/paste into new documents or integrate into your template files. It should contain an instance of the text symbol (from your recently placed shields) and the corresponding illustrator symbol. Mine looks like this. It’s grouped by route type and the number of digits in the label string:\nDownload and install find/replace script # The great and generous cartographer, Nathaniel Kelso, wrote some illustrator scripts way back in the day and graciously shared them with the world. We’ll use one of them to do this replacement. Download his scripts git repo here. The one we’re interested in is the “findAndReplaceGraphic_centered.jsx” file. Install this file (or all of them) into your Scripts Folder. This is something like: “/Applications/Adobe Illustrator CS6/Presets.localized/en_US/Scripts” Yours might vary slightly. Once it is there, it should be available in your File\u0026gt;Scripts menu.\nDo the Replacement Already! # Ok, finally, let’s do this. You will have a MAP Text Layer containing all of the text shields that were placed by LabelPro. Drag the layer that represents your replacement key in a layer above the shield layer. It’s ok that the text is grouped with the shield object–This script is smart enough to work through the groups. It should look something like this:\nDirect-Select one of the shields in your replacement template layer. The key here is to select only the text symbol object (and the corresponding fill color). With that selected, Go: Select\u0026gt;Same\u0026gt;Fill Color:\nAll of the shields across the map with that fill color (and road designation) should be selected. It doesn’t matter if they are in multiple layers or MAP Text suppression layers:\nNow, Shift+click (to add to the current selection) the illustrator symbol that represents the class of shields you currently have selected. This symbol should be ABOVE the text symbol instances in the Replacement template layer. Go: File\u0026gt;Scripts\u0026gt;findandReplaceGraphic_centered\nDone! # The script may chug a little bit, but just give it time. I’ve used it on huge maps with hundreds of replacements and it always works if you just let it be. If you look at the shield objects in the layer list, you’ll see that the illustrator symbol has replaced the text symbol inside the group with the text string: Repeat for all the other shield colors/classes, and you should have a map with your own illustrator symbols ready to work with:\n"},{"id":5,"href":"/docs/illustrator/custom-scripts-cartography-illustrator/","title":"Custom Scripts and Shortcuts for Cartography","section":"Illustrator","content":" Custom Scripts and Shortcuts for Cartography # 2017 NACIS presentation # Back in 2017 I gave a presentation about a set of custom scripts and shortcuts for enhanced productivity in Adobe Illustrator. They have proven indispensable for me and my cartographic work. If you want to spend less time in menus and also have some special tools to help you make maps, check out the video below. There are also installation videos for Mac and Windows. I’ve updated the shortcuts and scripts for Illustrator 2020 on Mac and Windows. Download the scripts and shortcuts here.\nInstallation Videos # I’ve updated the repository and the shortcuts for Illustrator 2020. Below are two videos to show the process of setting them on Windows 10 and MacOS Mojave. UPDATE: These still work great In Illustrator 2025\nGit Repository and a presentation on the scripts themselves: http://cairn.pw/nacis2020\nWindows 10/Illustrator 2020 # MacOS Mojave/Illustrator 2020 # "},{"id":6,"href":"/docs/mapublisher/mp-expressions/","title":"Expressions in MAPublisher","section":"MAPublisher","content":" Expressions in MAPublisher # A group of snippets to help you manipulate attributes in MAPublisher\nSelect Empty Fields # The key here is to have an empty space between the quote marks\nCOLUMN_NAME=\u0026#34; \u0026#34; Concatenate two fields # Make a new, empty field with the type you want (string/text), and using the \u0026lsquo;Apply Expression\u0026rsquo; option from the MAP Attributes panel menu, this will merge \u0026lsquo;column1\u0026rsquo; and \u0026lsquo;column 2\u0026rsquo; with a space in between and save it as the value in the newly created column.\n(column 1)\u0026amp; \u0026#34; \u0026#34; \u0026amp;(column 2) Edit Schema to format text # I use this whenever want to generate labels from a contour line dataset. I want to label without commas \u0026ldquo;,\u0026rdquo; in the number, but they typically come in from the GIS as an integer, so they are formatted with commas. It is as simple as setting the column type to a string.\nFrom the MAP Attributes menu, select \u0026lsquo;Edit Schema\u0026rsquo; Select the field you want, and set the field type to String The field is now ready to generate labels from without commas. Find/Replace/Append # From time to time I need to edit attributes in the MAPublisher MAP Attributes table. Typically this is for formatting the names of features before generating labels. This example is working with the WPDA dataset and labeling a subset of the polygons. In this case I wanted to label all of the National Parks. Some of the values in the NAME field had “National Park” somewhere in the name, sometimes at the beginning, sometimes at the end.\nAttributes in Question: Some values have “National Park”, others don’t\nSo, we need an expression that looks to see if the string “National” exists. If it does, leave the NAME value alone, if it doesn’t, then append “National Park” to the end of the existing value. Without further ado, the expression:\nIF(CONTAINS(NAME,\u0026#34;National\u0026#34;),NAME,NAME \u0026amp; \u0026#34; \u0026#34; \u0026amp; \u0026#34;National Park\u0026#34;) This expression says: If the value in NAME contains “National”\u0026hellip; then replace with NAME (ie-leave it alone), if it doesn’t contain “National”, replace the value with the existing NAME value and append the string “National Park”. Apply the expression via the “Apply Expression” option in the flyout menu of the MAP Attributes table: And the features in question have the correct string, “National Park”, applied to them:\n"},{"id":7,"href":"/docs/geoprocessing/switch-gdal-versions/","title":"Switch Between GDAL Versions","section":"Geoprocessing","content":" Switch Between GDAL Versions # I’m a big fan of QGIS and use it all the time. It’s gotten so stable and fast. It is such a joy to use now! On one of the recent versions that I upgraded to it went from using GDAL 1.11.x to using 2.1.x. This is great, but sometimes I need to be able to write to File Geodatabases. The FileGDB driver and the ESRI FileGDB API SDK that I installed for GDAL 1.11.x no longer works under GDAL 2.1, and as far as I can tell, there is no ESRI FileGDB API SDK that is compatible with GDAL 2.1.x.\nSo, GDAL 1.11.x is still installed on my machine with the FileGDB drivers, but how can I switch back and forth between 2.1 and 1.11 so that I can still use GDAL 2.1.x with QGIS, but be able to use GDAL 1.11.x on the occasions that I have to deal with file geodatabases? Luckily, there is a simple symlink that points to the current version and re-pointing the symlink is all we need to do.\nSo, here we go:\nVerify Current Paths # First, add GDAL to your PATH variable so you can use GDAL/OGR commands in a terminal window. (skip this if you already use GDAL from the command line).\necho 'export PATH=/Library/Frameworks/GDAL.framework/Programs:$PATH' \u0026gt;\u0026gt;~/.bash_profile\nsource ~/.bash_profile\n#cd over to the GDAL Framework ‘Versions’ directory\ncd /Library/Frameworks/GDAL.framework/Versions/\n#list the folder to see the installed versions and the ‘Current’ symlink.\nls -lah\nyou should see something like this, with the ‘Current’ Symlink pointing at version 2.1:\n#check the current GDAL/OGR version:\ngdalinfo --version\n*** should be 2.1.x, the same as the symlink ***\n#just for kicks, show that we don’t have access to the ESRI FileGDB driver with 2.1.x:\nogrinfo --formats | grep \u0026quot;FileGDB\u0026quot;\nas expected, we only have the OpenFileGDB driver:\nMake the Switch # #unlink, and then re-point the symlink at the older version of GDAL:\nunlink Current \u0026amp;\u0026amp; ln -s 1.11 /Library/Frameworks/GDAL.framework/Versions/Current\n#and list the folder again to show the modified symlink:\nls -lah\ngdalinfo \u0026ndash;version\n#check the available formats, this should show the ESRI FileGDB drivers (if you’ve installed them):\nogrinfo --formats | grep \u0026quot;FileGDB\u0026quot;\nNow you can use GDAL as normal. Your newer installation of QGIS might not work properly with this older version of GDAL, so just use it from the command line. Once you’re done messing with your file geodatabases, re-point the symlink back to GDAL 2.1.x:\n#re-point the symlink back to GDAL 2.1.x:\nunlink Current \u0026amp;\u0026amp; ln -s 2.1 /Library/Frameworks/GDAL.framework/Versions/Current\n#and check the version, which should be switched back to 2.1.x:\ngdalinfo --version\n"},{"id":8,"href":"/docs/geoprocessing/import-naturalearthdata-postgis/","title":"Importing Natural Earth Data geopackage into PostGIS","section":"Geoprocessing","content":" Tutorial Videos # This covers the steps outlined below for those inclined to video. Natural Earth Data # The Natural Earth datasets are an incredible resource. If you’re a cartographer you probably already know about it, and if not, you should definitely check it out. It’s a project spearheaded by some fantastic folks affiliated with NACIS. NACIS is a great organization that does so much for the cartographic community–check them out! I use Natural Earth Data a lot so it made sense for me to get all of the data into a format where I could import/crop any dataset into my Illustrator/MAPublisher document without having to even touch a GIS.\n1. Install Prerequisites # 1a. Install QGIS (3.28 or better, in order to get GDAL/OGR 3.3 or better, which has the needed geopackage (.gpkg) driver) 1b. Install Postgres.app\nDownload the full NaturalEarthData geopackage (.gpkg) Download and run the import script # Download ne-gpkg2postgis.sh ogr2ogr -progress -f \u0026#34;FileGDB\u0026#34; -sql \u0026#34;SELECT * FROM cn_osm_secondary\u0026#34; cn_secondary_rds.gdb PG:\u0026#34;host=localhost user=jrobertson dbname=osm_chinyc\u0026#34; Markdown content\nLorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa\nTitle Markdown content # Lorem markdownum insigne\u0026hellip;\nExplain ogr2ogr #calling the ogr library\n-progress #show a progress bar\nExplain this Command - ```ogr2ogr``` #calling the ogr library - ```-progress``` #show a progress bar Download ne-gpkg2postgis.sh "},{"id":9,"href":"/docs/shortcodes/gdal-book/","title":"OGR format conversion","section":"Shortcodes","content":" OGR format conversion # Find/Replace/Append # From time to time I need to edit attributes in the MAPublisher MAP Attributes table. Typically this is for formatting the names of features before generating labels. This example is working with the WPDA dataset and labeling a subset of the polygons. In this case I wanted to label all of the National Parks. Some of the values in the NAME field had “National Park” somewhere in the name, sometimes at the beginning, sometimes at the end.\nAttributes in Question: Some values have “National Park”, others don’t So, we need an expression that looks to see if the string “National” exists. If it does, leave the NAME value alone, if it doesn’t, then append “National Park” to the end of the existing value. Without further ado, the expression:\nIF(CONTAINS(NAME,\u0026#34;National\u0026#34;),NAME,NAME \u0026amp; \u0026#34; \u0026#34; \u0026amp; \u0026#34;National Park\u0026#34;) This expression says: If the value in NAME contains “National”\u0026hellip; then replace with NAME (ie-leave it alone), if it doesn’t contain “National”, replace the value with the existing NAME value and append the string “National Park”. Apply the expression via the “Apply Expression” option in the flyout menu of the MAP Attributes table: And the features in question have the correct string, “National Park”, applied to them: Select Empty Fields # The key here is to have an empty space between the quote marks\nCOLUMN_NAME=\u0026#34; \u0026#34; Concatenate two fields # (column 1)\u0026amp; \u0026#34; \u0026#34; \u0026amp;(column 2) #importing via sql SELECT * FROM streets WHERE streets.RTETYP = 5400\nExplain this code ![sql explanation](../../images/mp-attribs-explain.png) 1. If the value in NAME contains “National”... 2. then replace with NAME (ie-leave it alone), 3. if it doesn’t contain “National”, then replace the value with the existing NAME value and append the string “National Park”. "},{"id":10,"href":"/docs/shortcodes/buttons/","title":"Buttons","section":"Shortcodes","content":" Buttons # Buttons are styled links that can lead to local page or external link.\nExample # {{\u0026lt; button relref=\u0026#34;/\u0026#34; [class=\u0026#34;...\u0026#34;] \u0026gt;}}Get Home{{\u0026lt; /button \u0026gt;}} {{\u0026lt; button href=\u0026#34;https://github.com/alex-shpak/hugo-book\u0026#34; \u0026gt;}}Contribute{{\u0026lt; /button \u0026gt;}} Get Home Contribute "},{"id":11,"href":"/docs/shortcodes/columns/","title":"Columns","section":"Shortcodes","content":" Columns # Columns help organize shorter pieces of content horizontally for readability.\nExample # {{% columns [ratio=\u0026#34;1:1\u0026#34;] [class=\u0026#34;...\u0026#34;] %}} \u0026lt;!-- begin columns block --\u0026gt; # Left Content Lorem markdownum insigne... \u0026lt;---\u0026gt; \u0026lt;!-- magic separator, between columns --\u0026gt; # Mid Content Lorem markdownum insigne... \u0026lt;---\u0026gt; \u0026lt;!-- magic separator, between columns --\u0026gt; # Right Content Lorem markdownum insigne... {{% /columns %}} Left Content # Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa protulit, sed sed aere valvis inhaesuro Pallas animam: qui quid, ignes. Miseratus fonte Ditis conubia.\nMid Content # Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat stringit, frustra Saturnius uteroque inter!\nRight Content # Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa protulit, sed sed aere valvis inhaesuro Pallas animam: qui quid, ignes. Miseratus fonte Ditis conubia.\nSettings size ratio for columns # {{% columns ratio=\u0026#34;1:2\u0026#34; %}} \u0026lt;!-- begin columns block --\u0026gt; ## x1 Column Lorem markdownum insigne... \u0026lt;---\u0026gt; \u0026lt;!-- magic separator, between columns --\u0026gt; ## x2 Column Lorem markdownum insigne... {{% /columns %}} x1 Column # Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa protulit, sed sed aere valvis inhaesuro Pallas animam: qui quid, ignes. Miseratus fonte Ditis conubia.\nx2 Column # Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat stringit, frustra Saturnius uteroque inter!\nLorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa protulit, sed sed aere valvis inhaesuro Pallas animam: qui quid, ignes. Miseratus fonte Ditis conubia.\n"},{"id":12,"href":"/docs/shortcodes/details/","title":"Details","section":"Shortcodes","content":" Details # Details shortcode is a helper for details html5 element. It is going to replace expand shortcode.\nExample # {{% details \u0026#34;Title\u0026#34; [open] %}} ## Markdown content Lorem markdownum insigne... {{% /details %}} {{% details title=\u0026#34;Title\u0026#34; open=true %}} ## Markdown content Lorem markdownum insigne... {{% /details %}} Title Markdown content # Lorem markdownum insigne\u0026hellip;\n"},{"id":13,"href":"/docs/shortcodes/hints/","title":"Hints","section":"Shortcodes","content":" Hints # Hint shortcode can be used as hint/alerts/notification block.\nThere are 3 colors to choose: info, warning and danger.\n{{% hint [info|warning|danger] %}} **Markdown content** Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa {{% /hint %}} Example # Markdown content\nLorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa\nMarkdown content\nLorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa\nMarkdown content\nLorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa\n"},{"id":14,"href":"/docs/shortcodes/mermaid/","title":"Mermaid","section":"Shortcodes","content":" Mermaid Chart # MermaidJS is library for generating svg charts and diagrams from text.\nOverride Mermaid initialization config\nTo override the initialization config for Mermaid, create a mermaid.json file in your assets folder!\nExample # {{\u0026lt; mermaid [class=\u0026#34;...\u0026#34;] \u0026gt;}} stateDiagram-v2 State1: The state with a note note right of State1 Important information! You can write notes. end note State1 --\u0026gt; State2 note left of State2 : This is the note to the left. {{\u0026lt; /mermaid \u0026gt;}} stateDiagram-v2 State1: The state with a note note right of State1 Important information! You can write notes. end note State1 --\u003e State2 note left of State2 : This is the note to the left. "},{"id":15,"href":"/docs/shortcodes/section/","title":"Section","section":"Shortcodes","content":" Section # Section renders pages in section as definition list, using title and description. Optional param summary can be used to show or hide page summary\nExample # {{\u0026lt; section [summary] \u0026gt;}} First Page First page # Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\nSecond Page Second Page # Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n"},{"id":16,"href":"/docs/shortcodes/section/first-page/","title":"First Page","section":"Section","content":" First page # Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\nDuis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\n"},{"id":17,"href":"/docs/shortcodes/section/second-page/","title":"Second Page","section":"Section","content":" Second Page # Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\nDuis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\n"},{"id":18,"href":"/docs/shortcodes/tabs/","title":"Tabs","section":"Shortcodes","content":" Tabs # Tabs let you organize content by context, for example installation instructions for each supported platform.\n{{\u0026lt; tabs \u0026#34;id\u0026#34; \u0026gt;}} {{% tab \u0026#34;MacOS\u0026#34; %}} # MacOS Content {{% /tab %}} {{% tab \u0026#34;Linux\u0026#34; %}} # Linux Content {{% /tab %}} {{% tab \u0026#34;Windows\u0026#34; %}} # Windows Content {{% /tab %}} {{\u0026lt; /tabs \u0026gt;}} Example # MacOS MacOS # This is tab MacOS content.\nLorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa protulit, sed sed aere valvis inhaesuro Pallas animam: qui quid, ignes. Miseratus fonte Ditis conubia.\nLinux Linux # This is tab Linux content.\nLorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa protulit, sed sed aere valvis inhaesuro Pallas animam: qui quid, ignes. Miseratus fonte Ditis conubia.\nWindows Windows # This is tab Windows content.\nLorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa protulit, sed sed aere valvis inhaesuro Pallas animam: qui quid, ignes. Miseratus fonte Ditis conubia.\n"},{"id":19,"href":"/docs/shortcodes/katex/","title":"KaTeX","section":"Shortcodes","content":" KaTeX # KaTeX shortcode let you render math typesetting in markdown document. See KaTeX\nExample # {{\u0026lt; katex display=true \u0026gt;}} f(x) = \\int_{-\\infty}^\\infty\\hat f(\\xi)\\,e^{2 \\pi i \\xi x}\\,d\\xi {{\u0026lt; /katex \u0026gt;}} \\[ f(x) = \\int_{-\\infty}^\\infty\\hat f(\\xi)\\,e^{2 \\pi i \\xi x}\\,d\\xi \\] Display Mode Example # Here is some inline example: \\(\\pi(x)\\) , rendered in the same line. And below is display example, having display: block \\[ f(x) = \\int_{-\\infty}^\\infty\\hat f(\\xi)\\,e^{2 \\pi i \\xi x}\\,d\\xi \\] Text continues here.\n"}]