OpenMap is an Open Source JavaBeans-based programmer's toolkit. Using OpenMap, you can quickly build applications and applets that access data from legacy databases and applications.

Related tags

Geospatial openmap
Overview
$Source: /cvs/distapps/openmap/README,v $
$RCSfile: README,v $
$Revision: 1.11 $
$Date: 2002/11/06 19:11:02 $
$Author: bmackiew $


OpenMap(tm)

What is it?
-----------
OpenMap is a Java Beans based toolkit for building applications and
applets needing geographic information.  Using OpenMap components, you
can access data from legacy applications, in-place, in a distributed
setting. At its core, OpenMap is a set of Swing components that
understand geographic coordinates. These components help you show map
data, and help you handle user input events to manipulate that data.


What are the license terms for using OpenMap?
---------------------------------------------
Take a look at the file called LICENSE in the distribution. We want
you to be able to do pretty much anything with it as long as we get
credit for our work and as long as you offer your changes to us so we
can possibly add them to the standard version we distribute.


OpenMap is a trademark
----------------------
OpenMap is a trademark of BBN Corporation. Just so you're not
confused, BBN Corporation is the legal entity, but we're actually part
of Verizon Communications.  Technically, we do business as "BBN Technologies,
a part of Verizon".

Downloads and home page
-----------------------
The homepage is at http://openmap-java.org/

Downloads of the current distribution are available from the homepage.

Where to start?
------------------------

- OpenMap Viewer

The com.bbn.openmap.app.Main.java example is the default "face" of
OpenMap.  While it looks like a complex example to start with, it's
really a simple framework that uses the MapHandler to add and connect
the OpenMap components.  See the old viewer User's Guide
(http://openmap.bbn.com/doc/user-guide.html) for more information.  You
can check out the com.bbn.openmap.app.OpenMap application class for the older
version of the main example class.

You can write your own components that can display your data in the
OpenMap Viewer.  Once you've written the layer or plugin, all you need
to do is to add a reference to it in your openmap.properties file.
The OpenMap Viewer reads this file to get configuration information.
The properties file has instructions for adding layers and plugins to
the application.  Check out the layers in com.bbn.openmap.layer.learn for
examples and explanations on how to create your own layers.

Likewise, you can change the look of the application by modifying the
openmap.components property in the openmap.properties file.  There are
instructions in the properties file for modifying this property, but
the main point is that changing the application does not require a
code change.  The components are defined in the openmap.properties
file and are connected at runtime.

If you want to get more into how the components interact with each 
other, you should take a look at the example applications in the 
com.bbn.openmap.app.example package, SimpleMap and SimpleMap2

- SimpleMap

This class is a very simple example that shows how you use the MapBean and a
layer which shows a map of the world.  This
com/bbn/openmap/app/example/SimpleMap.java uses the MapBean to
create a static political map in a window with these steps:

       1. Create a JFrame window.
       2. Create a MapBean.
       3. Create the Political boundary Layer
       4. Add the Layer to the MapBean.
       5. Add the MapBean to the ContentPane of the JFrame.
       6. Show the JFrame window.

- SimpleMap2

This com/bbn/openmap/app/example/SimpleMap2.java example is a
little more complicated than the previous one, but is more usable.  It
shows the same political layer along with a background graticule layer
(com/bbn/openmap/layer/GraticuleLayer.java) and a simple foreground
layer (com/bbn/openmap/layer/learn/BasicLayer.java) which shows
hypothetical data features.

The openmap.properties file
------------------------

The OpenMap application is configured at runtime by the contents of
the openmap.properties file. The openmap.properties file is located in
the openmap directory, and has guidance inside it on how to modify
various properties to change a) what components are part of the
OpenMap application, including what layers are available, b) how those
components are configured, and c) the initial map projection used by
the application.

When the OpenMap application starts up, the PropertyHandler object
checks the CLASSPATH to find an openmap.properties file, and then
checks the user's home directory for one. If an openmap.properties
file was found in the home directory, all of its properties get added
to any properties created previously from a CLASSPATH
openmap.properties file. If there are duplicate properties, the last
version read (from the home directory) will be the version used.

