Archive for the 'MapXtreme' Category

Customer User Sites for Location Intelligence on PBBI website

Check out how mapping applications based on technology from Pitney Bowes Business Insight and is being used by customers around the world, from local governments to major communication companies.

Customer Sites – http://www.pbinsight.com/resources/customer-sites

Customers have embraced Location Intelligence by publishing information on assets and services in a geographic context. See examples of spatially enabled web applications using PBBI’s Location intelligence solutions and how Pitney Bowes Business Insight customers are using these products to provide a richer web experience for their site visitors.

Come back often as this landing page is designed to be dynamic with new sites being added regularly!

Envinsa: Logging REST Requests

by Minna Lunney

For logging SOAP-based requests, Envinsa provides powerful built-in configuration options accessible through the Enterprise Manager.  REST API requests can also be logged, but this must be done through a separate mechanism: namely, by enabling access logging for the application server in use.

Here is an example of configuring access logging within Tomcat, the default application server for Envinsa.

1) Shut down the Tomcat that contains the REST service for which logging is desired.

2) Browse to the Tomcat’s conf folder, and open server.xml.

3) Scroll down to the Host element.  Somewhere within the Host element, either add or uncomment a Valve element to define an access log.  For example:

<Host name=”localhost” appBase=”webapps”

unpackWARs=”true” autoDeploy=”true”

xmlValidation=”false” xmlNamespaceAware=”false”>

<!– Other items here –>

<Valve className=”org.apache.catalina.valves.AccessLogValve”

directory=”logs”  prefix=”localhost_access_log.” suffix=”.txt”

pattern=”%t %s %b %D %r”/>

<!– Other items here –>

</Host>

The directory attribute specifies where to store the access log.  The prefix and suffix attributes define what the beginning and end of the log file name should be.  A timestamp will be automatically inserted in between (ex. localhost_access_log.2010-02-02.txt).

The pattern attribute holds a list of strings that define what information to record in each log entry.  The pattern specified in the example above, when used in conjunction with the MapTiling service, produces a log entry that looks like this:

[02/Feb/2010:13:21:55 -0500] 200 79 516 GET /MapTiling/RESTService/getMaps?output=json HTTP/1.1

The available pattern strings are discussed here:

http://tomcat.apache.org/tomcat-5.5-doc/catalina/docs/api/org/apache/catalina/valves/AccessLogValve.html

Additional attributes for the AccessLogValve class are discussed here:

http://tomcat.apache.org/tomcat-5.5-doc/config/valve.html

4) Save and close server.xml.

5) Restart Tomcat.

For access logging in other commonly used application servers, please refer to the following resources.

WebLogic: http://download.oracle.com/docs/cd/E13196_01/platform/docs81/admin/admin.html#1072571

WebSphere: http://publib.boulder.ibm.com/infocenter/wasinfo/v5r1//index.jsp?topic=/com.ibm.websphere.base.doc/info/aes/ae/tcfg_intserver_access.html


MapXtreme Java: Improving Performance When Using a Database

by Minna Lunney

Anyone familiar with Java database connectivity (JDBC) knows that this powerful functionality often comes at a price, in the form of decreased application performance.  The steps required to retrieve information from a database (e.g. log in/connect, perform query, retrieve records, return records) tend to be more numerous and time-intensive than the steps required to retrieve the same information from a file stored on the local machine.

The following are performance-boosting tips specifically geared toward database interaction in MapXtreme Java.

Use Connection Pooling

Establishing a connection to a database takes time and resources.  A program that has to access a database several times is quickly bogged down if forced to create a new connection for each “trip.”  With a connection pool, you create database connections that are then recycled by your program and other users/processes that may need them.  For more information about connection pooling, please refer to Chapter 11 in the MapXtreme Java Developer Guide: http://reference.mapinfo.com/software/mapxtreme_java/english/4_8_2/dev_guide/MapXtremeJavaDeveloperGuide.pdf

Prior to following the directions in the above documentation, you will need to perform these steps to ensure MapXtreme Java can connect to your database:

