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.
.png)
.png)
After downloading and unpacking the archive, I got three jar-files.
.png)
.png)
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.
.png)
.png)
.png)
.png)
Map builder needs a connection to a database which stores map data. I don't think that creation of a connection needs any comments.
.png)
.png)
.png)
.png)
.png)
.png)
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
.png)
Geometry Themes
node and create a new theme..png)
The name of my theme is "Cities" and it use the
.png)
POINTS
table..png)
Now I need to define the appearance of the theme.
.png)
.png)
As this is a theme for points, I choose the "Marker" style. .png)
.png)
All predefined styles are stored in the
.png)
MDSYS
schema..png)
There are only a few markers predefined, but I need only one for this time.
.png)
.png)
M.TOWN_HALL
for example..png)
.png)
I want all the cities to be labelled with names so I choose labels style and attribute for labels.
.png)
.png)
And the last thing to do. The
.png)
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..png)
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.
.png)
.png)
To see how the layer looks like, open the "Preview" tab and click green play button.
.png)
.png)
.png)
.png)
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.
.png)
![]()
.png)
The cause of this error is the absence of a spatial index. A 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
.png)
place
field is indexed..png)
I created two more geometry themes. One for a country border. It's based on the
.png)
.png)
MULTYPOLYGONS
table and styled with line..png)
.png)
Different types of administative regions can be selected with the
.png)
ADMIN_LEVEL
field. Country border has ADMIN_LEVEL='2'
..png)
And one more theme is
FEDERAL_LAND
. It's also built on the MULTYPOLYGON
table, but its ADMIN_LEVEL='4'
.
Now I have everything to create a very simple map of Germany. Right-click on the "Base map" node, select
.png)
create
..png)
Give a name to the map.
.png)
.png)
Add all themes to the map.
.png)
.png)
.png)
.png)
.png)
.png)
There are parameters that should be tweaked in the real life, but I leave defaults for this time.
.png)
.png)
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.
.png)
.png)
I'll show how to setup Oracle Mapviewer 12c to work with this map in the next post.
ليست هناك تعليقات:
إرسال تعليق