By default, there is an openmap.properties file located at the top
level of the openmap.jar file. When the jar file is created, the
openmap.properties file located in the top level openmap directory
gets copied to the classes/openmap directory, and then included into
the openmap.jar file.

If you make modifications to the openmap.properties file, those
changes will not be reflected in the application unless:

1. The top level openmap directory is included in the CLASSPATH of the
   OpenMap application. This can be done by modifying the openmap
   startup scripts located in the bin directory.

2. The openmap.properties file is copied into your home directory. For
   unix users, this directory is usually /home/<username>. For Mac OS
   X users, this directory is /Users/<username>. For Windows users,
   this directory is D:\Documents and Settings\<username>, where D: is
   the disk windows is installed on. If you are not sure where your
   home directory is, you can compile this code into a HomeDir.java
   file and run it:

 public class HomeDir {
 	public static void main(String[] argv) {
 		System.out.println("User home directory is " +
 			System.getProperties().getProperty("user.home"));
 	}
 }

3. You put the openmap.properties file in the top level of the
   openmap.jar file, either by a) recompiling the openmap code, or b)
   unpacking the jar file, replacing the openmap.properties file, and
   repacking the jar file.

The second option is usually the easiest, but your needs may require
one of the other options.

External Dependencies
---------------------

The source code has been broken out into separate directories for code 
that depends on other packages.

- src/openmap and src/ext:  This code should compile without any special packages.
- src/corba: The missing classes can be generated by building with ant.  The idl files
    are used to create the generated class files.
- src/j3d: This code will compile if the Java 3D package is installed.
- src/svg: This code will compile if Batik (v 1.7) is installed.

If you check OpenMap out from svn (instructions on the download page on the website), these 
external packages are included.

Bugs and Problems
---------------------
If you need some help, contact the mailing list at:

	https://groups.google.com/forum/#!forum/openmap-users

The old mailing list at BBN is still available here:

	http://openmap.bbn.com/mailArchives/openmap-users/
	
You can also submit issues at the OpenMap home on github at: 

	https://github.com/OpenMap-java/openmap

Please help out!
----------------
There's much room for improvement of the OpenMap sources.  We are
interested in any changes you make to the core source, or layers you
develop, or other derivative works.