1) Shut down the MXJ server and quit the Web/StandAlone Manager(s), if necessary.

2) Locate or download the appropriate JDBC driver for your database.  If the driver is in .zip format, change its extension to .jar.

3) Copy the database driver to the following locations:

- [MXJ_Home]/lib/client

- [MXJ_Home]/[Tomcat folder]/webapps/mapxtreme[ver]/WEB-INF/lib

4) Browse to [MXJ_Home]/bin. Modify both the StandAlone and Web .lax files to include your driver in the classpath (the lax.class.path variable at the top of the file).  Follow the same forward- and backslash convention that is used for the other .jar files in the classpath, and separate each entry with the proper delimiter.  As an example for Windows:

lax.class.path=C:\\MXTJ482/MapXtreme-4.8.2/lib/client;C:\\MXTJ482/MapXtreme-4.8.2/lib/client/ojdbc14.jar;C:\\MXTJ482/MapXtreme-4.8.2/lib/client/mxjclient.jar;

….

The changes will take effect the next time you start the Manager(s) and/or MXJ server.

Specify Table Metadata

When retrieving a map table from a database, MapXtreme Java requires some basic information about the table, such as its coordinate system, spatial column, and rendition columns (if any).  This information is referred to as “table metadata.”  If you don’t supply metadata, MapXtreme Java will query the MAPINFO.MAPINFO_MAPCATALOG table in your database to obtain it, which adds to the time and resources required to retrieve the database table.

There are two ways to manually provide MapXtreme Java with the table’s metadata.  If you’re accessing the table through the MapXtreme Java Manager’s Add Layer Wizard, you can supply the metadata on the “Specify Other Table or Query Information” screen.  Click Use the following settings and fill in as many of the fields as possible before clicking Next.

java1

Programmatically, you can provide metadata to the constructor of the TableDescHelper.  For example:

// Table information
String[] idColumns = {"mi_prinx"};
String table = "States";
boolean bUseQuotes = false;
String spatialCol = "GEOLOC";
String rendCol = null;
RenditionType perFeatureType = RenditionType.none;
String labelRendCol = null;
RenditionType perFeatureLabelType = RenditionType.none;
CoordSys csys = CoordSys.longLatWGS84;
int dimensions = 2;
String owner = "mary";
// Create a TableDescHelper
OraSoTableDescHelper tableTDH = new OraSoTableDescHelper(table,
 bUseQuotes, idColumns, spatialCol, rendCol, perFeatureType,
labelRendCol, perFeatureLabelType, csys, dimensions, owner);

Use Zoom and Visibility Constraints

By default, when displaying a map layer, MapXtreme Java will retrieve all records from the table, even if you are only viewing a portion of the layer.  Every time the map is operated on- pan, zoom in/out- MXJ will again retrieve all the features from the table before rendering the modified view.  When the map layer comes from a database, this can result in slow performance as potentially hundreds or thousands of records are returned each time the map is manipulated.  By setting zoom constraints on a layer, you limit MXJ to retrieving just those records that fall within the specified zoom range, and to retrieving no records if the map layer is not visible within a given map view.

Within the MapXtreme Java Manager, you can adjust zoom constraints by selecting the database layer within Layer Control, and clicking the Display button.  On the tab that appears, check Display within Zoom Range, enter the desired visibility range and distance units, and click OK.

java3

Programmatically, you can use the following methods of the FeatureLayer class to control a database layer’s visibility:

FeatureLayer dbLayer = (FeatureLayer) myMapJ.getLayers().get(“DB_LAYER”);
dbLayer.setZoomLayer(true);
dbLayer.setMinZoom(new Distance(0, LinearUnit.mile));
dbLayer.setMaxZoom(new Distance(10, LinearUnit.mile));

Use QueryParams – Retrieve Only the Attributes You Need

When performing a search against a database table, the QueryParams class gives you control over the type and quantity of data retrieved.  For example, you may only need to retrieve the value of the “Name” column for each feature, in which case returning all columns and geometries would be overkill.  You can specify your search as attribute-only, geometry-only, or some combination thereof.  The more specific you make your return criteria, the better the search will perform.  For more information about the use of this class, please refer to Chapter 12 of the MXJ Developer Guide:

