Testing goals

WKB4J's are focused on three area: functionnality, performance and robustness.

  1. Performance: there are a test for each supported toolkit that compare the performance of WKB4J against the performance of the native WKT parser.
  2. Functionnality: Objects converted from WKT and from WKB should be identical. Those tests make sure that this is the case. PostGIS and JTS have can natively construct geometries out of the WKT format, but OpenMap cannot. In this case, the test relies on a third-party class.
  3. Robustness: each test is run several times and WKB4J is used in several commercial projects.

The performance tests checks the speed of the whole workflow, so a PostGIS DB is necessary. The functionnal tests also pulls data from the DB, but I'm planning to distribute test objects containing both the WKB and the WKT version of the record. Thus you would be able to test that this aspect without a DB.

Running

In order to run the test, you should follow this process:

  1. Download and extract the WKB4J distribution and the test datasets somewhere on your disk.
  2. Download and install Maven, if you do not have it already.
  3. Load the test dataset in your database.
  4. Run maven junit in order to start the test.
The tests take a while to complete, so please be patient.

Test Datasets

All the datasets used to test WKB4J are available on the website, in the file release system . They are all in the public domain and freely distributable. If you think that one of them isn't in the public domain, please drop me an email.

These datasets tries to cover all the features of WKB4J. However, if you have a shapefil e that does not work with WKB4J, I would really like to hear about it so WKB4J can be fixed.

Name Shape types Description URL
i-2294_dd MultiPolygons and MultiLineString Geologic Map of East Mangala Valles Region of Mars http://webgis.wr.usgs.gov/...
usa MultiPolygon State boundaries and coastline http://pubs.usgs.gov/...
Tiger/Line: Jefferson County, CO MultiPolygons, MultiLineString and Points. Roads, streets, rivers, areas and locations. http://www.esri.com/...

I would like to thanks the people that release good datasets in the Public Domain, and especially the ones that decided that data produced by the American Governement would be released as such. Other countries should follow suits: it spurs a huge amount of innovation.

Using the Test databases

A few steps are required before you can use the test data.

Creating the database (in all cases you will need write access to the database):

  • Install Postgis: refer the documentation.
  • createdb dbname
  • createlang plpgsql dbname
  • psql -d dbname -f postgis.sql
Now you must load the data in the database using shp2pgsl and psql. Alternatively, you can use the submitted shapeloader.sh script.