Comments
  • Rotated OMScalingRaster rendered wrong when partially off edge of window

    Rotated OMScalingRaster rendered wrong when partially off edge of window

    I have come across an issue when using an OMScalingRaster object which has a rotation applied. The object sits on an OMGraphicHandlerLayer. When the image is fully in view, it renders correctly. However, when the image is partially off the left or right side of the window (Mercator projection), the shape of the image is distorted - it appears shrunk in one direction and enlarged in the other. If I do not rotate the OMScalingRaster, it works fine when placed partially off-screen, but unfortunately for my application the image needs to be rotated.

    I notice in OMScalingRaster.java that there is a "clever bit" in the scaleTo(Projection) method which checks if some of the image is off-screen, and if so, draws only the visible subset of the image. In order to make this rotated image work properly for me, I have had to subclass OMScalingRaster and remove these lines:

            if (corners == null || corners.size() <= 2) {
                iRect = winRect.intersection(projRect);
            }
    

    and also remove the if block that starts with if (!winRect.contains(projRect)) {.

    This fixes the problem for me, but is obviously not ideal as it is removing a useful feature.

    Do you know if this functionality has been tried before when using a rotated OMScalingRaster?

    I'm not able to share an example direct from our code, but if necessary I will try to create a minimal example to demonstrate this problem.

    opened by ianrenton 8
  • UTM conversion without `java.awt` dependency?

    UTM conversion without `java.awt` dependency?

    We (from the https://github.com/cgeo/cgeo project) are looking for an UTM (MGRS) conversion library which we can use in our Android app (see Issue https://github.com/cgeo/cgeo/issues/1914). After some research we found openmap and tried integrating it in cgeo (see https://github.com/cgeo/cgeo/pull/5823). We successfully converted from latitude/longitude to UTM, but we would also like to parse UTM and convert it to lat/lon. Unfortunately the LatLonPoint class inherits from java.awt.Point2D which is not available on Android. Do you see any possibility to use the UTM conversion code outside of openmap without the java.awt.Point2D dependency? Any suggestion is appreciated. I'll also try to look into the openmap code. Maybe I find a way to accomplish this. Then I'll let you know. Thanks in advance.

    opened by pstorch 7
  • Geo.distanceKM() and Geo.distanceNM() return inconsistent results

    Geo.distanceKM() and Geo.distanceNM() return inconsistent results

    The following JUnit test should pass but it fails because distanceKM and distanceNM return inconsistent results. This is because the constants used to define Length for KM and NM are inconsistent.


    import org.junit.Assert;
    import org.junit.Test;
    
    import com.bbn.openmap.geo.Geo;
    
    public class TestOpenMap {
    
         @Test
          public void testLatLonConversion2() {
            System.out.println("@Test - testLatLonConversion");
    
            double bosLat =   42.366978;
            double bosLon =  -71.022362;
            double sfoLat =   37.615223;
            double sfoLon = -122.389977;
    
    
            double distNM = Geo.distanceNM(bosLat, bosLon, sfoLat, sfoLon);
            System.out.println("distNM: " + distNM);
            double distKM1 = distNM * Geo.METERS_PER_NM / 1000;
            System.out.println("distKM1: " + distKM1);
    
            double distKM2 = Geo.distanceKM(bosLat, bosLon, sfoLat, sfoLon);
            System.out.println("distKM2: " + distKM2);
    
            // from Planet.java
            double wgs84_earthEquatorialRadiusMeters_D = 6378137.0;
            double circumferenceMeters = wgs84_earthEquatorialRadiusMeters_D * 2.0 * Math.PI;
            double wgs84_earthEquatorialCircumferenceNMiles_D = 21600.0;
    
            double circumf_meters_per_nm = circumferenceMeters / wgs84_earthEquatorialCircumferenceNMiles_D;
    
            System.out.println("circumf_meters_per_nm: " + circumf_meters_per_nm);
            System.out.println("Geo.METERS_PER_NM: " + Geo.METERS_PER_NM);
    
            Assert.assertEquals(distKM1, distKM2, 1);
          }
    }
    

    The output from this is:

    @Test - testLatLonConversion
    distNM: 2349.072077502113
    distKM1: 4350.481487533914
    distKM2: 4358.291791737208
    circumf_meters_per_nm: 1855.3248465545596
    Geo.METERS_PER_NM: 1852.0
    
    opened by tdox 5
  • Added tneenot patch about ISO format problem (ASRP, CADRG, USRP) for testing

    Added tneenot patch about ISO format problem (ASRP, CADRG, USRP) for testing

    Instead of providing the patch as a Zip, I forked and patched. The problem is that we got files for which header is not correctly parsed by OpenMap. The consequence is that some fields are appearing as missing such as PRT. This fix handles this case.

    opened by FredPraca 2
  • Trying to import .SHP files from a previously exported ArcGIS map into a graphics layer on Android

    Trying to import .SHP files from a previously exported ArcGIS map into a graphics layer on Android

    The task I wish to perform seems so absurdly simple!  Somebody on one of the 
    ArcGIS forums recommended this product.
    
    The code I've written is very simple (see below).  The first record I read 
    returns the error: Unknown shape type: 13.
    
    Here's my code (and I'm attaching my .shp file):
    
            SpatialReference lSR = mapView.getSpatialReference();
            Envelope lEnvolope = mapView.getLayer(0).getFullExtent();
            GraphicsLayer graphicLayer = new GraphicsLayer(lSR, lEnvolope);
    
            try {
                File file = new File(shpfile);
                ShapeFile shp = new ShapeFile(file);
                SimpleMarkerSymbol c_point = new SimpleMarkerSymbol(Color.RED, 2, SimpleMarkerSymbol.STYLE.CIRCLE);   
                ESRIPointRecord e=null;
                boolean failed=false;
                boolean weredone=false;
                try {
                    e = (ESRIPointRecord) shp.getNextRecord();
                } catch (Exception ee) {
                    failed=true;
                }
                while (!weredone) {
                    if(!failed) {
                        graphicLayer.addGraphic(new Graphic(new Point(e.getX(), e.getY()), c_point));
                    }
                    failed=false;
                    try {
                        e = (ESRIPointRecord) shp.getNextRecord();
                        if (e==null) {
                            weredone=true;
                        }
                    } catch (Exception ee2) {
                        failed=true;
                    }
                }
               shp.close();
               } catch (IOException e1) {
               e1.printStackTrace();
               }
              return graphicLayer;
            }
    
    
    
    

    Original issue reported on code.google.com by [email protected] on 25 Mar 2014 at 1:46

    Attachments:

    Priority-Medium Type-Defect auto-migrated 
    opened by GoogleCodeExporter 2
  • Added property to disable tile factory reset on layer remove.

    Added property to disable tile factory reset on layer remove.

    Did not alway want the cached tiles removed when the layer was removed. This property will allow the layer to disable clearing the cached tiles. Older versions of OpenMap did not remove the cache on remove and this is a desirable feature.

    opened by kevinator56 1
  • fixed an issue with the map tiles not being reloaded.

    fixed an issue with the map tiles not being reloaded.

    When local map tiles change the ImageIcon does not reload the underlying image. Calling flush on the image will clear the underlying resources, so the next time the file is load it will re-read the image.

    opened by kevinator56 1
  • Extracted the min and max zoom levels to protected methods.

    Extracted the min and max zoom levels to protected methods.

    We needed the ability to allow for higher zoom levels at least down to 22. AbstractMapTileCoordinateTransform had the limitation on max zoom level to 20, this change allows me to define my custom Coordinate Transform class and override the max zoom level as needed.

    opened by kevinator56 1
  • PanMouseMode does not render the buffered map image correctly when the top edge of the projection is at or above Lat 90

    PanMouseMode does not render the buffered map image correctly when the top edge of the projection is at or above Lat 90

    In the class PanMouseMode, line 253, in method mousePressed. the paintedImage is set to paintedImage = new OMRaster(ul.getY(), ul.getX(), 0, 0, bufferedMapImage); if the ul.getY() call returns "90" then the image will not be rendered for some reason. Changing that line to this solves the problem and everything renders as expected: paintedImage = new OMRaster(ul.getY() < 90 ? ul.getY() : 89.9999999999, ul.getX(), 0, 0, bufferedMapImage);

    opened by kwg1990 1
  • Bug in DMSLatLonPoint.equals

    Bug in DMSLatLonPoint.equals

    Method equals is:

        public boolean equals(Object obj) {
            if (obj == null) {
                return false;
            }
            if (getClass() != obj.getClass()) {
                return false;
            }
            final DMSLatLonPoint pt = (DMSLatLonPoint) obj;
            return (pt.lat_isnegative == lat_isnegative
                    && pt.lat_degrees == lat_degrees
                    && pt.lat_minutes == lat_degrees
                    && pt.lat_seconds == lat_seconds
                    && pt.lon_isnegative == lon_isnegative
                    && pt.lon_degrees == lon_degrees
                    && pt.lon_minutes == lon_minutes
                    && pt.lon_seconds == lon_seconds);
        }
    

    The comparison for lat_minutes is wrong, should be:

        public boolean equals(Object obj) {
            if (obj == null) {
                return false;
            }
            if (getClass() != obj.getClass()) {
                return false;
            }
            final DMSLatLonPoint pt = (DMSLatLonPoint) obj;
            return (pt.lat_isnegative == lat_isnegative
                    && pt.lat_degrees == lat_degrees
                    && pt.lat_minutes == lat_minutes
                    && pt.lat_seconds == lat_seconds
                    && pt.lon_isnegative == lon_isnegative
                    && pt.lon_degrees == lon_degrees
                    && pt.lon_minutes == lon_minutes
                    && pt.lon_seconds == lon_seconds);
        }
    
    opened by jflecomte 1
  • Duplicated ImageScaler class

    Duplicated ImageScaler class

    What steps will reproduce the problem?
    1. Locate ImageScaler in com.bbn.openmap.image
    2. Locate ImageScaler in com.bbn.openmap.util
    3. They are the same
    
    What is the expected output? What do you see instead?
    Shouldt need to duplicate code, but it is actually dupped.
    
    
    What version of the product are you using? On what operating system?
    5.1.8b
    
    Please provide any additional information below.
    
    
    

    Original issue reported on code.google.com by [email protected] on 27 Nov 2014 at 12:45

    Priority-Medium Type-Defect auto-migrated 
    opened by GoogleCodeExporter 1
  • Incorrect Action Executed In OMList.doAction()

    Incorrect Action Executed In OMList.doAction()

    In the OMList.doAction() method the OMGraphicConstants.LOWER_TO_BOTTOM_GRAPHIC_MASK action calls the moveIndexedOneToBottom() method instead of moveIndexedToBottom().

    Both OMGraphicConstants.LOWER_TO_BOTTOM_GRAPHIC_MASK and OMGraphicConstants.LOWER_GRAPHIC_MASK currently perform the same action to moveIndexedOneToBottom().

    I verified that correctly calling moveIndexedToBottom() when the mask is set to OMGraphicConstants.LOWER_TO_BOTTOM_GRAPHIC_MASK works as expected.

    The issue exists in the currently available download version, OpenMap 5.1.15.

    The correction is the following inside the OMList.doAction() method:

    if (action.isMask(LOWER_TO_BOTTOM_GRAPHIC_MASK)) {
        Debug.message("omgl", "OMGraphicList.doAction: lowering graphic to bottom");
        moveIndexedToBottom(i); // -> Corrected by Jose M. Torres
    }
    
    opened by jose-m-torres 1
  • Adding bilinear interpolation algorithm for elevation determination

    Adding bilinear interpolation algorithm for elevation determination

    This is not a fix for any particular issue. We added a bilinear interpolation algorithm similar to that used in computer graphics to determine the elevation at a given point. Contributing if anyone is interested.

    opened by carpenlc 0
  • Inconsistent results from DTEDFrame.interpElevationAt()

    Inconsistent results from DTEDFrame.interpElevationAt()

    The method DTEDFrame.interpElevationAt() is producing unexpected values for the output elevation value. As an example, using a sample DTED2 elevation file and point lat=-14.123 (index=3157.1995) and lon=-68.555 (index=1601.9989) the nearest 4 elevation posts in this dataset are:

    ur = 1513 ul = 1522 ll = 1523 lr = 1515

    Manually calculating a bilinear interpolation shows that the output elevation should be very close to the lower-right elevation post which is 1515 meters, but the resulting value is near the upper-right post (i.e. 1513). The code is not utilizing the lower elevation posts to generate the output interpolated value.

    opened by carpenlc 0
  • Misleading javadoc comment for DTEDFrame.elevationAt

    Misleading javadoc comment for DTEDFrame.elevationAt

    Super-minor issue. The javadoc comments for DTEDFrame.elevationAt() indicate that the result will be the closest SW post. The result is actually the nearest post.

    opened by carpenlc 0
