1 / 24

Using XML for Legends and Map Surround

Learn how to use XML to create legends and map surrounds in digital mapping. Understand the structure and syntax of XML files, create XML files using editors or scripts, and validate XML files against schemas. Also, explore the process and integration of electronic publication and extraction of information from databases to XML. Finally, see a demo of using XML for designing and drawing legends in ArcMap.

bcrawley
Download Presentation

Using XML for Legends and Map Surround

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Using XML for Legends and Map Surround DIGITAL MAPPING TECHNIQUES 2005 By Vic Dohar Natural Resources Canada

  2. What is XML? • Stands for Extensible Mark-upLanguage • Standard mark-up language similar to HTML • HTML designed to display data • XML designed to describe data/information • Text based. Simple to read/understand • XML does not do anything. It is a document with a defined structure to store/share data with applications

  3. What Constitutes an XML File? • An XML file contains tags, optional tag attributes, and a value or data between tags • You must define your own tags, they are not predefined • The syntax is simple yet strict. Some rules are: • All XML documents must contain a declaration and one unique root element • All elements must have matching start and end tag • Tags are case sensitive • All elements must be properly nested • Tag attribute values must always be quoted

  4. Well Formed XML • An XML file is said to be “well formed” when none of the syntax rules are broken <Paper> <Title>Using XML for Legends and Map Surround</Title> <Author>VicDohar</Author> <Organization>Natural Resources Canada</Organization> </Paper>

  5. How do You Create XML Files? • Edit XML files with XML editors. Some are simple, some are loaded with rich functionality • Peter’s XML Editor (simple and free) • XMLSpy by Altova (rich, $$$ license) • www.xmlsoftware.com/editors.html • Most cases you write scripts that create XML files by referencing the XML Document Object Model (DOM)

  6. XML Schemas • Schemas define the structure/elements, legal building blocks of an XML document • Defines elements, attributes • Child elements • Number and order of elements • Data types for elements • Schemas are saved as XSD documents • XML files are validated against XSD • Write XSD in XML or use application

  7. Sample XSD

  8. XML Sources • W3 Schools • Microsoft Development Network (MSDN)

  9. Publication Process and Integration • Electronic publication processing system database to manage and track publications (reports, bulletins, maps) through the various production stages • Paperless trail utilizing on-line forms • Steps and checks along the way including editorial reviews, quality control, plotting • Extract information (metadata) from Oracle database to XML for map surround info

  10. <PublicationInformation> <Authors> <Author> <Surname>Smith</Surname> <Initial>L</Initial> </Author> </Authors> <Language>english</Language> <Bilingual>no</Bilingual> <Publication> <Series>A-seriesmap</Series> <Number>2059</Number> <Title>Sandilands</Title> </Publication> <Map> <Feature>surficial geology</Feature> <Coverage> <District></District> <Province>Manitoba<\Province> <\Coverage> <ScaleDenominator>100000</ScaleDenominator> </Map> </PublicationInformation> Sample XML File FromDatabase

  11. Surround Information • VBA application in ArcMap reads XML file and plots title block and recommended citation accordingly • Reduces errors and omissions • Provides consistent rendering of data adhering based on design specifications • Design specifications stored in an additional XML file

  12. Sample Title Block

  13. <?xml version="1.0" encoding="UTF-8"?> <!--XML based paper map element placement specs--> <CartographicMapElementPlacementStandards xmlns="http://www.nrcan.gc.ca/ess/carto/english/reference/gems/"> <TitleBlock xmlns=""> <Rules></Rules> <MapType> <HorizontalAlignment>HaCenter</HorizontalAlignment> <VerticalAlignment>VaBaseline</VerticalAlignment> <Font> <FontName>Arial</FontName> <FontStyle>Regular</FontStyle> </Font> <FontSize units=“points”>10</FontSize> <Colour> <Cyan>0</Cyan> <Magenta>0</Magenta> <Yellow>0</Yellow> <Black>100</Black> </Colour> <LineSpacing units = “points”>18</LineSpacing> <Indent units=“picas”>0</Indent> </MapType> <Feature> Design Specs XML File

  14. Geological Legends

  15. Geological Legends Using XML • Proposed procedure with ArcMap • Content of legend in Word, paragraphs formatted according to predefined styles • Export Word to XML, validating to Legend Content XSD • In ArcMap, execute VBA script to read XML file and draw legend, utilizing two additional XML files: • XML file for design specifications • XML file for legend layout and placement

  16. Demo • Edit legend document in Word • Convert Word document to XML • Draw legend in ArcMap

  17. Future • Complete it! • Extend legend to include symbols used on map • It will be made available to download for free on our websitewww.nrcan.gc.ca/ess/cartoclick on Toolbox, click on ArcGIS Migration

  18. Demo: Notes • Format paragraphs • Content is important • Formatting appearance is only a visual aid in Word • Word document can be pre-processed by editorial staff for accuracy

  19. Demo: Legend in Word

  20. Demo: Convert XML

  21. Demo: View XML File

  22. Demo: ArcMap

  23. Demo: Not Just For Legends

More Related