http://reference.mapinfo.com/software/mapxtreme_java/english/4_8_2/dev_guide/MapXtremeJavaDeveloperGuide.pdf

Also helpful are the MXJ Javadocs: http://reference.mapinfo.com/software/mapxtreme_java/english/4_8_2/docs/api/index.html

Use Pass-Through Queries – Retrieve Only the Records You Need

When loading a database table, you can limit which features and attributes are retrieved with the use of a pass-through query.  For example, SELECT ID, Name, MI_GEOMETRY, Population FROM myuser.world WHERE Population > 100000000.

When using the MapXtreme Java Manager, a pass-through query can be specified within the Add Layer Wizard:

java4

Programmatically, a query can be defined within the constructor for the table’s TableDescHelper:

String sql = "SELECT SW_MEMBER, Longitude, Latitude, FROM Addresses WHERE Outfirm='OFFICE BLDG'";
CoordSys coordsys = CoordSys.longLatWGS84;
String[] idColumns = {"SW_MEMBER"};
XYTableDescHelper xyTDH = new XYTableDescHelper(sql,
 idColumns, "Longitude", "Latitude", null, RenditionType.none,
null, RenditionType.none, coordsys);

For more information, see Chapter 12 in the MXJ Developer Guide: http://reference.mapinfo.com/software/mapxtreme_java/english/4_8_2/dev_guide/MapXtremeJavaDeveloperGuide.pdf

Use QueryBuilders

If you wish to search a database table that has been defined by a pass-through query (as discussed above), you must associate an instance of the QueryBuilder class with the table.  The QueryBuilder can refine your search and limit the amount of information that is retrieved.  Sample QueryBuilder classes are provided in the examples/client/querybuilders directory on a default MXJ install.  You can use these classes directly, or implement your own QueryBuilder class to suit your specific needs.  More information is available in Chapter 12 of the MXJ Developer Guide:

http://reference.mapinfo.com/software/mapxtreme_java/english/4_8_2/dev_guide/MapXtremeJavaDeveloperGuide.pdf

Use Database Indexes

Creating indexes within the database from which mapping data will be retrieved will improve the performance of all database operations.  For instructions on creating an index, please consult the documentation for your specific database(s).

Keep Layers Simple

Tables with complex geometries will be more resource-intensive than tables that contain simpler geometries.  If possible, use MapInfo Professional to perform snap/thin operations on complex features before uploading a table to your database.  Directions for feature thinning in MapInfo Professional can be found in this Knowledge Base document: http://testdrive.mapinfo.com/techsupp/miprod.nsf/kbase_by_product/C04149D2C49B7AE185256AAB006E0349

For more information on how MapInfo Professional can be used to streamline tables, please refer to the MIPro User Guide: http://reference.mapinfo.com/software/mapinfo_pro/english/10/MapInfoProfessionalUserGuide.pdf

Out in front of the GIS Wave

By Jon Winslow, Global Portfolio Director, Location Intellgence

When MapInfo began knocking on doors with the world’s first desktop GIS in 1986, few business managers understood the concept of geo-spatial analysis or the power of LI (location intelligence).

Today, GIS technology is pervasive in society. Thirty-one percent of Americans own a portable navigation device. iPhone apps use GPS coordinates to find nearby restaurants.  You can hardly find a business website that doesn’t provide a link to an online map and driving directions. And four years since its release, Google Earth has been installed on over 500 million machines.

As for the future, industry experts predict that the GIS market will grow 50% within the next five years.

For business analysts, IT heads and developers who have relied on sophisticated location intelligent solutions for years, this sudden burst of GIS activity in the consumer market has its pros and cons.

  • On the one hand, business executives and financial officers who must approve and fund LI initiatives have personal experience with mapping and spatial analysis.  Discussions can quickly move from concept to concrete application as everyone has some familiarity with the underlying technology.
  • On the other hand, these same executives think they know what location intelligence is based on their experience with simple consumer applications – they often don’t understand what could be done with a business-strength solution.  After all, you can just download maps for free, correct?