Owner
OpenMap
Development group for the OpenMap Java mapping toolkit
OpenMap
Flexible tool to build planet-scale vector tilesets from OpenStreetMap data in a few hours

Planetiler Planetiler (pla·nuh·tai·lr, formerly named "Flatmap") is a tool that generates Vector Tiles from geographic data sources like OpenStreetMap

On The Go Map 748 Dec 27, 2022
GeoServer is an open source software server written in Java that allows users to share and edit geospatial data

GeoServer is an open source software server written in Java that allows users to share and edit geospatial data. Designed for interoperability, it publishes data from any major spatial data source using open standards.

GeoServer 3k Jan 1, 2023
an open source geocoder for openstreetmap data

photon photon is an open source geocoder built for OpenStreetMap data. It is based on elasticsearch - an efficient, powerful and highly scalable searc

komoot 1.5k Dec 29, 2022
An open-source GIS and remote sensing package

Whitebox Geospatial Analysis Tools This page is related to the open-source GIS Whitebox GAT. If you are instead interested in the stand-alone command-

John Lindsay 170 Apr 5, 2021
Open source routing engine for OpenStreetMap. Use it as Java library or server.

GraphHopper Routing Engine GraphHopper is a fast and memory efficient Java routing engine, released under Apache License 2.0. By default it uses OpenS

