Oracle Map builder simple map
Today I'm going to show how to create a very simple map based on the OSM data loaded into a Oracle Database. I use Germany OSM data for this guide.
The root post if this series is: Maps starting post. It has links to other posts of this series.
The first step is to download a Map Builder tool for building a map. It's available on the "Software Downloads for Oracle Fusion Middleware MapViewer" page.
After downloading and unpacking the archive, I got three jar-files.
The only tool I use in this post is mapbuilder.jar. You need java installed to run it. It's possible to run it either by double-clicking or using a command line, depending on your machine setup.
Map builder needs a connection to a database which stores map data. I don't think that creation of a connection needs any comments.
In the real life, I'd start with defining some styles for lines, and polygons, and markers. But it would make this post too big. So I use predefined styles, although they aren't nice.
I'll create a layer with German cities. Right click on the "Geometry Themes" node and create a new theme.
The name of my theme is "Cities" and it use the "POINTS" table.
Now I need to define the appearance of the theme.
As this is a theme for points, I choose the "Marker" style.
All predefined styles are stored in the MDSYS schema.
There are only a few markers predefined, but I need only one for this time. M.TOWN_HALL for example.
I want all the cities to be labeled with names so I choose labels style and attribute for labels.
And the last thing to do. The POINTS table stores all points of all types. Not only cities, but other settlement types, and POIs and other stuff. So I create a filter to select only data on cities.
Not every option is defined by the wizard. There are a lot of other options to define, but it's OK for the first pass.
To see how the layer looks like, open the "Preview" tab and click green play button.
It's possible to get an error at this step. When I try to zoom in I get ORA-13226: interface not supported without a spatial index message.
The cause of this error is an absence of a spatial index. The spatial index should be created for every table. Actually, it's a good idea to create a few non-spatial indexes too. For example, it's much easier to find cities if the "place" field is indexed.
I created two more geometry themes. One for a country border. It's based on the "MULTYPOLYGONS" table and styled with line.
Different types of administative regions can be selected with the "ADMINLEVEL" field. Country border has ADMINLEVEL='2'.
And one more theme is FEDERALLAND. It's also built on the MULTYPOLYGON table, but its ADMINLEVEL='4'.
Now I have everything to create a very simple map of Germany. Right click on the "Base map" node, select create.
Give a name to the map.
Add all themes to the map.
There are parameters that should be tweaked in the real life, but I leave defaults for this time.
And here it is - a simple map of Germany. It's very simple and needs a lot of work to become nice. But even now it is sufficient to visualize some data for cities and federal lands.
I'll show how to setup Oracle Mapviewer 12c to work with this map in the next post.
OBIEE specialist since 2007 and Oracle Discoverer before. DWH architect, BI enthusiast, blogger. Lazy cats owner. All opinions are my own and not the views of my employer.