Professionals understand that location intelligent technology does not necessarily equate to business intelligence.  So in a world where a bit of information can be dangerous, GIS experts must in some cases work harder to demonstrate the value of their work.

A few weeks ago, I had the pleasure of speaking with many such professionals at the AGI GeoCommunity conference in the United Kingdom.  When you are around people who understand that the hot, new “find the nearest” app making headlines today is really ho-hum ten-year-old technology, it gets you that much more energized about the leading-edge innovations that are making spatial analysis so much more valuable to business today.

These experts, who are out in front of the current GIS wave, have their eye on emerging technologies and incremental improvements that provide significant advantages. Depending on their role and responsibilities, business users are excited about what today’s advanced technology can deliver: more power, greater simplicity, increased flexibility and greater control.

  • The Professional. High-end users that need to create and analyze data see 3-D visualization as a potent tool, especially when you can combine satellite imagery with complex, proprietary geo-data. The ability to instantly access and analyze stores, markets and trading areas – overlay large number of polygons – and color code areas based on revenue, demographics, proximity and penetration, for example, generates insights that lead to better, more profitable decisions. In a word, they are excited about the power.
  • The Enterprise Planner. As business intelligence takes on a more important role across business functions, everyone is looking for fast, effective ways to install Web solutions.  Today’s newest technologies are driven by the same sophisticated spatial analysis engines that companies have relied on for their most important decisions.  Through RIA and tiling, they offer an intuitive, out-of-the box experience that is as simple and stylish as any of the consumer-driven apps.  Providing user-friendly access to complex LI tools is only getting easier.

  • The Developer. Individuals responsible for custom solutions and LI augmentation see advances in both functionality and flexibility. While some developers are loyal to their favorite API, they are finding that more advanced geo-spatial programs are being created to fit their expertise. Built using open-source technology, developers can easily add to and adapt these solutions without the risks of a pure home-grown application. In practice, that means a simple API designed to route trucks, for example, can be easily enhanced, edited, data-enabled or embedded into desktops and mobile devices.
  • The Data Manager. As 70% of all business data contains a geographic component, data stewards are looking for ways to help people access high volumes of geo-data without losing control. Now, location intelligence solutions make it easy to access data where it is stored, whether that’s Oracle, SQL Servers, flat files, etc., and users can manage, access and administer information through queries that do not disrupt the underlying data integrity or governance principles.

While these emerging technologies and incremental improvements mean little to the soccer mom who simply needs directions to the next away game, the value of true location intelligence has never been more appreciated than today.  For organizations dealing with complex challenges, this additional power, simplicity, flexibility and control translates into lower costs, improved customer satisfaction and profitable growth.

Are you out in front of the GIS wave?  Learn more about the latest solutions – and be sure to let us know what trends, technologies and applications interest you most.


Integrate MapXtreme with Virtual Earth and Google Maps

I have been researching the best practices with tile servers and how to integrate real cartographic analysis into tile based RIA applications. The results are very interesting with respect to several limitations and also quality.

Tile based RIA applications are becoming more prevalent in the web community because of their responsiveness and flexibility. The current implementations are based on simple APIs, this is excellent for rapid prototyping and creating a site quickly. But it also limits the application when it comes to real data analysis.

In the February MapXtreme Users Group (MUG) we discuss how PBBI products can act as a tile provider and data analysis engine for tile base RIA applications. The talk goes into some of the details and limitations of the current MashUp type RIA application and describes a more complete architecture that allows complex data analysis and how to produce better cartographic maps. Check out the recorded session as well as other MapXtreme recorded sessions and slides at:

http://www.mapinfo.com/mug

The code and description of the basic architecture are available for download at the PBBI Code Exchange:

http://www.mapinfo.com/for-developers/code-exchange

Coming in the May MapXtreme Online User Group  we’ll have a sneak peak at what Engineering has been working on.

We hope to see you there.