GraphHopper 4k Jan 3, 2023
Vector map library and writer - running on Android and Desktop.

Mapsforge See the integration guide and changelog. And read through how to contribute guidelines. If you have any questions or problems, don't hesitat

mapsforge 1k Dec 30, 2022
Vector map library and writer - running on Android and Desktop.

Mapsforge See the integration guide and changelog. And read through how to contribute guidelines. If you have any questions or problems, don't hesitat

mapsforge 1k Jan 7, 2023
The JTS Topology Suite is a Java library for creating and manipulating vector geometry.

JTS Topology Suite The JTS Topology Suite is a Java library for creating and manipulating vector geometry. It also provides a comprehensive set of geo

LocationTech 1.5k Jan 6, 2023
ScalaTest is a free, open-source testing toolkit for Scala and Java programmers

ScalaTest is a free, open-source testing toolkit for Scala and Java programmers.

ScalaTest 1.1k Dec 26, 2022
A legacy-fabric mod that makes minecraft versions older than 1.13 run using LWJGL 3 instead of the legacy LWJGL 2

A legacy-fabric mod that makes minecraft versions older than 1.13 run using LWJGL 3 instead of the legacy LWJGL 2

Zarzel K. Shih 17 Dec 4, 2022
To quickly integrate your applications into the EdgeGallery platform, we provide the toolchain project to help developers quickly modify code and migrate applications to the platform.

Toolchain 工具链 工具链是MEC Developer开发者平台中的一个重要特性,当x86平台的App想要上车ARM平台时,底层的代码不可避免的需要进行修改或重写。 App提供者可以通过MEC Developer开发者平台中集成的工具链进行源代码分析,定位需要修改的源代码并根据指导意见进行修

EdgeGallery 19 Jan 7, 2022
MixStack lets you connects Flutter smoothly with Native pages, supports things like Multiple Tab Embeded Flutter View, Dynamic tab changing, and more. You can enjoy a smooth transition from legacy native code to Flutter with it.

中文 README MixStack MixStack lets you connects Flutter smoothly with Native pages, supports things like Multiple Tab Embeded Flutter View, Dynamic tab

Yuewen Engineering 80 Dec 19, 2022
Apache Camel is an open source integration framework that empowers you to quickly and easily integrate various systems consuming or producing data.

Apache Camel Apache Camel is a powerful, open-source integration framework based on prevalent Enterprise Integration Patterns with powerful bean integ

The Apache Software Foundation 4.7k Dec 31, 2022
Apache Camel is an open source integration framework that empowers you to quickly and easily integrate various systems consuming or producing data.

Apache Camel Apache Camel is a powerful, open-source integration framework based on prevalent Enterprise Integration Patterns with powerful bean integ

The Apache Software Foundation 4.7k Jan 8, 2023
Castled is an open source reverse ETL solution that helps you to periodically sync the data in your warehouses and databases to sales, marketing, support or custom apps without any help from engineering teams

Open source reverse-ETL platform to operationalize your data warehouse Introduction Castled is a Reverse ETL solution which enables you to make the va

Castled 314 May 2, 2022
Tuya 37 Dec 26, 2022
Mystral (pronounced "Mistral") is an efficient library to deal with relational databases quickly.

Mystral An efficient library to deal with relational databases quickly. A little request: read the Javadoc to understand how these elements work in de

null 13 Jan 4, 2023
EBQuery allows you to easily access databases through a REST API.

EBQuery Table of Contents Introduction - Enterprise Backend as a Service Requirements Getting started Using EBQuery Features Introduction - Enterprise

null 15 Nov 9, 2021