diff --git a/docs/common.py b/docs/common.py index 034e075bbba..d6a5661dc59 100644 --- a/docs/common.py +++ b/docs/common.py @@ -24,7 +24,7 @@ # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ['sphinx.ext.todo','sphinx.ext.extlinks'] +extensions = ['sphinx.ext.todo','sphinx.ext.extlinks', 'sphinxcontrib.spelling'] extlinks = { 'wiki': ('https://github.com/geotools/geotools/wiki/%s',''), @@ -112,6 +112,11 @@ # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] +# Spelling options + +spelling_lang='en_US' +spelling_show_suggestions=True +spelling_word_list_filename='./spelling/local.dict' # -- Options for HTML output --------------------------------------------------- diff --git a/docs/developer/conventions/code/assumptions.rst b/docs/developer/conventions/code/assumptions.rst index b3416b82810..1121c63bb34 100644 --- a/docs/developer/conventions/code/assumptions.rst +++ b/docs/developer/conventions/code/assumptions.rst @@ -89,7 +89,7 @@ The above code is wrong for two reasons described below: If you are tempted to fetch different coefficients in an affine transform according some conditions, it is worth to take a paper and a pencil, write down the matrix and see if the equations can be written in some form invariant to rotation, flipping or axis swapping. This is often possible and leads to more robust and generic code. - It may sound like paranoiac, but it is not. Old Geotools code was assuming (longitude,latitude) axis order in all cases, for example through unconditional calls to AffineTransform.getScaleX(). It required a great amount of energy from nice volunter in order to handle the (latitude,longitude) axis order as well. Unfortunatly the initial fix for this axis order issue, based on the "Axis Interchange with Modal Code" approach, has just pushed the problem a little bit further away. The code will fails for the next great Geotools step: 3D-Coverage. Users will want to see 2D slices using a wide range axis that are not longitude or latitude. It is better to make the best possible use of affine transform mathematic early than revisiting again the whole Geotools code base as in the "axis order issue" case. + It may sound like paranoiac, but it is not. Old GeoTools code was assuming (longitude,latitude) axis order in all cases, for example through unconditional calls to AffineTransform.getScaleX(). It required a great amount of energy from nice volunter in order to handle the (latitude,longitude) axis order as well. Unfortunatly the initial fix for this axis order issue, based on the "Axis Interchange with Modal Code" approach, has just pushed the problem a little bit further away. The code will fails for the next great GeoTools step: 3D-Coverage. Users will want to see 2D slices using a wide range axis that are not longitude or latitude. It is better to make the best possible use of affine transform mathematic early than revisiting again the whole GeoTools code base as in the "axis order issue" case. Prefer MathTransform over GridRange - Envelope pair ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -101,4 +101,4 @@ In some place of GeoTools API, a MathTransform is inferred automatically from a While the GridRange - Envelope pair seems easier and more intuitive, it is also ambiguous. There is no way to infer a MathTransform from this pair without making some assumptions on axis order and axis reversal. For example GeneralGridGeometry assumes that the y axis must be reversed in order to match the direction used in most screen devices (y values increasing down). Only the constructor with MathTransform argument is unambiguous. -GridRange - Envelope pairs are provided as a convenience for helping users to get their first math transform right in a majority (but not all) cases. From that point, Geotools code should perform all their internal work on MathTransform, never on Envelope. Need to expand an envelope? Compute a scale affine transform and concatenate it with the user math transform. Need to translate, flip or swap axis? Same approach: express your change as an other transform, then concatenate. \ No newline at end of file +GridRange - Envelope pairs are provided as a convenience for helping users to get their first math transform right in a majority (but not all) cases. From that point, GeoTools code should perform all their internal work on MathTransform, never on Envelope. Need to expand an envelope? Compute a scale affine transform and concatenate it with the user math transform. Need to translate, flip or swap axis? Same approach: express your change as an other transform, then concatenate. \ No newline at end of file diff --git a/docs/developer/conventions/code/log.rst b/docs/developer/conventions/code/log.rst index fc175d3a4e7..8ffc3590f20 100644 --- a/docs/developer/conventions/code/log.rst +++ b/docs/developer/conventions/code/log.rst @@ -130,7 +130,7 @@ Provides fairly detailed logging message from the GML module, but not from the r Log4J interoperability ^^^^^^^^^^^^^^^^^^^^^^ -Geotools can produces a console output similar to the Log4J one (single-line instead of multi-line log message) if the following code is invoked once at application starting time:: +GeoTools can produces a console output similar to the Log4J one (single-line instead of multi-line log message) if the following code is invoked once at application starting time:: Logging.ALL.forceMonolineConsoleOutput(); diff --git a/docs/developer/conventions/module.rst b/docs/developer/conventions/module.rst index 8a71b4a0576..35e2690396b 100644 --- a/docs/developer/conventions/module.rst +++ b/docs/developer/conventions/module.rst @@ -1,7 +1,7 @@ Module Directory Structure ========================== -Geotools 2.4 and above complies to the Maven standard layout regarding nested modules; and the layout +GeoTools 2.4 and above complies to the Maven standard layout regarding nested modules; and the layout of source code directories. This section provides a summary of module structure and a examples how we have groupled modules diff --git a/docs/developer/conventions/profile.rst b/docs/developer/conventions/profile.rst index 66ad64bc36b..72bf2629578 100644 --- a/docs/developer/conventions/profile.rst +++ b/docs/developer/conventions/profile.rst @@ -18,7 +18,7 @@ License management YourKit is a commercial product, which provides open source project committers with free licenses. -Geotools PMC has been granted 10 licenses, each one can be used by at most +GeoTools PMC has been granted 10 licenses, each one can be used by at most one developer in a given period of time. Andrea Aime is managing the licenses now, so if you feel like using YourKit for profiling the gt2 source code base please: diff --git a/docs/developer/conventions/refactor.rst b/docs/developer/conventions/refactor.rst index 44096c86b89..6315542be27 100644 --- a/docs/developer/conventions/refactor.rst +++ b/docs/developer/conventions/refactor.rst @@ -16,7 +16,7 @@ This is especially important when using either of the tools at the end of this p Changing public API ^^^^^^^^^^^^^^^^^^^ -Before to refactor a method, make sure that it did not have public access in the previous Geotools release. +Before to refactor a method, make sure that it did not have public access in the previous GeoTools release. * If it was public, then we need to go through a "deprecate, then remove" cycle. * If not was not public, go ahead with with the refactoring. @@ -30,7 +30,7 @@ For example consider the following method:: // Do something } -Suppose that Geotools 2.3 is already released and we are working on Geotools 2.4. Suppose that we want to add a String argument to the above method. Do not refactor this method directly like this: +Suppose that GeoTools 2.3 is already released and we are working on GeoTools 2.4. Suppose that we want to add a String argument to the above method. Do not refactor this method directly like this: WRONG:: @@ -41,7 +41,7 @@ WRONG:: // Do something } -Instead, duplicate the method for at least one Geotools release: +Instead, duplicate the method for at least one GeoTools release: Better:: @@ -63,7 +63,7 @@ Better:: // Do something } -Note the @since 2.4 javadoc tag. It is an important hint for both users and the module maintainer, so do not forget it. The deprecated method can be removed in Geotools 2.5. +Note the @since 2.4 javadoc tag. It is an important hint for both users and the module maintainer, so do not forget it. The deprecated method can be removed in GeoTools 2.5. Keep methods private ^^^^^^^^^^^^^^^^^^^^^ @@ -84,7 +84,7 @@ RefactorIt * and provide code metrics. * More details can be found from the online help. - RefactorIt is commercial, but provides free licences for Open Source projects like Geotools. + RefactorIt is commercial, but provides free licences for Open Source projects like GeoTools. See the RefactorIt web pages for details. It can be plugged into a variety of IDEs, including Netbeans. diff --git a/docs/developer/conventions/test/junit.rst b/docs/developer/conventions/test/junit.rst index 053d59168bb..5582f3a644d 100644 --- a/docs/developer/conventions/test/junit.rst +++ b/docs/developer/conventions/test/junit.rst @@ -15,7 +15,7 @@ The general idea: * create a file test/org/geotools/module/HelloWorldTest.java * any public void methods starting with test will be run by JUnit * maven will run all tests for your module using: mvn test -* tests can be ignored using you pom.xml file +* tests can be ignored using you ``pom.xml`` file * maven will not "release" your module into the repository while it still fails unit testing Example TestCase diff --git a/docs/developer/conventions/test/online.rst b/docs/developer/conventions/test/online.rst index 69a1d85753b..e2edc6b660e 100644 --- a/docs/developer/conventions/test/online.rst +++ b/docs/developer/conventions/test/online.rst @@ -1,7 +1,7 @@ Online Tests ------------ -We make use of a naming convention, ie ensure the name of your TestCase ends in OnlineTest, to indicate the use of external web services and databases. If a unit test requires a network connection to pass, it is an online test. +We make use of a naming convention, i.e. ensure the name of your TestCase ends in OnlineTest, to indicate the use of external web services and databases. If a unit test requires a network connection to pass, it is an online test. These tests will be skipped as part of the normal build process, but will be executed by certain build boxes. diff --git a/docs/developer/conventions/version.rst b/docs/developer/conventions/version.rst index 58d7536d400..985d40ddf34 100644 --- a/docs/developer/conventions/version.rst +++ b/docs/developer/conventions/version.rst @@ -72,7 +72,7 @@ The release process has changed a bit since moving to subversion for details ple @since javadoc tag ^^^^^^^^^^^^^^^^^^^ -Every public and protected class, interface, method or field should have a @since javadoc tag. If the Geotools 2.2 release is under development, then every new API should be identified with a @since 2.2 tag. For the end user, it means that: +Every public and protected class, interface, method or field should have a @since javadoc tag. If the GeoTools 2.2 release is under development, then every new API should be identified with a @since 2.2 tag. For the end user, it means that: * All classes and methods with a @since 2.0 or @since 2.1 javadoc tag are safe. Because they were there is previous releases, they will not change except for bug fixes (a few of them may be deprecated however). diff --git a/docs/developer/docs/tutorial.rst b/docs/developer/docs/tutorial.rst index a1e28713880..7ead885946f 100644 --- a/docs/developer/docs/tutorial.rst +++ b/docs/developer/docs/tutorial.rst @@ -72,7 +72,7 @@ Here is an example template to get you started. and you will have a chance to try out using PostGIS or a Web Feature Server at the end of this example. - 1. Please ensure your pom.xml includes the following: + 1. Please ensure your ``pom.xml`` includes the following: .. literalinclude:: artifacts/pom.xml :language: xml diff --git a/docs/developer/procedures/add.rst b/docs/developer/procedures/add.rst index a559ca8b513..a5b2e1079bc 100644 --- a/docs/developer/procedures/add.rst +++ b/docs/developer/procedures/add.rst @@ -30,7 +30,7 @@ Review a couple of the repository search websites: 1.0.2 -3. Navigate to the root pom.xml for the project and go to the dependency management section. +3. Navigate to the root ``pom.xml`` for the project and go to the dependency management section. Cut and past paste the dependency information here as well:: @@ -40,7 +40,7 @@ Review a couple of the repository search websites: 1.0.2 -3. You can then adjust your pom.xml to not include the version number (as it will be retrieved +3. You can then adjust your ``pom.xml`` to not include the version number (as it will be retrieved from the dependency management section).:: @@ -52,14 +52,14 @@ Review a couple of the repository search websites: Recommended reading on Dependencies ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -If you are not familiar with the way to declare a dependency in a Maven pom.xml file, see "How do I use external dependencies?" in the Maven Getting started guide. More information can also be found in the Guide to deploying 3rd party JARs to remote repository in Maven documentation. +If you are not familiar with the way to declare a dependency in a Maven ``pom.xml`` file, see "How do I use external dependencies?" in the Maven Getting started guide. More information can also be found in the Guide to deploying 3rd party JARs to remote repository in Maven documentation. References: * http://maven.apache.org/guides/getting-started/index.html * http://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html -Our build process does not include jar files inside the subversion repository, instead Maven downloads jar files it needs from remote repositories (web sites). The location of these web sites is specified in the parent pom.xml file, which is inherited by all modules. There are mainly three sites available: +Our build process does not include jar files inside the subversion repository, instead Maven downloads jar files it needs from remote repositories (web sites). The location of these web sites is specified in the parent ``pom.xml`` file, which is inherited by all modules. There are mainly three sites available: * Java.net repository @@ -82,14 +82,14 @@ Our build process does not include jar files inside the subversion repository, i General utility open source projects, especially apache related -Take a look at these sites and some of the "mystery" out of how Maven works. You may notice that the directory structure matches the dependency entries that you see in the pom.xml files. If the dependency entry has a groupId tag then this will be the name of the folder, if it just has an id tag then this will be used for the name of the folder and the jar within it. +Take a look at these sites and some of the "mystery" out of how Maven works. You may notice that the directory structure matches the dependency entries that you see in the ``pom.xml`` files. If the dependency entry has a groupId tag then this will be the name of the folder, if it just has an id tag then this will be used for the name of the folder and the jar within it. It is always worth taking a look at these sites (particularly the maven one) just to check that a version of the jar you want to use is not already available. It really is not available - how to upload? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Assuming the jar you want is not already hosted on one of these sites you need to upload it and add a dependency entry to your pom.xml file. +Assuming the jar you want is not already hosted on one of these sites you need to upload it and add a dependency entry to your ``pom.xml`` file. * Upload with Maven (not by copy-and-paste) @@ -169,7 +169,7 @@ Uploading to Ibiblio Examples of Updating JTS Jar ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1. Change into one of the GeoTools directories (the geotools pom.xml has all the +1. Change into one of the GeoTools directories (the geotools ``pom.xml`` has all the repository definitions so changing directories is easier than editing your settings.xml):: C:\> cd java\geotools\trunk diff --git a/docs/developer/procedures/check.rst b/docs/developer/procedures/check.rst index 7efb0022d08..691ed51a26c 100644 --- a/docs/developer/procedures/check.rst +++ b/docs/developer/procedures/check.rst @@ -25,7 +25,7 @@ Here is how a plugin (aka hooks into the geotools library) may earn a star: * Passes IP check, basically has correct headers * Releasable - has no non blocking bugs in jira -* Used in anger - Used by GeoServer or uDig or Geomajas (ie some kind of large real world datasets) +* Used in anger - Used by GeoServer or uDig or Geomajas (i.e. some kind of large real world datasets) * Optimised - has been tuned to meet hard performance requirements (example shapefile) * Supported - user docs, module maintainer watches user list, answers email etc.. (example referencing) diff --git a/docs/developer/procedures/create.rst b/docs/developer/procedures/create.rst index a83bf7d2544..8a751806be9 100644 --- a/docs/developer/procedures/create.rst +++ b/docs/developer/procedures/create.rst @@ -85,7 +85,7 @@ The modules/unsupported/ directory is there to welcome your experimental work; t #. pom.xml - We start by getting the pom.xml configured since maven will need that to work against the module. The following will start you out: + We start by getting the ``pom.xml`` configured since maven will need that to work against the module. The following will start you out: Change all occurances of the word example to the name of your module:: diff --git a/docs/developer/procedures/git.rst b/docs/developer/procedures/git.rst index 05e97533def..8dedafcbc1a 100644 --- a/docs/developer/procedures/git.rst +++ b/docs/developer/procedures/git.rst @@ -244,7 +244,7 @@ of for rebasing include: It is **critically important** that rebasing never occur on a shared or primary branch. The rule of thumb with rebasing is that you must **never** rewrite commits - that are not strictly local, ie commits that have been pushed up to an online + that are not strictly local, i.e. commits that have been pushed up to an online repository. Other Tips diff --git a/docs/developer/procedures/release.rst b/docs/developer/procedures/release.rst index 913da03cac0..71dbaabcd58 100644 --- a/docs/developer/procedures/release.rst +++ b/docs/developer/procedures/release.rst @@ -29,7 +29,7 @@ Versions and revisions When performing a release we don't require a "code freeze" in which no developers can commit to the repository. Instead we release from a revision that is known to pass all tests, including unit/integration tests as well as CITE tests on the GeoServer side. These instructions are valid in case you are making a release in combination with GeoServer, if you are making a stand alone release it's up to you to choose the proper GIT revision number for the GeoTools released to be picked from. -To obtain the GeoServer and Geotools revisions that have passed the `CITE test `_, navigate to the latest Jenkins run of the CITE test and view it's console output and select to view its full log. For example: +To obtain the GeoServer and GeoTools revisions that have passed the `CITE test `_, navigate to the latest Jenkins run of the CITE test and view it's console output and select to view its full log. For example: https://build.geoserver.org/job/2.11-cite-wms-1.1/286/consoleText @@ -77,10 +77,10 @@ When creating the first release candidate of a series, there are some extra step * Enable `GitHub branch protection `_ for the new stable branch: tick "Protect this branch" (only) and press "Save changes". -* Checkout the master branch and update the version in all pom.xml files and a few miscellaneous files; for example, if changing master from ``17-SNAPSHOT`` to ``18-SNAPSHOT``:: +* Checkout the master branch and update the version in all ``pom.xml`` files and a few miscellaneous files; for example, if changing master from ``17-SNAPSHOT`` to ``18-SNAPSHOT``:: git checkout master - find . -name pom.xml -exec sed -i 's/17-SNAPSHOT/18-SNAPSHOT/g' {} \; + find . -name ``pom.xml`` -exec sed -i 's/17-SNAPSHOT/18-SNAPSHOT/g' {} \; sed -i 's/17-SNAPSHOT/18-SNAPSHOT/g' \ build/rename.xml \ docs/build.xml \ @@ -129,7 +129,7 @@ Run the `geotools-release functionNames = factory.getFunctionNames(); @@ -466,7 +466,9 @@ public int compare(FunctionName o1, FunctionName o2) { Parameter result = functionName.getReturn(); StringBuilder fn = new StringBuilder(); + fn.append(codeBlock); fn.append(functionName.getName()); + fn.append("("); int i = 0; for (Parameter argument : functionName.getArguments()) { @@ -476,7 +478,8 @@ public int compare(FunctionName o1, FunctionName o2) { fn.append(argument.getName()); } fn.append(")"); - fn.append(": " + result.getName()); + fn.append(codeBlock); + fn.append(": returns " + codeBlock + result.getName() + codeBlock); System.out.println(fn.toString()); for (int h = 0; h < fn.length(); h++) { @@ -489,35 +492,48 @@ public int compare(FunctionName o1, FunctionName o2) { System.out.println("* " + argument(argument)); System.out.println(); } - System.out.println("* " + argument(result)); + System.out.println("* " + argument(result, true)); System.out.println(); } } } + static final String codeBlock = "``"; + public static String argument(Parameter argument) { + return argument(argument, false); + } + + public static String argument(Parameter argument, boolean result) { + StringBuilder arg = new StringBuilder(); + arg.append(codeBlock); arg.append(argument.getName()); + arg.append(codeBlock); Class type = argument.getType(); if (type == null || (type == Object.class && argument.isRequired())) { // nothing more is known } else { + arg.append(" (" + codeBlock); + arg.append(type.getSimpleName()); + arg.append(codeBlock+")"); int min = argument.getMinOccurs(); int max = argument.getMaxOccurs(); - - arg.append(": "); - arg.append(type.getSimpleName()); - - arg.append(" "); - arg.append(min); - arg.append(":"); - arg.append(max == Integer.MAX_VALUE ? "unbounded" : max); - - if (argument.isRequired()) { - arg.append(" required"); - } else if (argument.getMinOccurs() == 0 && argument.getMaxOccurs() == 1) { - arg.append(" optional"); + if (min > 1 && max > 1) { + arg.append(": "); + arg.append(" min="); + arg.append(min); + arg.append(" max="); + arg.append(max == Integer.MAX_VALUE ? "unbounded" : max); + } else { + if (!result) { + if (argument.isRequired()) { + arg.append(" required"); + } else if (argument.getMinOccurs() == 0 && argument.getMaxOccurs() == 1) { + arg.append(" optional"); + } + } } } return arg.toString(); diff --git a/docs/user/artifacts/function_list b/docs/user/artifacts/function_list index 7912d918554..c176d09e054 100644 --- a/docs/user/artifacts/function_list +++ b/docs/user/artifacts/function_list @@ -1,2932 +1,2904 @@ -DefaultFunctionFactory -^^^^^^^^^^^^^^^^^^^^^^ +``DefaultFunctionFactory`` +^^^^^^^^^^^^^^^^^^^^^^^^^^ -Contains 202 functions. +Contains 199 functions. -Area(geometry): area -'''''''''''''''''''' - -* geometry: Geometry 1:1 required - -* area: Double 1:1 required +``Area(geometry)``: returns ``area`` +'''''''''''''''''''''''''''''''''''' -Categorize(LookupValue, Value, Threshold 1, Value 1, Threshold 2, Value 2, succeeding or preceding): return -''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +* ``geometry`` (``Geometry``) required -* LookupValue +* ``area`` (``Double``) -* Value +``Categorize(LookupValue, Value, Threshold 1, Value 1, Threshold 2, Value 2, succeeding or preceding)``: returns ``return`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* Threshold 1 +* ``LookupValue`` -* Value 1 +* ``Value`` -* Threshold 2 +* ``Threshold 1`` -* Value 2 +* ``Value 1`` -* succeeding or preceding +* ``Threshold 2`` -* return +* ``Value 2`` -Collection_Average(expression): average -''''''''''''''''''''''''''''''''''''''' +* ``succeeding or preceding`` -* expression: Number 1:1 required +* ``return`` -* average: Number 1:1 required +``Collection_Average(expression)``: returns ``average`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''' -Collection_Bounds(geometry): bounds -''''''''''''''''''''''''''''''''''' +* ``expression`` (``Number``) required -* geometry: Geometry 1:1 required +* ``average`` (``Number``) -* bounds +``Collection_Bounds(geometry)``: returns ``bounds`` +''''''''''''''''''''''''''''''''''''''''''''''''''' -Collection_Count(features): count -''''''''''''''''''''''''''''''''' +* ``geometry`` (``Geometry``) required -* features +* ``bounds`` -* count: Number 1:1 required +``Collection_Count(features)``: returns ``count`` +''''''''''''''''''''''''''''''''''''''''''''''''' -Collection_Max(expression): max -''''''''''''''''''''''''''''''' +* ``features`` -* expression: Comparable 1:1 required +* ``count`` (``Number``) -* max: Comparable 1:1 required +``Collection_Max(expression)``: returns ``max`` +''''''''''''''''''''''''''''''''''''''''''''''' -Collection_Median(expression): median -''''''''''''''''''''''''''''''''''''' +* ``expression`` (``Comparable``) required -* expression: Comparable 1:1 required +* ``max`` (``Comparable``) -* median: Comparable 1:1 required +``Collection_Median(expression)``: returns ``median`` +''''''''''''''''''''''''''''''''''''''''''''''''''''' -Collection_Min(expression): min -''''''''''''''''''''''''''''''' +* ``expression`` (``Comparable``) required -* expression: Comparable 1:1 required +* ``median`` (``Comparable``) -* min: Comparable 1:1 required +``Collection_Min(expression)``: returns ``min`` +''''''''''''''''''''''''''''''''''''''''''''''' -Collection_Nearest(value): expression -''''''''''''''''''''''''''''''''''''' +* ``expression`` (``Comparable``) required -* value: Comparable 1:1 required +* ``min`` (``Comparable``) -* expression: Expression 1:1 required +``Collection_Nearest(value)``: returns ``expression`` +''''''''''''''''''''''''''''''''''''''''''''''''''''' -Collection_Sum(expression): sum -''''''''''''''''''''''''''''''' +* ``value`` (``Comparable``) required -* expression: Number 1:1 required +* ``expression`` (``Expression``) -* sum: Number 1:1 required +``Collection_Sum(expression)``: returns ``sum`` +''''''''''''''''''''''''''''''''''''''''''''''' -Collection_Unique(expression): unique -''''''''''''''''''''''''''''''''''''' +* ``expression`` (``Number``) required -* expression +* ``sum`` (``Number``) -* unique +``Collection_Unique(expression)``: returns ``unique`` +''''''''''''''''''''''''''''''''''''''''''''''''''''' -Concatenate(text): result -''''''''''''''''''''''''' +* ``expression`` -* text: String 2:-1 required +* ``unique`` -* result: String 1:1 required +``Concatenate(text)``: returns ``result`` +''''''''''''''''''''''''''''''''''''''''' -EqualArea(value, classes, areaFunction): EqualArea -'''''''''''''''''''''''''''''''''''''''''''''''''' +* ``text`` (``String``) required -* value: Double 1:1 required +* ``result`` (``String``) -* classes: Integer 1:1 required +``EqualArea(value, classes, areaFunction)``: returns ``EqualArea`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* areaFunction: Double 0:1 optional +* ``value`` (``Double``) required -* EqualArea: RangedClassifier 1:1 required +* ``classes`` (``Integer``) required -EqualInterval(value, classes): EqualInterval -'''''''''''''''''''''''''''''''''''''''''''' +* ``areaFunction`` (``Double``) optional -* value: Double 1:1 required +* ``EqualArea`` (``RangedClassifier``) -* classes: Integer 1:1 required +``EqualInterval(value, classes)``: returns ``EqualInterval`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* EqualInterval: RangedClassifier 1:1 required +* ``value`` (``Double``) required -IEEEremainder(dividend, divisor): remainder -''''''''''''''''''''''''''''''''''''''''''' +* ``classes`` (``Integer``) required -* dividend: Number 1:1 required +* ``EqualInterval`` (``RangedClassifier``) -* divisor: Number 1:1 required +``IEEEremainder(dividend, divisor)``: returns ``remainder`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* remainder: Double 1:1 required +* ``dividend`` (``Number``) required -Interpolate(data value pairs, mode, method): lookup -''''''''''''''''''''''''''''''''''''''''''''''''''' +* ``divisor`` (``Number``) required -* data value pairs +* ``remainder`` (``Double``) -* mode: String 1:1 required +``Interpolate(data value pairs, mode, method)``: returns ``lookup`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* method: String 0:1 optional +* ``data value pairs`` -* lookup +* ``mode`` (``String``) required -Jenks(value, classes): Jenks -'''''''''''''''''''''''''''' +* ``method`` (``String``) optional -* value: Double 1:1 required +* ``lookup`` -* classes: Integer 1:1 required +``Jenks(value, classes)``: returns ``Jenks`` +'''''''''''''''''''''''''''''''''''''''''''' -* Jenks: RangedClassifier 1:1 required +* ``value`` (``Double``) required -PropertyExists(propertyName): exists -'''''''''''''''''''''''''''''''''''' +* ``classes`` (``Integer``) required -* propertyName +* ``Jenks`` (``RangedClassifier``) -* exists: Boolean 1:1 required +``PropertyExists(propertyName)``: returns ``exists`` +'''''''''''''''''''''''''''''''''''''''''''''''''''' -Quantile(value, classes): Quantile -'''''''''''''''''''''''''''''''''' +* ``propertyName`` -* value: Double 1:1 required +* ``exists`` (``Boolean``) -* classes: Integer 1:1 required +``Quantile(value, classes)``: returns ``Quantile`` +'''''''''''''''''''''''''''''''''''''''''''''''''' -* Quantile: RangedClassifier 1:1 required +* ``value`` (``Double``) required -Recode(LookupValue, Data 1, Value 1, Data 2, Value 2): return -''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +* ``classes`` (``Integer``) required -* LookupValue +* ``Quantile`` (``RangedClassifier``) -* Data 1 +``Recode(LookupValue, Data 1, Value 1, Data 2, Value 2)``: returns ``return`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* Value 1 +* ``LookupValue`` -* Data 2 +* ``Data 1`` -* Value 2 +* ``Value 1`` -* return +* ``Data 2`` -StandardDeviation(value, classes): StandardDeviation -'''''''''''''''''''''''''''''''''''''''''''''''''''' +* ``Value 2`` -* value: Double 1:1 required +* ``return`` -* classes: Integer 1:1 required +``StandardDeviation(value, classes)``: returns ``StandardDeviation`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* StandardDeviation: RangedClassifier 1:1 required +* ``value`` (``Double``) required -UniqueInterval(value, classes): UniqueInterval -'''''''''''''''''''''''''''''''''''''''''''''' +* ``classes`` (``Integer``) required -* value: Double 1:1 required +* ``StandardDeviation`` (``RangedClassifier``) -* classes: Integer 1:1 required +``UniqueInterval(value, classes)``: returns ``UniqueInterval`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* UniqueInterval: RangedClassifier 1:1 required +* ``value`` (``Double``) required -abs(int): abs -''''''''''''' +* ``classes`` (``Integer``) required -* int: Integer 1:1 required +* ``UniqueInterval`` (``RangedClassifier``) -* abs: Integer 1:1 required +``abs(int)``: returns ``abs`` +''''''''''''''''''''''''''''' -abs_2(number): long -''''''''''''''''''' +* ``int`` (``Integer``) required -* number: Long 1:1 required +* ``abs`` (``Integer``) -* long: Long 1:1 required +``abs_2(number)``: returns ``long`` +''''''''''''''''''''''''''''''''''' -abs_3(number): float -'''''''''''''''''''' +* ``number`` (``Long``) required -* number: Float 1:1 required +* ``long`` (``Long``) -* float: Float 1:1 required +``abs_3(number)``: returns ``float`` +'''''''''''''''''''''''''''''''''''' -abs_4(number): double -''''''''''''''''''''' +* ``number`` (``Float``) required -* number: Double 1:1 required +* ``float`` (``Float``) -* double: Double 1:1 required +``abs_4(number)``: returns ``double`` +''''''''''''''''''''''''''''''''''''' -acos(value): arc cosine -''''''''''''''''''''''' +* ``number`` (``Double``) required -* value: Double 1:1 required +* ``double`` (``Double``) -* arc cosine: Double 1:1 required +``acos(value)``: returns ``arc cosine`` +''''''''''''''''''''''''''''''''''''''' -area2(geometry): area -''''''''''''''''''''' +* ``value`` (``Double``) required -* geometry: Geometry 1:1 required +* ``arc cosine`` (``Double``) -* area: Double 1:1 required +``area2(geometry)``: returns ``area`` +''''''''''''''''''''''''''''''''''''' -asin(value): arc sine -''''''''''''''''''''' +* ``geometry`` (``Geometry``) required -* value: Double 1:1 required +* ``area`` (``Double``) -* arc sine: Double 1:1 required +``asin(value)``: returns ``arc sine`` +''''''''''''''''''''''''''''''''''''' -atan(value): arc tan -'''''''''''''''''''' +* ``value`` (``Double``) required -* value: Double 1:1 required +* ``arc sine`` (``Double``) -* arc tan: Double 1:1 required +``atan(value)``: returns ``arc tan`` +'''''''''''''''''''''''''''''''''''' -atan2(x, y): arc tan -'''''''''''''''''''' +* ``value`` (``Double``) required -* x: Double 1:1 required +* ``arc tan`` (``Double``) -* y: Double 1:1 required +``atan2(x, y)``: returns ``arc tan`` +'''''''''''''''''''''''''''''''''''' -* arc tan: Double 1:1 required +* ``x`` (``Double``) required -attributeCount(count): return -''''''''''''''''''''''''''''' +* ``y`` (``Double``) required -* count +* ``arc tan`` (``Double``) -* return +``attributeCount(count)``: returns ``return`` +''''''''''''''''''''''''''''''''''''''''''''' -between(value, min, max): between -''''''''''''''''''''''''''''''''' +* ``count`` -* value +* ``return`` -* min +``between(value, min, max)``: returns ``between`` +''''''''''''''''''''''''''''''''''''''''''''''''' -* max +* ``value`` -* between: Boolean 1:1 required +* ``min`` -boundary(geometry): boundary -'''''''''''''''''''''''''''' +* ``max`` -* geometry: Geometry 1:1 required +* ``between`` (``Boolean``) -* boundary: Geometry 1:1 required +``boundary(geometry)``: returns ``boundary`` +'''''''''''''''''''''''''''''''''''''''''''' -boundaryDimension(geometry): dimension -'''''''''''''''''''''''''''''''''''''' +* ``geometry`` (``Geometry``) required -* geometry: Geometry 1:1 required +* ``boundary`` (``Geometry``) -* dimension: Integer 1:1 required +``boundaryDimension(geometry)``: returns ``dimension`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''' -boundedBy(): result -''''''''''''''''''' +* ``geometry`` (``Geometry``) required -* result: Geometry 1:1 required +* ``dimension`` (``Integer``) -buffer(geometry, distance): buffer -'''''''''''''''''''''''''''''''''' +``boundedBy()``: returns ``result`` +''''''''''''''''''''''''''''''''''' -* geometry: Geometry 1:1 required +* ``result`` (``Geometry``) -* distance: Number 1:1 required +``buffer(geometry, distance)``: returns ``buffer`` +'''''''''''''''''''''''''''''''''''''''''''''''''' -* buffer: Geometry 1:1 required +* ``geometry`` (``Geometry``) required -bufferWithSegments(geometry, distance, numberOfSegments): buffer -'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +* ``distance`` (``Number``) required -* geometry: Geometry 1:1 required +* ``buffer`` (``Geometry``) -* distance: Number 1:1 required +``bufferWithSegments(geometry, distance, numberOfSegments)``: returns ``buffer`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* numberOfSegments: Number 1:1 required +* ``geometry`` (``Geometry``) required -* buffer: Geometry 1:1 required +* ``distance`` (``Number``) required -ceil(number): ceiling -''''''''''''''''''''' +* ``numberOfSegments`` (``Number``) required -* number: Number 1:1 required +* ``buffer`` (``Geometry``) -* ceiling: Double 1:1 required +``ceil(number)``: returns ``ceiling`` +''''''''''''''''''''''''''''''''''''' -centroid(geometry): centroid -'''''''''''''''''''''''''''' +* ``number`` (``Number``) required -* geometry: Geometry 1:1 required +* ``ceiling`` (``Double``) -* centroid: Point 1:1 required +``centroid(geometry)``: returns ``centroid`` +'''''''''''''''''''''''''''''''''''''''''''' -classify(expression, classifer): value -'''''''''''''''''''''''''''''''''''''' +* ``geometry`` (``Geometry``) required -* expression +* ``centroid`` (``Point``) -* classifer: Classifier 1:1 required +``classify(expression, classifer)``: returns ``value`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''' -* value +* ``expression`` -contains(geometry1, geometry2): contains -'''''''''''''''''''''''''''''''''''''''' +* ``classifer`` (``Classifier``) required -* geometry1: Geometry 1:1 required +* ``value`` -* geometry2: Geometry 1:1 required +``contains(geometry1, geometry2)``: returns ``contains`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* contains: Boolean 1:1 required +* ``geometry1`` (``Geometry``) required -contrast(reference, color1, color2, threshold): result -'''''''''''''''''''''''''''''''''''''''''''''''''''''' +* ``geometry2`` (``Geometry``) required -* reference: Color 1:1 required +* ``contains`` (``Boolean``) -* color1: Color 0:1 optional +``contrast(reference, color1, color2, threshold)``: returns ``result`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* color2: Color 0:1 optional +* ``reference`` (``Color``) required -* threshold: Double 0:1 optional +* ``color1`` (``Color``) optional -* result: Color 1:1 required +* ``color2`` (``Color``) optional -convert(value, class): converted -'''''''''''''''''''''''''''''''' +* ``threshold`` (``Double``) optional -* value +* ``result`` (``Color``) -* class: Class 1:1 required +``convert(value, class)``: returns ``converted`` +'''''''''''''''''''''''''''''''''''''''''''''''' -* converted +* ``value`` -convexHull(geometry): hull -'''''''''''''''''''''''''' +* ``class`` (``Class``) required -* geometry: Geometry 1:1 required +* ``converted`` -* hull: Geometry 1:1 required +``convexHull(geometry)``: returns ``hull`` +'''''''''''''''''''''''''''''''''''''''''' -cos(radians): cosine -'''''''''''''''''''' +* ``geometry`` (``Geometry``) required -* radians: Double 1:1 required +* ``hull`` (``Geometry``) -* cosine: Double 1:1 required +``cos(radians)``: returns ``cosine`` +'''''''''''''''''''''''''''''''''''' -crosses(geometry1, geometry2): crosses -'''''''''''''''''''''''''''''''''''''' +* ``radians`` (``Double``) required -* geometry1: Geometry 1:1 required +* ``cosine`` (``Double``) -* geometry2: Geometry 1:1 required +``crosses(geometry1, geometry2)``: returns ``crosses`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''' -* crosses: Boolean 1:1 required +* ``geometry1`` (``Geometry``) required -darken(color, amount, method): result -''''''''''''''''''''''''''''''''''''' +* ``geometry2`` (``Geometry``) required -* color: Color 1:1 required +* ``crosses`` (``Boolean``) -* amount: Float 1:1 required +``darken(color, amount, method)``: returns ``result`` +''''''''''''''''''''''''''''''''''''''''''''''''''''' -* method: Method 0:1 optional +* ``color`` (``Color``) required -* result: Color 1:1 required +* ``amount`` (``Float``) required -dateDifference(a, b): result -'''''''''''''''''''''''''''' +* ``method`` (``Method``) optional -* a: Date 1:1 required +* ``result`` (``Color``) -* b: Date 1:1 required +``dateDifference(a, b)``: returns ``result`` +'''''''''''''''''''''''''''''''''''''''''''' -* result: Long 1:1 required +* ``a`` (``Date``) required -dateFormat(format, date): formatted -''''''''''''''''''''''''''''''''''' +* ``b`` (``Date``) required -* format: String 1:1 required +* ``result`` (``Long``) -* date: Date 1:1 required +``dateFormat(format, date)``: returns ``formatted`` +''''''''''''''''''''''''''''''''''''''''''''''''''' -* formatted: String 1:1 required +* ``format`` (``String``) required -dateParse(format, dateString): date -''''''''''''''''''''''''''''''''''' +* ``date`` (``Date``) required -* format: String 1:1 required +* ``formatted`` (``String``) -* dateString: String 1:1 required +``dateParse(format, dateString)``: returns ``date`` +''''''''''''''''''''''''''''''''''''''''''''''''''' -* date: Date 1:1 required +* ``format`` (``String``) required -desaturate(color, amount, method): result -''''''''''''''''''''''''''''''''''''''''' +* ``dateString`` (``String``) required -* color: Color 1:1 required +* ``date`` (``Date``) -* amount: Float 1:1 required +``desaturate(color, amount, method)``: returns ``result`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* method: Method 0:1 optional +* ``color`` (``Color``) required -* result: Color 1:1 required +* ``amount`` (``Float``) required -difference(geometry1, geometry2): difference -'''''''''''''''''''''''''''''''''''''''''''' +* ``method`` (``Method``) optional -* geometry1: Geometry 1:1 required +* ``result`` (``Color``) -* geometry2: Geometry 1:1 required +``difference(geometry1, geometry2)``: returns ``difference`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* difference: Geometry 1:1 required +* ``geometry1`` (``Geometry``) required -dimension(geometry): dimension -'''''''''''''''''''''''''''''' +* ``geometry2`` (``Geometry``) required -* geometry: Geometry 1:1 required +* ``difference`` (``Geometry``) -* dimension: Integer 1:1 required +``dimension(geometry)``: returns ``dimension`` +'''''''''''''''''''''''''''''''''''''''''''''' -disjoint(geometry1, geometry2): disjoint -'''''''''''''''''''''''''''''''''''''''' +* ``geometry`` (``Geometry``) required -* geometry1: Geometry 1:1 required +* ``dimension`` (``Integer``) -* geometry2: Geometry 1:1 required +``disjoint(geometry1, geometry2)``: returns ``disjoint`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* disjoint: Boolean 1:1 required +* ``geometry1`` (``Geometry``) required -disjoint3D(geometry1, geometry2): disjoint3D -'''''''''''''''''''''''''''''''''''''''''''' +* ``geometry2`` (``Geometry``) required -* geometry1: Geometry 1:1 required +* ``disjoint`` (``Boolean``) -* geometry2: Geometry 1:1 required +``disjoint3D(geometry1, geometry2)``: returns ``disjoint3D`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* disjoint3D: Double 1:1 required +* ``geometry1`` (``Geometry``) required -distance(geometry1, geometry2): distance -'''''''''''''''''''''''''''''''''''''''' +* ``geometry2`` (``Geometry``) required -* geometry1: Geometry 1:1 required +* ``disjoint3D`` (``Double``) -* geometry2: Geometry 1:1 required +``distance(geometry1, geometry2)``: returns ``distance`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* distance: Double 1:1 required +* ``geometry1`` (``Geometry``) required -distance3D(geometry1, geometry2): distance3D -'''''''''''''''''''''''''''''''''''''''''''' +* ``geometry2`` (``Geometry``) required -* geometry1: Geometry 1:1 required +* ``distance`` (``Double``) -* geometry2: Geometry 1:1 required +``distance3D(geometry1, geometry2)``: returns ``distance3D`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* distance3D: Double 1:1 required +* ``geometry1`` (``Geometry``) required -double2bool(double): double2bool -'''''''''''''''''''''''''''''''' +* ``geometry2`` (``Geometry``) required -* double: Double 1:1 required +* ``distance3D`` (``Double``) -* double2bool: Boolean 1:1 required +``double2bool(double)``: returns ``double2bool`` +'''''''''''''''''''''''''''''''''''''''''''''''' -endAngle(linestring): endAngle -'''''''''''''''''''''''''''''' +* ``double`` (``Double``) required -* linestring: LineString 1:1 required +* ``double2bool`` (``Boolean``) -* endAngle: Double 1:1 required +``endAngle(linestring)``: returns ``endAngle`` +'''''''''''''''''''''''''''''''''''''''''''''' -endPoint(linestring): endPoint -'''''''''''''''''''''''''''''' +* ``linestring`` (``LineString``) required -* linestring: LineString 1:1 required +* ``endAngle`` (``Double``) -* endPoint: Point 1:1 required +``endPoint(linestring)``: returns ``endPoint`` +'''''''''''''''''''''''''''''''''''''''''''''' -env(variable): value -'''''''''''''''''''' +* ``linestring`` (``LineString``) required -* variable: String 1:1 required +* ``endPoint`` (``Point``) -* value +``env(variable)``: returns ``value`` +'''''''''''''''''''''''''''''''''''' -envelope(geometry): envelope -'''''''''''''''''''''''''''' +* ``variable`` (``String``) required -* geometry: Geometry 1:1 required +* ``value`` -* envelope: Geometry 1:1 required +``envelope(geometry)``: returns ``envelope`` +'''''''''''''''''''''''''''''''''''''''''''' -equalTo(a, b): equalTo -'''''''''''''''''''''' +* ``geometry`` (``Geometry``) required -* a +* ``envelope`` (``Geometry``) -* b +``equalTo(a, b)``: returns ``equalTo`` +'''''''''''''''''''''''''''''''''''''' -* equalTo: Boolean 1:1 required +* ``a`` -equalsExact(geometry1, geometry2): equalsExact -'''''''''''''''''''''''''''''''''''''''''''''' +* ``b`` -* geometry1: Geometry 1:1 required +* ``equalTo`` (``Boolean``) -* geometry2: Geometry 1:1 required +``equalsExact(geometry1, geometry2)``: returns ``equalsExact`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* equalsExact: Boolean 1:1 required +* ``geometry1`` (``Geometry``) required -equalsExactTolerance(geometry1, geometry2, tolarance): equalsExactTolerance -''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +* ``geometry2`` (``Geometry``) required -* geometry1: Geometry 1:1 required +* ``equalsExact`` (``Boolean``) -* geometry2: Geometry 1:1 required +``equalsExactTolerance(geometry1, geometry2, tolarance)``: returns ``equalsExactTolerance`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* tolarance: Double 1:1 required +* ``geometry1`` (``Geometry``) required -* equalsExactTolerance: Boolean 1:1 required +* ``geometry2`` (``Geometry``) required -exp(number): exponent -''''''''''''''''''''' +* ``tolarance`` (``Double``) required -* number: Number 1:1 required +* ``equalsExactTolerance`` (``Boolean``) -* exponent: Double 1:1 required +``exp(number)``: returns ``exponent`` +''''''''''''''''''''''''''''''''''''' -exteriorRing(geometry): exteriorRing -'''''''''''''''''''''''''''''''''''' +* ``number`` (``Number``) required -* geometry: Geometry 1:1 required +* ``exponent`` (``Double``) -* exteriorRing: LinearRing 1:1 required +``exteriorRing(geometry)``: returns ``exteriorRing`` +'''''''''''''''''''''''''''''''''''''''''''''''''''' -floor(double): floor -'''''''''''''''''''' +* ``geometry`` (``Geometry``) required -* double: Double 1:1 required +* ``exteriorRing`` (``LinearRing``) -* floor: Double 1:1 required +``floor(double)``: returns ``floor`` +'''''''''''''''''''''''''''''''''''' -geomFromWKT(geometry): geomFromWKT -'''''''''''''''''''''''''''''''''' +* ``double`` (``Double``) required -* geometry: String 1:1 required +* ``floor`` (``Double``) -* geomFromWKT: Geometry 1:1 required +``geomFromWKT(geometry)``: returns ``geomFromWKT`` +'''''''''''''''''''''''''''''''''''''''''''''''''' -geomLength(geometry): geomLength -'''''''''''''''''''''''''''''''' +* ``geometry`` (``String``) required -* geometry: Geometry 1:1 required +* ``geomFromWKT`` (``Geometry``) -* geomLength: Double 1:1 required +``geomLength(geometry)``: returns ``geomLength`` +'''''''''''''''''''''''''''''''''''''''''''''''' -geometry(): geometry -'''''''''''''''''''' +* ``geometry`` (``Geometry``) required -* geometry: Boolean 1:1 required +* ``geomLength`` (``Double``) -geometryType(geometry): geometryType +``geometry()``: returns ``geometry`` '''''''''''''''''''''''''''''''''''' -* geometry: Geometry 1:1 required - -* geometryType: String 1:1 required +* ``geometry`` (``Boolean``) -getGeometryN(geometry, index): getGeometryN -''''''''''''''''''''''''''''''''''''''''''' +``geometryType(geometry)``: returns ``geometryType`` +'''''''''''''''''''''''''''''''''''''''''''''''''''' -* geometry: Geometry 1:1 required +* ``geometry`` (``Geometry``) required -* index: Integer 1:1 required +* ``geometryType`` (``String``) -* getGeometryN: Geometry 1:1 required +``getGeometryN(geometry, index)``: returns ``getGeometryN`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -getX(geometry): getX -'''''''''''''''''''' +* ``geometry`` (``Geometry``) required -* geometry: Geometry 1:1 required +* ``index`` (``Integer``) required -* getX: Double 1:1 required +* ``getGeometryN`` (``Geometry``) -getY(geometry): getY -'''''''''''''''''''' +``getX(geometry)``: returns ``getX`` +'''''''''''''''''''''''''''''''''''' -* geometry: Geometry 1:1 required +* ``geometry`` (``Geometry``) required -* getY: Double 1:1 required +* ``getX`` (``Double``) -getz(geometry): getz -'''''''''''''''''''' +``getY(geometry)``: returns ``getY`` +'''''''''''''''''''''''''''''''''''' -* geometry: Geometry 1:1 required +* ``geometry`` (``Geometry``) required -* getz: Double 1:1 required +* ``getY`` (``Double``) -grayscale(color): result -'''''''''''''''''''''''' +``getz(geometry)``: returns ``getz`` +'''''''''''''''''''''''''''''''''''' -* color: Color 1:1 required +* ``geometry`` (``Geometry``) required -* result: Color 1:1 required +* ``getz`` (``Double``) -greaterEqualThan(x, y): greaterEqualThan +``grayscale(color)``: returns ``result`` '''''''''''''''''''''''''''''''''''''''' -* x - -* y - -* greaterEqualThan: Boolean 1:1 required - -greaterThan(x, y): greaterThan -'''''''''''''''''''''''''''''' +* ``color`` (``Color``) required -* x +* ``result`` (``Color``) -* y - -* greaterThan: Boolean 1:1 required +``greaterEqualThan(x, y)``: returns ``greaterEqualThan`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''' -hsl(hue, saturation, lightness): result -''''''''''''''''''''''''''''''''''''''' +* ``x`` -* hue: Double 1:1 required +* ``y`` -* saturation: Double 1:1 required +* ``greaterEqualThan`` (``Boolean``) -* lightness: Double 1:1 required +``greaterThan(x, y)``: returns ``greaterThan`` +'''''''''''''''''''''''''''''''''''''''''''''' -* result: Color 1:1 required +* ``x`` -id(): id -'''''''' +* ``y`` -* id: String 1:1 required +* ``greaterThan`` (``Boolean``) -if_then_else(condition, then, else): if_then_else -''''''''''''''''''''''''''''''''''''''''''''''''' +``hsl(hue, saturation, lightness)``: returns ``result`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* condition: Boolean 1:1 required +* ``hue`` (``Double``) required -* then +* ``saturation`` (``Double``) required -* else +* ``lightness`` (``Double``) required -* if_then_else +* ``result`` (``Color``) -in(candidate, v): result +``id()``: returns ``id`` '''''''''''''''''''''''' -* candidate +* ``id`` (``String``) -* v +``if_then_else(condition, then, else)``: returns ``if_then_else`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* result: Boolean 1:1 required +* ``condition`` (``Boolean``) required -in10(value, in1, in2, in3, in4, in5, in6, in7, in8, in9, in10): in10 -'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +* ``then`` -* value +* ``else`` -* in1 +* ``if_then_else`` -* in2 - -* in3 - -* in4 +``in(candidate, v)``: returns ``result`` +'''''''''''''''''''''''''''''''''''''''' -* in5 +* ``candidate`` -* in6 +* ``v`` -* in7 +* ``result`` (``Boolean``) -* in8 +``in10(value, in1, in2, in3, in4, in5, in6, in7, in8, in9, in10)``: returns ``in10`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* in9 +* ``value`` -* in10 +* ``in1`` -* in10: Boolean 1:1 required +* ``in2`` -in2(value, in1, in2): in2 -''''''''''''''''''''''''' +* ``in3`` -* value +* ``in4`` -* in1 +* ``in5`` -* in2 +* ``in6`` -* in2: Boolean 1:1 required +* ``in7`` -in3(value, in1, in2, in3): in3 -'''''''''''''''''''''''''''''' +* ``in8`` -* value +* ``in9`` -* in1 +* ``in10`` -* in2 +* ``in10`` (``Boolean``) -* in3 +``in2(value, in1, in2)``: returns ``in2`` +''''''''''''''''''''''''''''''''''''''''' -* in3: Boolean 1:1 required +* ``value`` -in4(value, in1, in2, in3, in4): in4 -''''''''''''''''''''''''''''''''''' +* ``in1`` -* value +* ``in2`` -* in1 +* ``in2`` (``Boolean``) -* in2 +``in3(value, in1, in2, in3)``: returns ``in3`` +'''''''''''''''''''''''''''''''''''''''''''''' -* in3 +* ``value`` -* in4 +* ``in1`` -* in4: Boolean 1:1 required +* ``in2`` -in5(value, in1, in2, in3, in4, in5): in5 -'''''''''''''''''''''''''''''''''''''''' +* ``in3`` -* value +* ``in3`` (``Boolean``) -* in1 +``in4(value, in1, in2, in3, in4)``: returns ``in4`` +''''''''''''''''''''''''''''''''''''''''''''''''''' -* in2 +* ``value`` -* in3 +* ``in1`` -* in4 +* ``in2`` -* in5 +* ``in3`` -* in5: Boolean 1:1 required +* ``in4`` -in6(value, in1, in2, in3, in4, in5, in6): in6 -''''''''''''''''''''''''''''''''''''''''''''' +* ``in4`` (``Boolean``) -* value +``in5(value, in1, in2, in3, in4, in5)``: returns ``in5`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* in1 +* ``value`` -* in2 +* ``in1`` -* in3 +* ``in2`` -* in4 +* ``in3`` -* in5 +* ``in4`` -* in6 +* ``in5`` -* in6: Boolean 1:1 required +* ``in5`` (``Boolean``) -in7(value, in1, in2, in3, in4, in5, in6, in7): in7 -'''''''''''''''''''''''''''''''''''''''''''''''''' +``in6(value, in1, in2, in3, in4, in5, in6)``: returns ``in6`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* value +* ``value`` -* in1 +* ``in1`` -* in2 +* ``in2`` -* in3 +* ``in3`` -* in4 +* ``in4`` -* in5 +* ``in5`` -* in6 +* ``in6`` -* in7 +* ``in6`` (``Boolean``) -* in7: Boolean 1:1 required +``in7(value, in1, in2, in3, in4, in5, in6, in7)``: returns ``in7`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -in8(value, in1, in2, in3, in4, in5, in6, in7, in8): in8 -''''''''''''''''''''''''''''''''''''''''''''''''''''''' +* ``value`` -* value +* ``in1`` -* in1 +* ``in2`` -* in2 +* ``in3`` -* in3 +* ``in4`` -* in4 +* ``in5`` -* in5 +* ``in6`` -* in6 +* ``in7`` -* in7 +* ``in7`` (``Boolean``) -* in8 +``in8(value, in1, in2, in3, in4, in5, in6, in7, in8)``: returns ``in8`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* in8: Boolean 1:1 required +* ``value`` -in9(value, in1, in2, in3, in4, in5, in6, in7, in8, in9): in9 -'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +* ``in1`` -* value +* ``in2`` -* in1 +* ``in3`` -* in2 +* ``in4`` -* in3 +* ``in5`` -* in4 +* ``in6`` -* in5 +* ``in7`` -* in6 +* ``in8`` -* in7 +* ``in8`` (``Boolean``) -* in8 +``in9(value, in1, in2, in3, in4, in5, in6, in7, in8, in9)``: returns ``in9`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* in9 +* ``value`` -* in9: Boolean 1:1 required +* ``in1`` -int2bbool(int): int2bbool -''''''''''''''''''''''''' +* ``in2`` -* int: Integer 1:1 required +* ``in3`` -* int2bbool: Boolean 1:1 required +* ``in4`` -int2ddouble(int): int2ddouble -''''''''''''''''''''''''''''' +* ``in5`` -* int: Integer 1:1 required +* ``in6`` -* int2ddouble: Double 1:1 required +* ``in7`` -interiorPoint(geometry): interiorPoint -'''''''''''''''''''''''''''''''''''''' +* ``in8`` -* geometry: Geometry 1:1 required +* ``in9`` -* interiorPoint: Point 1:1 required +* ``in9`` (``Boolean``) -interiorRingN(geometry, n): interiorRingN +``int2bbool(int)``: returns ``int2bbool`` ''''''''''''''''''''''''''''''''''''''''' -* geometry: Geometry 1:1 required +* ``int`` (``Integer``) required -* n: Integer 1:1 required - -* interiorRingN: LinearRing 1:1 required - -intersection(geometry1, geometry2): intersection -'''''''''''''''''''''''''''''''''''''''''''''''' +* ``int2bbool`` (``Boolean``) -* geometry1: Geometry 1:1 required +``int2ddouble(int)``: returns ``int2ddouble`` +''''''''''''''''''''''''''''''''''''''''''''' -* geometry2: Geometry 1:1 required +* ``int`` (``Integer``) required -* intersection: Geometry 1:1 required +* ``int2ddouble`` (``Double``) -intersects(geometry1, geometry2): intersects -'''''''''''''''''''''''''''''''''''''''''''' +``interiorPoint(geometry)``: returns ``interiorPoint`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''' -* geometry1: Geometry 1:1 required +* ``geometry`` (``Geometry``) required -* geometry2: Geometry 1:1 required +* ``interiorPoint`` (``Point``) -* intersects: Boolean 1:1 required +``interiorRingN(geometry, n)``: returns ``interiorRingN`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -intersects3D(geometry1, geometry2): intersects3D -'''''''''''''''''''''''''''''''''''''''''''''''' +* ``geometry`` (``Geometry``) required -* geometry1: Geometry 1:1 required +* ``n`` (``Integer``) required -* geometry2: Geometry 1:1 required +* ``interiorRingN`` (``LinearRing``) -* intersects3D: Double 1:1 required +``intersection(geometry1, geometry2)``: returns ``intersection`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -isClosed(geometry): isClosed -'''''''''''''''''''''''''''' +* ``geometry1`` (``Geometry``) required -* geometry: Geometry 1:1 required +* ``geometry2`` (``Geometry``) required -* isClosed: Boolean 1:1 required +* ``intersection`` (``Geometry``) -isCoverage(): isCoverage -'''''''''''''''''''''''' +``intersects(geometry1, geometry2)``: returns ``intersects`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* isCoverage: Boolean 1:1 required +* ``geometry1`` (``Geometry``) required -isEmpty(geometry): isEmpty -'''''''''''''''''''''''''' +* ``geometry2`` (``Geometry``) required -* geometry: Geometry 1:1 required +* ``intersects`` (``Boolean``) -* isEmpty: Boolean 1:1 required +``intersects3D(geometry1, geometry2)``: returns ``intersects3D`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -isLike(string, regex): isLike -''''''''''''''''''''''''''''' +* ``geometry1`` (``Geometry``) required -* string: String 1:1 required +* ``geometry2`` (``Geometry``) required -* regex: String 1:1 required +* ``intersects3D`` (``Double``) -* isLike: Boolean 1:1 required +``isClosed(geometry)``: returns ``isClosed`` +'''''''''''''''''''''''''''''''''''''''''''' -isNull(object): isNull -'''''''''''''''''''''' +* ``geometry`` (``Geometry``) required -* object +* ``isClosed`` (``Boolean``) -* isNull: Boolean 1:1 required +``isCoverage()``: returns ``isCoverage`` +'''''''''''''''''''''''''''''''''''''''' -isRing(geometry): isRing -'''''''''''''''''''''''' +* ``isCoverage`` (``Boolean``) -* geometry: Geometry 1:1 required +``isEmpty(geometry)``: returns ``isEmpty`` +'''''''''''''''''''''''''''''''''''''''''' -* isRing: Boolean 1:1 required +* ``geometry`` (``Geometry``) required -isSimple(geometry): isSimple -'''''''''''''''''''''''''''' +* ``isEmpty`` (``Boolean``) -* geometry: Geometry 1:1 required +``isLike(string, regex)``: returns ``isLike`` +''''''''''''''''''''''''''''''''''''''''''''' -* isSimple: Boolean 1:1 required +* ``string`` (``String``) required -isValid(geometry): isValid -'''''''''''''''''''''''''' +* ``regex`` (``String``) required -* geometry: Geometry 1:1 required +* ``isLike`` (``Boolean``) -* isValid: Boolean 1:1 required +``isNull(object)``: returns ``isNull`` +'''''''''''''''''''''''''''''''''''''' -isWithinDistance(geometry1, geometry2, distance): isWithinDistance -'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +* ``object`` -* geometry1: Geometry 1:1 required +* ``isNull`` (``Boolean``) -* geometry2: Geometry 1:1 required +``isRing(geometry)``: returns ``isRing`` +'''''''''''''''''''''''''''''''''''''''' -* distance: Double 1:1 required +* ``geometry`` (``Geometry``) required -* isWithinDistance: Boolean 1:1 required +* ``isRing`` (``Boolean``) -isWithinDistance3D(geometry1, geometry2, distance): isWithinDistance3D -'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +``isSimple(geometry)``: returns ``isSimple`` +'''''''''''''''''''''''''''''''''''''''''''' -* geometry1: Geometry 1:1 required +* ``geometry`` (``Geometry``) required -* geometry2: Geometry 1:1 required +* ``isSimple`` (``Boolean``) -* distance: Double 1:1 required +``isValid(geometry)``: returns ``isValid`` +'''''''''''''''''''''''''''''''''''''''''' -* isWithinDistance3D: Double 1:1 required +* ``geometry`` (``Geometry``) required -isometric(geometry, extrusion): isometric -''''''''''''''''''''''''''''''''''''''''' +* ``isValid`` (``Boolean``) -* geometry: Geometry 1:1 required +``isWithinDistance(geometry1, geometry2, distance)``: returns ``isWithinDistance`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* extrusion: Double 1:1 required +* ``geometry1`` (``Geometry``) required -* isometric: Geometry 1:1 required +* ``geometry2`` (``Geometry``) required -lapply(source, expression): result -'''''''''''''''''''''''''''''''''' +* ``distance`` (``Double``) required -* source: List 1:1 required +* ``isWithinDistance`` (``Boolean``) -* expression +``isWithinDistance3D(geometry1, geometry2, distance)``: returns ``isWithinDistance3D`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* result: List 1:1 required +* ``geometry1`` (``Geometry``) required -length(string): length -'''''''''''''''''''''' +* ``geometry2`` (``Geometry``) required -* string: String 1:1 required +* ``distance`` (``Double``) required -* length: Integer 1:1 required +* ``isWithinDistance3D`` (``Double``) -lessEqualThan(a, b): lessEqualThan -'''''''''''''''''''''''''''''''''' +``isometric(geometry, extrusion)``: returns ``isometric`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* a: Number 1:1 required +* ``geometry`` (``Geometry``) required -* b: Number 1:1 required +* ``extrusion`` (``Double``) required -* lessEqualThan: Boolean 1:1 required +* ``isometric`` (``Geometry``) -lessThan(a, b): lessThan -'''''''''''''''''''''''' +``jsonPointer(json, pointer)``: returns ``result`` +'''''''''''''''''''''''''''''''''''''''''''''''''' -* a: Number 1:1 required +* ``json`` (``String``) required -* b: Number 1:1 required +* ``pointer`` (``String``) required -* lessThan: Boolean 1:1 required +* ``result`` -lighten(color, amount, method): result +``length(string)``: returns ``length`` '''''''''''''''''''''''''''''''''''''' -* color: Color 1:1 required - -* amount: Float 1:1 required +* ``string`` (``String``) required -* method: Method 0:1 optional +* ``length`` (``Integer``) -* result: Color 1:1 required +``lessEqualThan(a, b)``: returns ``lessEqualThan`` +'''''''''''''''''''''''''''''''''''''''''''''''''' -list(item): list -'''''''''''''''' +* ``a`` (``Number``) required -* item +* ``b`` (``Number``) required -* list: List 1:1 required +* ``lessEqualThan`` (``Boolean``) -listMultiply(factor, list): listMultiply +``lessThan(a, b)``: returns ``lessThan`` '''''''''''''''''''''''''''''''''''''''' -* factor: Number 1:1 required +* ``a`` (``Number``) required -* list: String 1:1 required +* ``b`` (``Number``) required -* listMultiply: String 1:1 required +* ``lessThan`` (``Boolean``) -litem(source, index): result -'''''''''''''''''''''''''''' +``lighten(color, amount, method)``: returns ``result`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''' -* source: List 1:1 required +* ``color`` (``Color``) required -* index: Integer 1:1 required +* ``amount`` (``Float``) required -* result +* ``method`` (``Method``) optional -literate(index, times, expression): result -'''''''''''''''''''''''''''''''''''''''''' +* ``result`` (``Color``) -* index +``list(item)``: returns ``list`` +'''''''''''''''''''''''''''''''' -* times: Integer 1:1 required +* ``item`` -* expression +* ``list`` (``List``) -* result: List 1:1 required +``listMultiply(factor, list)``: returns ``listMultiply`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''' -log(value): logarithm -''''''''''''''''''''' +* ``factor`` (``Number``) required -* value: Number 1:1 required +* ``list`` (``String``) required -* logarithm: Double 1:1 required +* ``listMultiply`` (``String``) -max(double, double): maxium -''''''''''''''''''''''''''' +``log(value)``: returns ``logarithm`` +''''''''''''''''''''''''''''''''''''' -* double: Number 1:1 required +* ``value`` (``Number``) required -* double: Number 1:1 required +* ``logarithm`` (``Double``) -* maxium: Double 1:1 required +``max(double, double)``: returns ``maxium`` +''''''''''''''''''''''''''''''''''''''''''' -max_2(long, long): maximum -'''''''''''''''''''''''''' +* ``double`` (``Number``) required -* long: Number 1:1 required +* ``double`` (``Number``) required -* long: Number 1:1 required +* ``maxium`` (``Double``) -* maximum: Long 1:1 required +``max_2(long, long)``: returns ``maximum`` +'''''''''''''''''''''''''''''''''''''''''' -max_3(float, float): maximum -'''''''''''''''''''''''''''' +* ``long`` (``Number``) required -* float: Number 1:1 required +* ``long`` (``Number``) required -* float: Number 1:1 required +* ``maximum`` (``Long``) -* maximum: Float 1:1 required +``max_3(float, float)``: returns ``maximum`` +'''''''''''''''''''''''''''''''''''''''''''' -max_4(int, int): maximum -'''''''''''''''''''''''' +* ``float`` (``Number``) required -* int: Number 1:1 required +* ``float`` (``Number``) required -* int: Number 1:1 required +* ``maximum`` (``Float``) -* maximum: Integer 1:1 required +``max_4(int, int)``: returns ``maximum`` +'''''''''''''''''''''''''''''''''''''''' -min(double, double): minium -''''''''''''''''''''''''''' +* ``int`` (``Number``) required -* double: Double 1:1 required +* ``int`` (``Number``) required -* double: Double 1:1 required +* ``maximum`` (``Integer``) -* minium: Double 1:1 required +``min(double, double)``: returns ``minium`` +''''''''''''''''''''''''''''''''''''''''''' -min_2(long, long): minium -''''''''''''''''''''''''' +* ``double`` (``Double``) required -* long: Number 1:1 required +* ``double`` (``Double``) required -* long: Number 1:1 required +* ``minium`` (``Double``) -* minium: Long 1:1 required +``min_2(long, long)``: returns ``minium`` +''''''''''''''''''''''''''''''''''''''''' -min_3(float, float): minium -''''''''''''''''''''''''''' +* ``long`` (``Number``) required -* float: Number 1:1 required +* ``long`` (``Number``) required -* float: Number 1:1 required +* ``minium`` (``Long``) -* minium: Float 1:1 required +``min_3(float, float)``: returns ``minium`` +''''''''''''''''''''''''''''''''''''''''''' -min_4(int, int): minium -''''''''''''''''''''''' +* ``float`` (``Number``) required -* int: Number 1:1 required +* ``float`` (``Number``) required -* int: Number 1:1 required +* ``minium`` (``Float``) -* minium: Integer 1:1 required +``min_4(int, int)``: returns ``minium`` +''''''''''''''''''''''''''''''''''''''' -mincircle(geometry): mincircle -'''''''''''''''''''''''''''''' +* ``int`` (``Number``) required -* geometry: Geometry 1:1 required +* ``int`` (``Number``) required -* mincircle: Geometry 1:1 required +* ``minium`` (``Integer``) -minimumdiameter(geometry): minimumdiameter -'''''''''''''''''''''''''''''''''''''''''' +``mincircle(geometry)``: returns ``mincircle`` +'''''''''''''''''''''''''''''''''''''''''''''' -* geometry: Geometry 1:1 required +* ``geometry`` (``Geometry``) required -* minimumdiameter: Geometry 1:1 required +* ``mincircle`` (``Geometry``) -minrectangle(geometry): minrectangle -'''''''''''''''''''''''''''''''''''' +``minimumdiameter(geometry)``: returns ``minimumdiameter`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* geometry: Geometry 1:1 required +* ``geometry`` (``Geometry``) required -* minrectangle: Geometry 1:1 required +* ``minimumdiameter`` (``Geometry``) -mix(color1, color2, weight): result -''''''''''''''''''''''''''''''''''' +``minrectangle(geometry)``: returns ``minrectangle`` +'''''''''''''''''''''''''''''''''''''''''''''''''''' -* color1: Color 1:1 required +* ``geometry`` (``Geometry``) required -* color2: Color 1:1 required +* ``minrectangle`` (``Geometry``) -* weight: Double 1:1 required +``mix(color1, color2, weight)``: returns ``result`` +''''''''''''''''''''''''''''''''''''''''''''''''''' -* result: Color 1:1 required +* ``color1`` (``Color``) required -modulo(dividend, divisor): modulo -''''''''''''''''''''''''''''''''' +* ``color2`` (``Color``) required -* dividend: Integer 1:1 required +* ``weight`` (``Double``) required -* divisor: Integer 1:1 required +* ``result`` (``Color``) -* modulo: Integer 1:1 required +``modulo(dividend, divisor)``: returns ``modulo`` +''''''''''''''''''''''''''''''''''''''''''''''''' -not(logicValue): not -'''''''''''''''''''' +* ``dividend`` (``Integer``) required -* logicValue: Boolean 1:1 required +* ``divisor`` (``Integer``) required -* not: Boolean 1:1 required +* ``modulo`` (``Integer``) -notEqualTo(a, b): notEqualTo -'''''''''''''''''''''''''''' +``not(logicValue)``: returns ``not`` +'''''''''''''''''''''''''''''''''''' -* a +* ``logicValue`` (``Boolean``) required -* b +* ``not`` (``Boolean``) -* notEqualTo: Boolean 1:1 required +``notEqualTo(a, b)``: returns ``notEqualTo`` +'''''''''''''''''''''''''''''''''''''''''''' -numGeometries(geometry): numGeometries -'''''''''''''''''''''''''''''''''''''' +* ``a`` -* geometry: Geometry 1:1 required +* ``b`` -* numGeometries: Integer 1:1 required +* ``notEqualTo`` (``Boolean``) -numInteriorRing(geometry): numInteriorRing -'''''''''''''''''''''''''''''''''''''''''' +``numGeometries(geometry)``: returns ``numGeometries`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''' -* geometry: Geometry 1:1 required +* ``geometry`` (``Geometry``) required -* numInteriorRing: Integer 1:1 required +* ``numGeometries`` (``Integer``) -numPoints(geometry): numPoints -'''''''''''''''''''''''''''''' +``numInteriorRing(geometry)``: returns ``numInteriorRing`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* geometry: Geometry 1:1 required +* ``geometry`` (``Geometry``) required -* numPoints: Integer 1:1 required +* ``numInteriorRing`` (``Integer``) -numberFormat(format, number, language): numberFormat -'''''''''''''''''''''''''''''''''''''''''''''''''''' +``numPoints(geometry)``: returns ``numPoints`` +'''''''''''''''''''''''''''''''''''''''''''''' -* format: String 1:1 required +* ``geometry`` (``Geometry``) required -* number: Number 1:1 required +* ``numPoints`` (``Integer``) -* language: String 0:1 optional +``numberFormat(format, number, language)``: returns ``numberFormat`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* numberFormat: String 1:1 required +* ``format`` (``String``) required -numberFormat2(format, number, minus, decimal, separator): numberFormat2 -''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +* ``number`` (``Number``) required -* format: String 1:1 required +* ``language`` (``String``) optional -* number: Number 1:1 required +* ``numberFormat`` (``String``) -* minus: String 1:1 required +``numberFormat2(format, number, minus, decimal, separator)``: returns ``numberFormat2`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* decimal: String 1:1 required +* ``format`` (``String``) required -* separator: String 1:1 required +* ``number`` (``Number``) required -* numberFormat2: String 1:1 required +* ``minus`` (``String``) required -octagonalenvelope(geometry): octagonalenvelope -'''''''''''''''''''''''''''''''''''''''''''''' +* ``decimal`` (``String``) required -* geometry: Geometry 1:1 required +* ``separator`` (``String``) required -* octagonalenvelope: Geometry 1:1 required +* ``numberFormat2`` (``String``) -offset(geometry, offsetX, offsetY): offset -'''''''''''''''''''''''''''''''''''''''''' +``octagonalenvelope(geometry)``: returns ``octagonalenvelope`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* geometry: Geometry 1:1 required +* ``geometry`` (``Geometry``) required -* offsetX: Double 1:1 required +* ``octagonalenvelope`` (``Geometry``) -* offsetY: Double 1:1 required +``offset(geometry, offsetX, offsetY)``: returns ``offset`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* offset: Geometry 1:1 required +* ``geometry`` (``Geometry``) required -overlaps(geometry1, geometry2): overlaps -'''''''''''''''''''''''''''''''''''''''' +* ``offsetX`` (``Double``) required -* geometry1: Geometry 1:1 required +* ``offsetY`` (``Double``) required -* geometry2: Geometry 1:1 required +* ``offset`` (``Geometry``) -* overlaps: Geometry 1:1 required +``overlaps(geometry1, geometry2)``: returns ``overlaps`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''' -parseBoolean(string): parseBoolean -'''''''''''''''''''''''''''''''''' +* ``geometry1`` (``Geometry``) required -* string: String 1:1 required +* ``geometry2`` (``Geometry``) required -* parseBoolean: Boolean 1:1 required +* ``overlaps`` (``Geometry``) -parseDouble(string): parseDouble -'''''''''''''''''''''''''''''''' +``parseBoolean(string)``: returns ``parseBoolean`` +'''''''''''''''''''''''''''''''''''''''''''''''''' -* string: String 1:1 required +* ``string`` (``String``) required -* parseDouble: Double 1:1 required +* ``parseBoolean`` (``Boolean``) -parseInt(string): parseInt -'''''''''''''''''''''''''' +``parseDouble(string)``: returns ``parseDouble`` +'''''''''''''''''''''''''''''''''''''''''''''''' -* string: String 1:1 required +* ``string`` (``String``) required -* parseInt: Integer 1:1 required +* ``parseDouble`` (``Double``) -parseLong(string): parseLong -'''''''''''''''''''''''''''' +``parseInt(string)``: returns ``parseInt`` +'''''''''''''''''''''''''''''''''''''''''' -* string: String 1:1 required +* ``string`` (``String``) required -* parseLong: Long 1:1 required +* ``parseInt`` (``Integer``) -pgNearest(geometry, num_features): pgNearest +``parseLong(string)``: returns ``parseLong`` '''''''''''''''''''''''''''''''''''''''''''' -* geometry: Geometry 1:1 required +* ``string`` (``String``) required -* num_features: Integer 1:1 required +* ``parseLong`` (``Long``) -* pgNearest: Boolean 1:1 required +``pgNearest(geometry, num_features)``: returns ``pgNearest`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -pi(): pi -'''''''' +* ``geometry`` (``Geometry``) required -* pi: Double 1:1 required +* ``num_features`` (``Integer``) required -pointN(geometry, index): pointN -''''''''''''''''''''''''''''''' +* ``pgNearest`` (``Boolean``) -* geometry: Geometry 1:1 required +``pi()``: returns ``pi`` +'''''''''''''''''''''''' -* index: Integer 1:1 required +* ``pi`` (``Double``) -* pointN: Geometry 1:1 required +``pointN(geometry, index)``: returns ``pointN`` +''''''''''''''''''''''''''''''''''''''''''''''' -pow(base, exponent): power -'''''''''''''''''''''''''' +* ``geometry`` (``Geometry``) required -* base: Number 1:1 required +* ``index`` (``Integer``) required -* exponent: Number 1:1 required +* ``pointN`` (``Geometry``) -* power: Double 1:1 required +``pow(base, exponent)``: returns ``power`` +'''''''''''''''''''''''''''''''''''''''''' -property(propertyName): propertyValue -''''''''''''''''''''''''''''''''''''' +* ``base`` (``Number``) required -* propertyName: String 1:1 required +* ``exponent`` (``Number``) required -* propertyValue +* ``power`` (``Double``) -random(): random -'''''''''''''''' +``property(propertyName)``: returns ``propertyValue`` +''''''''''''''''''''''''''''''''''''''''''''''''''''' -* random: Double 1:1 required +* ``propertyName`` (``String``) required -relate(geometry1, geometry2): relate -'''''''''''''''''''''''''''''''''''' +* ``propertyValue`` -* geometry1: Geometry 1:1 required +``random()``: returns ``random`` +'''''''''''''''''''''''''''''''' -* geometry2: Geometry 1:1 required +* ``random`` (``Double``) -* relate: String 1:1 required +``relate(geometry1, geometry2)``: returns ``relate`` +'''''''''''''''''''''''''''''''''''''''''''''''''''' -relatePattern(geometry, geometry, pattern): related -''''''''''''''''''''''''''''''''''''''''''''''''''' +* ``geometry1`` (``Geometry``) required -* geometry: Geometry 1:1 required +* ``geometry2`` (``Geometry``) required -* geometry: Geometry 1:1 required +* ``relate`` (``String``) -* pattern: String 1:1 required +``relatePattern(geometry, geometry, pattern)``: returns ``related`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* related: Boolean 1:1 required +* ``geometry`` (``Geometry``) required -rescaleToPixels(value, defaultUnit, scaleFactor, rescalingMode): rescaleToPixels -'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +* ``geometry`` (``Geometry``) required -* value: String 1:1 required +* ``pattern`` (``String``) required -* defaultUnit: Unit 1:1 required +* ``related`` (``Boolean``) -* scaleFactor: Double 1:1 required +``rescaleToPixels(value, defaultUnit, scaleFactor, rescalingMode)``: returns ``rescaleToPixels`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* rescalingMode: RescalingMode 0:1 optional +* ``value`` (``String``) required -* rescaleToPixels: String 1:1 required +* ``defaultUnit`` (``Unit``) required -rint(double): rounded -''''''''''''''''''''' +* ``scaleFactor`` (``Double``) required -* double: Number 1:1 required +* ``rescalingMode`` (``RescalingMode``) optional -* rounded: Double 1:1 required +* ``rescaleToPixels`` (``String``) -round(number): float -'''''''''''''''''''' +``rint(double)``: returns ``rounded`` +''''''''''''''''''''''''''''''''''''' -* number: Number 1:1 required +* ``double`` (``Number``) required -* float: Float 1:1 required +* ``rounded`` (``Double``) -roundDouble(number): rounded -'''''''''''''''''''''''''''' +``round(number)``: returns ``float`` +'''''''''''''''''''''''''''''''''''' -* number: Number 1:1 required +* ``number`` (``Number``) required -* rounded: Double 1:1 required +* ``float`` (``Float``) -round_2(number): long -''''''''''''''''''''' +``roundDouble(number)``: returns ``rounded`` +'''''''''''''''''''''''''''''''''''''''''''' -* number: Number 1:1 required +* ``number`` (``Number``) required -* long: Long 1:1 required +* ``rounded`` (``Double``) -saturate(color, amount, method): result -''''''''''''''''''''''''''''''''''''''' +``round_2(number)``: returns ``long`` +''''''''''''''''''''''''''''''''''''' -* color: Color 1:1 required +* ``number`` (``Number``) required -* amount: Float 1:1 required +* ``long`` (``Long``) -* method: Method 0:1 optional +``saturate(color, amount, method)``: returns ``result`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* result: Color 1:1 required +* ``color`` (``Color``) required -setCRS(geometry, CRS): setCRS -''''''''''''''''''''''''''''' +* ``amount`` (``Float``) required -* geometry: Geometry 1:1 required +* ``method`` (``Method``) optional -* CRS: String 1:1 required +* ``result`` (``Color``) -* setCRS: Geometry 1:1 required +``setCRS(geometry, CRS)``: returns ``setCRS`` +''''''''''''''''''''''''''''''''''''''''''''' -shade(color, weight): result -'''''''''''''''''''''''''''' +* ``geometry`` (``Geometry``) required -* color: Color 1:1 required +* ``CRS`` (``String``) required -* weight: Double 1:1 required +* ``setCRS`` (``Geometry``) -* result: Color 1:1 required +``shade(color, weight)``: returns ``result`` +'''''''''''''''''''''''''''''''''''''''''''' -sin(radians): sine -'''''''''''''''''' +* ``color`` (``Color``) required -* radians: Number 1:1 required +* ``weight`` (``Double``) required -* sine: Double 1:1 required +* ``result`` (``Color``) -size(source): result -'''''''''''''''''''' +``sin(radians)``: returns ``sine`` +'''''''''''''''''''''''''''''''''' -* source: Collection 1:1 required +* ``radians`` (``Number``) required -* result: Integer 1:1 required +* ``sine`` (``Double``) -spin(color, amount): result -''''''''''''''''''''''''''' +``spin(color, amount)``: returns ``result`` +''''''''''''''''''''''''''''''''''''''''''' -* color: Color 1:1 required +* ``color`` (``Color``) required -* amount: Double 1:1 required +* ``amount`` (``Double``) required -* result: Color 1:1 required +* ``result`` (``Color``) -sqrt(number): root -'''''''''''''''''' +``sqrt(number)``: returns ``root`` +'''''''''''''''''''''''''''''''''' -* number: Number 1:1 required +* ``number`` (``Number``) required -* root: Double 1:1 required +* ``root`` (``Double``) -startAngle(linestring): degrees -''''''''''''''''''''''''''''''' +``startAngle(linestring)``: returns ``degrees`` +''''''''''''''''''''''''''''''''''''''''''''''' -* linestring: LineString 1:1 required +* ``linestring`` (``LineString``) required -* degrees: Double 1:1 required +* ``degrees`` (``Double``) -startPoint(linestring): point -''''''''''''''''''''''''''''' +``startPoint(linestring)``: returns ``point`` +''''''''''''''''''''''''''''''''''''''''''''' -* linestring: LineString 1:1 required +* ``linestring`` (``LineString``) required -* point: Point 1:1 required +* ``point`` (``Point``) -strAbbreviate(string, lower, upper, appendTo): string -''''''''''''''''''''''''''''''''''''''''''''''''''''' +``strAbbreviate(string, lower, upper, appendTo)``: returns ``string`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* string: String 1:1 required +* ``string`` (``String``) required -* lower: Integer 1:1 required +* ``lower`` (``Integer``) required -* upper: Integer 1:1 required +* ``upper`` (``Integer``) required -* appendTo: String 1:1 required +* ``appendTo`` (``String``) required -* string: String 1:1 required +* ``string`` (``String``) -strCapitalize(string): string -''''''''''''''''''''''''''''' +``strCapitalize(string)``: returns ``string`` +''''''''''''''''''''''''''''''''''''''''''''' -* string: String 1:1 required +* ``string`` (``String``) required -* string: String 1:1 required +* ``string`` (``String``) -strConcat(string1, string2): strConcat -'''''''''''''''''''''''''''''''''''''' +``strConcat(string1, string2)``: returns ``strConcat`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''' -* string1: String 1:1 required +* ``string1`` (``String``) required -* string2: String 1:1 required +* ``string2`` (``String``) required -* strConcat: String 1:1 required +* ``strConcat`` (``String``) -strDefaultIfBlank(string, default): string -'''''''''''''''''''''''''''''''''''''''''' +``strDefaultIfBlank(string, default)``: returns ``string`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* string: String 1:1 required +* ``string`` (``String``) required -* default: String 1:1 required +* ``default`` (``String``) required -* string: String 1:1 required +* ``string`` (``String``) -strEndsWith(String, postfix): endsWith -'''''''''''''''''''''''''''''''''''''' +``strEndsWith(String, postfix)``: returns ``endsWith`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''' -* String: String 1:1 required +* ``String`` (``String``) required -* postfix: String 1:1 required +* ``postfix`` (``String``) required -* endsWith: Boolean 1:1 required +* ``endsWith`` (``Boolean``) -strEqualsIgnoreCase(string, lookup): equals -''''''''''''''''''''''''''''''''''''''''''' +``strEqualsIgnoreCase(string, lookup)``: returns ``equals`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* string: String 1:1 required +* ``string`` (``String``) required -* lookup: String 1:1 required +* ``lookup`` (``String``) required -* equals: Boolean 1:1 required +* ``equals`` (``Boolean``) -strIndexOf(String, lookup): index -''''''''''''''''''''''''''''''''' +``strIndexOf(String, lookup)``: returns ``index`` +''''''''''''''''''''''''''''''''''''''''''''''''' -* String: String 1:1 required +* ``String`` (``String``) required -* lookup: String 1:1 required +* ``lookup`` (``String``) required -* index: Integer 1:1 required +* ``index`` (``Integer``) -strLastIndexOf(String, lookup): index -''''''''''''''''''''''''''''''''''''' +``strLastIndexOf(String, lookup)``: returns ``index`` +''''''''''''''''''''''''''''''''''''''''''''''''''''' -* String: String 1:1 required +* ``String`` (``String``) required -* lookup: String 1:1 required +* ``lookup`` (``String``) required -* index: Integer 1:1 required +* ``index`` (``Integer``) -strLength(string): length -''''''''''''''''''''''''' +``strLength(string)``: returns ``length`` +''''''''''''''''''''''''''''''''''''''''' -* string: String 1:1 required +* ``string`` (``String``) required -* length: Integer 1:1 required +* ``length`` (``Integer``) -strMatches(string, regex): match -'''''''''''''''''''''''''''''''' +``strMatches(string, regex)``: returns ``match`` +'''''''''''''''''''''''''''''''''''''''''''''''' -* string: String 1:1 required +* ``string`` (``String``) required -* regex: String 1:1 required +* ``regex`` (``String``) required -* match: Boolean 1:1 required +* ``match`` (``Boolean``) -strPosition(string, lookup, method): string -''''''''''''''''''''''''''''''''''''''''''' +``strPosition(string, lookup, method)``: returns ``string`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* string: String 1:1 required +* ``string`` (``String``) required -* lookup: String 1:1 required +* ``lookup`` (``String``) required -* method: String 1:1 required +* ``method`` (``String``) required -* string: String 1:1 required +* ``string`` (``String``) -strReplace(string, search, replace, all): string -'''''''''''''''''''''''''''''''''''''''''''''''' +``strReplace(string, search, replace, all)``: returns ``string`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* string: String 1:1 required +* ``string`` (``String``) required -* search: String 1:1 required +* ``search`` (``String``) required -* replace: String 1:1 required +* ``replace`` (``String``) required -* all: Boolean 1:1 required +* ``all`` (``Boolean``) required -* string: String 1:1 required +* ``string`` (``String``) -strStartsWith(string, prefix): starts with -'''''''''''''''''''''''''''''''''''''''''' +``strStartsWith(string, prefix)``: returns ``starts with`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* string: String 1:1 required +* ``string`` (``String``) required -* prefix: String 1:1 required +* ``prefix`` (``String``) required -* starts with: Boolean 1:1 required +* ``starts with`` (``Boolean``) -strStripAccents(string): string -''''''''''''''''''''''''''''''' +``strStripAccents(string)``: returns ``string`` +''''''''''''''''''''''''''''''''''''''''''''''' -* string: String 1:1 required +* ``string`` (``String``) required -* string: String 1:1 required +* ``string`` (``String``) -strSubstring(string, beginIndex, endIndex): substring -''''''''''''''''''''''''''''''''''''''''''''''''''''' +``strSubstring(string, beginIndex, endIndex)``: returns ``substring`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* string: String 1:1 required +* ``string`` (``String``) required -* beginIndex: Integer 1:1 required +* ``beginIndex`` (``Integer``) required -* endIndex: Integer 1:1 required +* ``endIndex`` (``Integer``) required -* substring: String 1:1 required +* ``substring`` (``String``) -strSubstringStart(string, beginIndex): substring -'''''''''''''''''''''''''''''''''''''''''''''''' +``strSubstringStart(string, beginIndex)``: returns ``substring`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* string: String 1:1 required +* ``string`` (``String``) required -* beginIndex: Integer 1:1 required +* ``beginIndex`` (``Integer``) required -* substring: String 1:1 required +* ``substring`` (``String``) -strToLowerCase(string): lowercase -''''''''''''''''''''''''''''''''' +``strToLowerCase(string)``: returns ``lowercase`` +''''''''''''''''''''''''''''''''''''''''''''''''' -* string: String 1:1 required +* ``string`` (``String``) required -* lowercase: String 1:1 required +* ``lowercase`` (``String``) -strToUpperCase(string): uppercase -''''''''''''''''''''''''''''''''' +``strToUpperCase(string)``: returns ``uppercase`` +''''''''''''''''''''''''''''''''''''''''''''''''' -* string: String 1:1 required +* ``string`` (``String``) required -* uppercase: String 1:1 required +* ``uppercase`` (``String``) -strTrim(string): trim -''''''''''''''''''''' +``strTrim(string)``: returns ``trim`` +''''''''''''''''''''''''''''''''''''' -* string: String 1:1 required +* ``string`` (``String``) required -* trim: String 1:1 required +* ``trim`` (``String``) -strTrim2(string, method, character): trim -''''''''''''''''''''''''''''''''''''''''' +``strTrim2(string, method, character)``: returns ``trim`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* string: String 1:1 required +* ``string`` (``String``) required -* method: String 1:1 required +* ``method`` (``String``) required -* character: String 1:1 required +* ``character`` (``String``) required -* trim: String 1:1 required +* ``trim`` (``String``) -strURLEncode(encodeable, formUrlEncode): strURLEncode -''''''''''''''''''''''''''''''''''''''''''''''''''''' +``strURLEncode(encodeable, formUrlEncode)``: returns ``strURLEncode`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* encodeable: String 1:1 required +* ``encodeable`` (``String``) required -* formUrlEncode: Boolean 0:1 optional +* ``formUrlEncode`` (``Boolean``) optional -* strURLEncode: String 1:1 required +* ``strURLEncode`` (``String``) -stringTemplate(input, pattern, template, defaultValue): return -'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +``stringTemplate(input, pattern, template, defaultValue)``: returns ``return`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* input +* ``input`` -* pattern +* ``pattern`` -* template +* ``template`` -* defaultValue +* ``defaultValue`` -* return +* ``return`` -symDifference(geometry, geometry): symetric difference -'''''''''''''''''''''''''''''''''''''''''''''''''''''' +``symDifference(geometry, geometry)``: returns ``symetric difference`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* geometry: Geometry 1:1 required +* ``geometry`` (``Geometry``) required -* geometry: Geometry 1:1 required +* ``geometry`` (``Geometry``) required -* symetric difference: Geometry 1:1 required +* ``symetric difference`` (``Geometry``) -tan(radians): tan -''''''''''''''''' +``tan(radians)``: returns ``tan`` +''''''''''''''''''''''''''''''''' -* radians: Number 1:1 required +* ``radians`` (``Number``) required -* tan: Double 1:1 required +* ``tan`` (``Double``) -tint(color, weight): result -''''''''''''''''''''''''''' +``tint(color, weight)``: returns ``result`` +''''''''''''''''''''''''''''''''''''''''''' -* color: Color 1:1 required +* ``color`` (``Color``) required -* weight: Double 1:1 required +* ``weight`` (``Double``) required -* result: Color 1:1 required +* ``result`` (``Color``) -toDegrees(radians): degrees -''''''''''''''''''''''''''' +``toDegrees(radians)``: returns ``degrees`` +''''''''''''''''''''''''''''''''''''''''''' -* radians: Number 1:1 required +* ``radians`` (``Number``) required -* degrees: Double 1:1 required +* ``degrees`` (``Double``) -toRadians(degree): radians -'''''''''''''''''''''''''' +``toRadians(degree)``: returns ``radians`` +'''''''''''''''''''''''''''''''''''''''''' -* degree: Number 1:1 required +* ``degree`` (``Number``) required -* radians: Double 1:1 required +* ``radians`` (``Double``) -toWKT(geometry): wkt -'''''''''''''''''''' +``toWKT(geometry)``: returns ``wkt`` +'''''''''''''''''''''''''''''''''''' -* geometry: Geometry 1:1 required +* ``geometry`` (``Geometry``) required -* wkt: String 1:1 required +* ``wkt`` (``String``) -touches(geometry, geometry): touches -'''''''''''''''''''''''''''''''''''' +``touches(geometry, geometry)``: returns ``touches`` +'''''''''''''''''''''''''''''''''''''''''''''''''''' -* geometry: Geometry 1:1 required +* ``geometry`` (``Geometry``) required -* geometry: Geometry 1:1 required +* ``geometry`` (``Geometry``) required -* touches: Boolean 1:1 required +* ``touches`` (``Boolean``) -union(geometry, geometry): union -'''''''''''''''''''''''''''''''' +``union(geometry, geometry)``: returns ``union`` +'''''''''''''''''''''''''''''''''''''''''''''''' -* geometry: Geometry 1:1 required +* ``geometry`` (``Geometry``) required -* geometry: Geometry 1:1 required +* ``geometry`` (``Geometry``) required -* union: Geometry 1:1 required +* ``union`` (``Geometry``) -vertices(geometry): vertices -'''''''''''''''''''''''''''' +``vertices(geometry)``: returns ``vertices`` +'''''''''''''''''''''''''''''''''''''''''''' -* geometry: Geometry 1:1 required +* ``geometry`` (``Geometry``) required -* vertices: MultiPoint 1:1 required +* ``vertices`` (``MultiPoint``) -within(geometry, geometry): within -'''''''''''''''''''''''''''''''''' +``within(geometry, geometry)``: returns ``within`` +'''''''''''''''''''''''''''''''''''''''''''''''''' -* geometry: Geometry 1:1 required +* ``geometry`` (``Geometry``) required -* geometry: Geometry 1:1 required +* ``geometry`` (``Geometry``) required -* within: Boolean 1:1 required +* ``within`` (``Boolean``) -ProcessFunctionFactory -^^^^^^^^^^^^^^^^^^^^^^ +``ProcessFunctionFactory`` +^^^^^^^^^^^^^^^^^^^^^^^^^^ -May 03, 2019 12:32:04 PM org.geotools.image.ImageWorker +Sep 10, 2019 5:15:28 PM org.geotools.image.ImageWorker INFO: Warp/affine reduction enabled: true Contains 102 functions. -AddCoverages(coverageA, coverageB): result -'''''''''''''''''''''''''''''''''''''''''' +``AddCoverages(coverageA, coverageB)``: returns ``result`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* coverageA: GridCoverage2D 1:1 required +* ``coverageA`` (``GridCoverage2D``) required -* coverageB: GridCoverage2D 1:1 required +* ``coverageB`` (``GridCoverage2D``) required -* result: GridCoverage2D 1:1 required +* ``result`` (``GridCoverage2D``) -Affine(coverage, scalex, scaley, shearx, sheary, translatex, translatey, nodata, interpolation): result -''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +``Affine(coverage, scalex, scaley, shearx, sheary, translatex, translatey, nodata, interpolation)``: returns ``result`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* coverage: GridCoverage2D 1:1 required +* ``coverage`` (``GridCoverage2D``) required -* scalex: Double 0:1 optional +* ``scalex`` (``Double``) optional -* scaley: Double 0:1 optional +* ``scaley`` (``Double``) optional -* shearx: Double 0:1 optional +* ``shearx`` (``Double``) optional -* sheary: Double 0:1 optional +* ``sheary`` (``Double``) optional -* translatex: Double 0:1 optional +* ``translatex`` (``Double``) optional -* translatey: Double 0:1 optional +* ``translatey`` (``Double``) optional -* nodata: double 0:unbounded +* ``nodata`` (``double``) -* interpolation: Interpolation 0:1 optional +* ``interpolation`` (``Interpolation``) optional -* result: GridCoverage2D 1:1 required +* ``result`` (``GridCoverage2D``) -Aggregate(features, aggregationAttribute, function, singlePass, groupByAttributes): result -'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +``Aggregate(features, aggregationAttribute, function, singlePass, groupByAttributes)``: returns ``result`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* features: SimpleFeatureCollection 1:1 required +* ``features`` (``SimpleFeatureCollection``) required -* aggregationAttribute: String 0:1 optional +* ``aggregationAttribute`` (``String``) optional -* function: AggregationFunction 0:unbounded +* ``function`` (``AggregationFunction``) -* singlePass: Boolean 1:1 required +* ``singlePass`` (``Boolean``) required -* groupByAttributes: String 0:unbounded +* ``groupByAttributes`` (``String``) -* result: Results 1:1 required +* ``result`` (``Results``) -AreaGrid(envelope, width, height): result -''''''''''''''''''''''''''''''''''''''''' +``AreaGrid(envelope, width, height)``: returns ``result`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* envelope: ReferencedEnvelope 1:1 required +* ``envelope`` (``ReferencedEnvelope``) required -* width: Integer 1:1 required +* ``width`` (``Integer``) required -* height: Integer 1:1 required +* ``height`` (``Integer``) required -* result: GridCoverage2D 1:1 required +* ``result`` (``GridCoverage2D``) -BandMerge(coverages, roi, transformChoice, index): result -''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +``BandMerge(coverages, roi, transformChoice, index)``: returns ``result`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* coverages: GridCoverage2D 1:unbounded required +* ``coverages`` (``GridCoverage2D``) required -* roi: Geometry 0:1 optional +* ``roi`` (``Geometry``) optional -* transformChoice: String 0:1 optional +* ``transformChoice`` (``String``) optional -* index: Integer 0:1 optional +* ``index`` (``Integer``) optional -* result: GridCoverage2D 1:1 required +* ``result`` (``GridCoverage2D``) -BandSelect(coverage, SampleDimensions, VisibleSampleDimension): result -'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +``BandSelect(coverage, SampleDimensions, VisibleSampleDimension)``: returns ``result`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* coverage: GridCoverage2D 1:1 required +* ``coverage`` (``GridCoverage2D``) required -* SampleDimensions: int 1:unbounded required +* ``SampleDimensions`` (``int``) required -* VisibleSampleDimension: Integer 0:1 optional +* ``VisibleSampleDimension`` (``Integer``) optional -* result: GridCoverage2D 1:1 required +* ``result`` (``GridCoverage2D``) -BarnesSurface(data, valueAttr, dataLimit, scale, convergence, passes, minObservations, maxObservationDistance, noDataValue, pixelsPerCell, queryBuffer, outputBBOX, outputWidth, outputHeight): result -'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +``BarnesSurface(data, valueAttr, dataLimit, scale, convergence, passes, minObservations, maxObservationDistance, noDataValue, pixelsPerCell, queryBuffer, outputBBOX, outputWidth, outputHeight)``: returns ``result`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* data: SimpleFeatureCollection 1:1 required +* ``data`` (``SimpleFeatureCollection``) required -* valueAttr: String 1:1 required +* ``valueAttr`` (``String``) required -* dataLimit: Integer 0:1 optional +* ``dataLimit`` (``Integer``) optional -* scale: Double 1:1 required +* ``scale`` (``Double``) required -* convergence: Double 0:1 optional +* ``convergence`` (``Double``) optional -* passes: Integer 0:1 optional +* ``passes`` (``Integer``) optional -* minObservations: Integer 0:1 optional +* ``minObservations`` (``Integer``) optional -* maxObservationDistance: Double 0:1 optional +* ``maxObservationDistance`` (``Double``) optional -* noDataValue: Double 0:1 optional +* ``noDataValue`` (``Double``) optional -* pixelsPerCell: Integer 0:1 optional +* ``pixelsPerCell`` (``Integer``) optional -* queryBuffer: Double 0:1 optional +* ``queryBuffer`` (``Double``) optional -* outputBBOX: ReferencedEnvelope 1:1 required +* ``outputBBOX`` (``ReferencedEnvelope``) required -* outputWidth: Integer 1:1 required +* ``outputWidth`` (``Integer``) required -* outputHeight: Integer 1:1 required +* ``outputHeight`` (``Integer``) required -* result: GridCoverage2D 1:1 required +* ``result`` (``GridCoverage2D``) -Bounds(features): bounds -'''''''''''''''''''''''' +``Bounds(features)``: returns ``bounds`` +'''''''''''''''''''''''''''''''''''''''' -* features: FeatureCollection 1:1 required +* ``features`` (``FeatureCollection``) required -* bounds: ReferencedEnvelope 1:1 required +* ``bounds`` (``ReferencedEnvelope``) -BufferFeatureCollection(features, distance, attributeName): result -'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +``BufferFeatureCollection(features, distance, attributeName)``: returns ``result`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* features: SimpleFeatureCollection 1:1 required +* ``features`` (``SimpleFeatureCollection``) required -* distance: Double 1:1 required +* ``distance`` (``Double``) required -* attributeName: String 0:1 optional +* ``attributeName`` (``String``) optional -* result: SimpleFeatureCollection 1:1 required +* ``result`` (``SimpleFeatureCollection``) -Centroid(features): result -'''''''''''''''''''''''''' +``Centroid(features)``: returns ``result`` +'''''''''''''''''''''''''''''''''''''''''' -* features: SimpleFeatureCollection 1:1 required +* ``features`` (``SimpleFeatureCollection``) required -* result: SimpleFeatureCollection 1:1 required +* ``result`` (``SimpleFeatureCollection``) -ClassifyByRange(features, classifyOnAttribute, thresholds, outputValues, classifier, classes, include, outputAttribute, outputType): result -''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +``ClassifyByRange(features, classifyOnAttribute, thresholds, outputValues, classifier, classes, include, outputAttribute, outputType)``: returns ``result`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* features: SimpleFeatureCollection 1:1 required +* ``features`` (``SimpleFeatureCollection``) required -* classifyOnAttribute: String 1:1 required +* ``classifyOnAttribute`` (``String``) required -* thresholds: String 0:unbounded +* ``thresholds`` (``String``) -* outputValues: String 0:unbounded +* ``outputValues`` (``String``) -* classifier: String 0:1 optional +* ``classifier`` (``String``) optional -* classes: Integer 0:1 optional +* ``classes`` (``Integer``) optional -* include: Boolean 0:1 optional +* ``include`` (``Boolean``) optional -* outputAttribute: String 0:1 optional +* ``outputAttribute`` (``String``) optional -* outputType: String 0:1 optional +* ``outputType`` (``String``) optional -* result: SimpleFeatureCollection 1:1 required +* ``result`` (``SimpleFeatureCollection``) -Clip(features, clip, preserveZ): result -''''''''''''''''''''''''''''''''''''''' +``Clip(features, clip, preserveZ)``: returns ``result`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* features: SimpleFeatureCollection 1:1 required +* ``features`` (``SimpleFeatureCollection``) required -* clip: Geometry 1:1 required +* ``clip`` (``Geometry``) required -* preserveZ: Boolean 0:1 optional +* ``preserveZ`` (``Boolean``) optional -* result: SimpleFeatureCollection 1:1 required +* ``result`` (``SimpleFeatureCollection``) -CollectGeometries(features): result -''''''''''''''''''''''''''''''''''' +``CollectGeometries(features)``: returns ``result`` +''''''''''''''''''''''''''''''''''''''''''''''''''' -* features: FeatureCollection 1:1 required +* ``features`` (``FeatureCollection``) required -* result: GeometryCollection 1:1 required +* ``result`` (``GeometryCollection``) -Contour(data, band, levels, interval, simplify, smooth, roi): result -'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +``Contour(data, band, levels, interval, simplify, smooth, roi)``: returns ``result`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* data: GridCoverage2D 1:1 required +* ``data`` (``GridCoverage2D``) required -* band: Integer 0:1 optional +* ``band`` (``Integer``) optional -* levels: double 0:unbounded +* ``levels`` (``double``) -* interval: Double 0:1 optional +* ``interval`` (``Double``) optional -* simplify: Boolean 0:1 optional +* ``simplify`` (``Boolean``) optional -* smooth: Boolean 0:1 optional +* ``smooth`` (``Boolean``) optional -* roi: Geometry 0:1 optional +* ``roi`` (``Geometry``) optional -* result: SimpleFeatureCollection 1:1 required +* ``result`` (``SimpleFeatureCollection``) -ConvolveCoverage(data, kernel, kernelRadius, kernelWidth, kernelHeight): result -''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +``ConvolveCoverage(data, kernel, kernelRadius, kernelWidth, kernelHeight)``: returns ``result`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* data: GridCoverage2D 1:1 required +* ``data`` (``GridCoverage2D``) required -* kernel: KernelJAI 0:1 optional +* ``kernel`` (``KernelJAI``) optional -* kernelRadius: Integer 0:1 optional +* ``kernelRadius`` (``Integer``) optional -* kernelWidth: Integer 0:1 optional +* ``kernelWidth`` (``Integer``) optional -* kernelHeight: Integer 0:1 optional +* ``kernelHeight`` (``Integer``) optional -* result: GridCoverage2D 1:1 required +* ``result`` (``GridCoverage2D``) -Count(features): result -''''''''''''''''''''''' +``Count(features)``: returns ``result`` +''''''''''''''''''''''''''''''''''''''' -* features: SimpleFeatureCollection 1:1 required +* ``features`` (``SimpleFeatureCollection``) required -* result: Number 1:1 required +* ``result`` (``Number``) -CoverageClassStats(coverage, stats, band, classes, method, noData): results -''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +``CoverageClassStats(coverage, stats, band, classes, method, noData)``: returns ``results`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* coverage: GridCoverage2D 1:1 required +* ``coverage`` (``GridCoverage2D``) required -* stats: Statistic 0:unbounded +* ``stats`` (``Statistic``) -* band: Integer 0:1 optional +* ``band`` (``Integer``) optional -* classes: Integer 0:1 optional +* ``classes`` (``Integer``) optional -* method: ClassificationMethod 0:1 optional +* ``method`` (``ClassificationMethod``) optional -* noData: Double 0:1 optional +* ``noData`` (``Double``) optional -* results: Results 1:1 required +* ``results`` (``Results``) -CropCoverage(coverage, cropShape): result -''''''''''''''''''''''''''''''''''''''''' +``CropCoverage(coverage, cropShape)``: returns ``result`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* coverage: GridCoverage2D 1:1 required +* ``coverage`` (``GridCoverage2D``) required -* cropShape: Geometry 1:1 required +* ``cropShape`` (``Geometry``) required -* result: GridCoverage2D 1:1 required +* ``result`` (``GridCoverage2D``) -Feature(geometry, crs, typeName): result -'''''''''''''''''''''''''''''''''''''''' +``Feature(geometry, crs, typeName)``: returns ``result`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* geometry: Geometry 1:1 required +* ``geometry`` (``Geometry``) required -* crs: CoordinateReferenceSystem 1:1 required +* ``crs`` (``CoordinateReferenceSystem``) required -* typeName: String 1:1 required +* ``typeName`` (``String``) required -* result: SimpleFeatureCollection 1:1 required +* ``result`` (``SimpleFeatureCollection``) -FeatureClassStats(features, attribute, stats, classes, method, noData): results -''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +``FeatureClassStats(features, attribute, stats, classes, method, noData)``: returns ``results`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* features: FeatureCollection 1:1 required +* ``features`` (``FeatureCollection``) required -* attribute: String 1:1 required +* ``attribute`` (``String``) required -* stats: Statistic 0:unbounded +* ``stats`` (``Statistic``) -* classes: Integer 0:1 optional +* ``classes`` (``Integer``) optional -* method: ClassificationMethod 0:1 optional +* ``method`` (``ClassificationMethod``) optional -* noData: Double 0:1 optional +* ``noData`` (``Double``) optional -* results: Results 1:1 required +* ``results`` (``Results``) -Grid(bounds, width, height, vertexSpacing, mode): result -'''''''''''''''''''''''''''''''''''''''''''''''''''''''' +``Grid(bounds, width, height, vertexSpacing, mode)``: returns ``result`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* bounds: ReferencedEnvelope 1:1 required +* ``bounds`` (``ReferencedEnvelope``) required -* width: Double 1:1 required +* ``width`` (``Double``) required -* height: Double 0:1 optional +* ``height`` (``Double``) optional -* vertexSpacing: Double 0:1 optional +* ``vertexSpacing`` (``Double``) optional -* mode: GridMode 1:1 required +* ``mode`` (``GridMode``) required -* result: SimpleFeatureCollection 1:1 required +* ``result`` (``SimpleFeatureCollection``) -Heatmap(data, radiusPixels, weightAttr, pixelsPerCell, outputBBOX, outputWidth, outputHeight): result -''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +``Heatmap(data, radiusPixels, weightAttr, pixelsPerCell, outputBBOX, outputWidth, outputHeight)``: returns ``result`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* data: SimpleFeatureCollection 1:1 required +* ``data`` (``SimpleFeatureCollection``) required -* radiusPixels: Integer 1:1 required +* ``radiusPixels`` (``Integer``) required -* weightAttr: String 0:1 optional +* ``weightAttr`` (``String``) optional -* pixelsPerCell: Integer 0:1 optional +* ``pixelsPerCell`` (``Integer``) optional -* outputBBOX: ReferencedEnvelope 1:1 required +* ``outputBBOX`` (``ReferencedEnvelope``) required -* outputWidth: Integer 1:1 required +* ``outputWidth`` (``Integer``) required -* outputHeight: Integer 1:1 required +* ``outputHeight`` (``Integer``) required -* result: GridCoverage2D 1:1 required +* ``result`` (``GridCoverage2D``) -InclusionFeatureCollection(first, second): result -''''''''''''''''''''''''''''''''''''''''''''''''' +``InclusionFeatureCollection(first, second)``: returns ``result`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* first: SimpleFeatureCollection 1:1 required +* ``first`` (``SimpleFeatureCollection``) required -* second: SimpleFeatureCollection 1:1 required +* ``second`` (``SimpleFeatureCollection``) required -* result: SimpleFeatureCollection 1:1 required +* ``result`` (``SimpleFeatureCollection``) -IntersectionFeatureCollection(first feature collection, second feature collection, first attributes to retain, second attributes to retain, intersectionMode, percentagesEnabled, areasEnabled): result -''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +``IntersectionFeatureCollection(first feature collection, second feature collection, first attributes to retain, second attributes to retain, intersectionMode, percentagesEnabled, areasEnabled)``: returns ``result`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* first feature collection: SimpleFeatureCollection 1:1 required +* ``first feature collection`` (``SimpleFeatureCollection``) required -* second feature collection: SimpleFeatureCollection 1:1 required +* ``second feature collection`` (``SimpleFeatureCollection``) required -* first attributes to retain: String 0:unbounded +* ``first attributes to retain`` (``String``) -* second attributes to retain: String 0:unbounded +* ``second attributes to retain`` (``String``) -* intersectionMode: IntersectionMode 0:1 optional +* ``intersectionMode`` (``IntersectionMode``) optional -* percentagesEnabled: Boolean 0:1 optional +* ``percentagesEnabled`` (``Boolean``) optional -* areasEnabled: Boolean 0:1 optional +* ``areasEnabled`` (``Boolean``) optional -* result: SimpleFeatureCollection 1:1 required +* ``result`` (``SimpleFeatureCollection``) -Jiffle(coverage, script, destName, sourceName, outputType): result -'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +``Jiffle(coverage, script, destName, sourceName, outputType)``: returns ``result`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* coverage: GridCoverage2D 0:unbounded +* ``coverage`` (``GridCoverage2D``) -* script: String 1:1 required +* ``script`` (``String``) required -* destName: String 0:1 optional +* ``destName`` (``String``) optional -* sourceName: String 0:unbounded +* ``sourceName`` (``String``) -* outputType: DataType 0:1 optional +* ``outputType`` (``DataType``) optional -* result: GridCoverage2D 1:1 required +* ``result`` (``GridCoverage2D``) -LRSGeocode(features, from_measure_attb, to_measure_attb, measure): result -''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +``LRSGeocode(features, from_measure_attb, to_measure_attb, measure)``: returns ``result`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* features: FeatureCollection 1:1 required +* ``features`` (``FeatureCollection``) required -* from_measure_attb: String 1:1 required +* ``from_measure_attb`` (``String``) required -* to_measure_attb: String 1:1 required +* ``to_measure_attb`` (``String``) required -* measure: Double 1:1 required +* ``measure`` (``Double``) required -* result: FeatureCollection 1:1 required +* ``result`` (``FeatureCollection``) -LRSMeasure(features, from_measure_attb, to_measure_attb, point, crs): result -'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +``LRSMeasure(features, from_measure_attb, to_measure_attb, point, crs)``: returns ``result`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* features: FeatureCollection 1:1 required +* ``features`` (``FeatureCollection``) required -* from_measure_attb: String 1:1 required +* ``from_measure_attb`` (``String``) required -* to_measure_attb: String 1:1 required +* ``to_measure_attb`` (``String``) required -* point: Point 1:1 required +* ``point`` (``Point``) required -* crs: CoordinateReferenceSystem 0:1 optional +* ``crs`` (``CoordinateReferenceSystem``) optional -* result: FeatureCollection 1:1 required +* ``result`` (``FeatureCollection``) -LRSSegment(features, from_measure_attb, to_measure_attb, from_measure, to_measure): result -'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +``LRSSegment(features, from_measure_attb, to_measure_attb, from_measure, to_measure)``: returns ``result`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* features: FeatureCollection 1:1 required +* ``features`` (``FeatureCollection``) required -* from_measure_attb: String 1:1 required +* ``from_measure_attb`` (``String``) required -* to_measure_attb: String 1:1 required +* ``to_measure_attb`` (``String``) required -* from_measure: Double 1:1 required +* ``from_measure`` (``Double``) required -* to_measure: Double 1:1 required +* ``to_measure`` (``Double``) required -* result: FeatureCollection 1:1 required +* ``result`` (``FeatureCollection``) -MultiplyCoverages(coverageA, coverageB): result -''''''''''''''''''''''''''''''''''''''''''''''' +``MultiplyCoverages(coverageA, coverageB)``: returns ``result`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* coverageA: GridCoverage2D 1:1 required +* ``coverageA`` (``GridCoverage2D``) required -* coverageB: GridCoverage2D 1:1 required +* ``coverageB`` (``GridCoverage2D``) required -* result: GridCoverage2D 1:1 required +* ``result`` (``GridCoverage2D``) -Nearest(features, point, crs): result -''''''''''''''''''''''''''''''''''''' +``Nearest(features, point, crs)``: returns ``result`` +''''''''''''''''''''''''''''''''''''''''''''''''''''' -* features: FeatureCollection 1:1 required +* ``features`` (``FeatureCollection``) required -* point: Point 1:1 required +* ``point`` (``Point``) required -* crs: CoordinateReferenceSystem 0:1 optional +* ``crs`` (``CoordinateReferenceSystem``) optional -* result: FeatureCollection 1:1 required +* ``result`` (``FeatureCollection``) -NormalizeCoverage(data): result -''''''''''''''''''''''''''''''' +``NormalizeCoverage(data)``: returns ``result`` +''''''''''''''''''''''''''''''''''''''''''''''' -* data: GridCoverage2D 1:1 required +* ``data`` (``GridCoverage2D``) required -* result: GridCoverage2D 1:1 required +* ``result`` (``GridCoverage2D``) -PointBuffers(center, crs, distances, quadrantSegments): buffers -''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +``PointBuffers(center, crs, distances, quadrantSegments)``: returns ``buffers`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* center: Point 1:1 required +* ``center`` (``Point``) required -* crs: CoordinateReferenceSystem 0:1 optional +* ``crs`` (``CoordinateReferenceSystem``) optional -* distances: double 0:unbounded +* ``distances`` (``double``) -* quadrantSegments: Integer 0:1 optional +* ``quadrantSegments`` (``Integer``) optional -* buffers: SimpleFeatureCollection 1:1 required +* ``buffers`` (``SimpleFeatureCollection``) -PointStacker(data, cellSize, weightClusterPosition, normalize, preserveLocation, outputBBOX, outputWidth, outputHeight): result -''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +``PointStacker(data, cellSize, weightClusterPosition, normalize, preserveLocation, outputBBOX, outputWidth, outputHeight)``: returns ``result`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* data: SimpleFeatureCollection 1:1 required +* ``data`` (``SimpleFeatureCollection``) required -* cellSize: Integer 1:1 required +* ``cellSize`` (``Integer``) required -* weightClusterPosition: Boolean 1:1 required +* ``weightClusterPosition`` (``Boolean``) required -* normalize: Boolean 1:1 required +* ``normalize`` (``Boolean``) required -* preserveLocation: PreserveLocation 0:1 optional +* ``preserveLocation`` (``PreserveLocation``) optional -* outputBBOX: ReferencedEnvelope 1:1 required +* ``outputBBOX`` (``ReferencedEnvelope``) required -* outputWidth: Integer 1:1 required +* ``outputWidth`` (``Integer``) required -* outputHeight: Integer 1:1 required +* ``outputHeight`` (``Integer``) required -* result: SimpleFeatureCollection 1:1 required +* ``result`` (``SimpleFeatureCollection``) -PolyLabeller(polygon, precision): result -'''''''''''''''''''''''''''''''''''''''' +``PolyLabeller(polygon, precision)``: returns ``result`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* polygon: Geometry 1:1 required +* ``polygon`` (``Geometry``) required -* precision: Double 1:1 required +* ``precision`` (``Double``) required -* result: Geometry 1:1 required +* ``result`` (``Geometry``) -PolygonExtraction(data, band, insideEdges, roi, nodata, ranges): result -''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +``PolygonExtraction(data, band, insideEdges, roi, nodata, ranges)``: returns ``result`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* data: GridCoverage2D 1:1 required +* ``data`` (``GridCoverage2D``) required -* band: Integer 0:1 optional +* ``band`` (``Integer``) optional -* insideEdges: Boolean 0:1 optional +* ``insideEdges`` (``Boolean``) optional -* roi: Geometry 0:1 optional +* ``roi`` (``Geometry``) optional -* nodata: Number 0:unbounded +* ``nodata`` (``Number``) -* ranges: Range 0:unbounded +* ``ranges`` (``Range``) -* result: SimpleFeatureCollection 1:1 required +* ``result`` (``SimpleFeatureCollection``) -Query(features, attribute, filter): result -'''''''''''''''''''''''''''''''''''''''''' +``Query(features, attribute, filter)``: returns ``result`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* features: SimpleFeatureCollection 1:1 required +* ``features`` (``SimpleFeatureCollection``) required -* attribute: String 0:unbounded +* ``attribute`` (``String``) -* filter: Filter 0:1 optional +* ``filter`` (``Filter``) optional -* result: SimpleFeatureCollection 1:1 required +* ``result`` (``SimpleFeatureCollection``) -RangeLookup(coverage, band, ranges, outputPixelValues, noData): reclassified -'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +``RangeLookup(coverage, band, ranges, outputPixelValues, noData)``: returns ``reclassified`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* coverage: GridCoverage2D 1:1 required +* ``coverage`` (``GridCoverage2D``) required -* band: Integer 0:1 optional +* ``band`` (``Integer``) optional -* ranges: Range 0:unbounded +* ``ranges`` (``Range``) -* outputPixelValues: int 0:unbounded +* ``outputPixelValues`` (``int``) -* noData: Double 0:1 optional +* ``noData`` (``Double``) optional -* reclassified: GridCoverage2D 1:1 required +* ``reclassified`` (``GridCoverage2D``) -RasterAsPointCollection(data, targetCRS, scale, interpolation, emisphere): result -''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +``RasterAsPointCollection(data, targetCRS, scale, interpolation, emisphere)``: returns ``result`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* data: GridCoverage2D 1:1 required +* ``data`` (``GridCoverage2D``) required -* targetCRS: CoordinateReferenceSystem 0:1 optional +* ``targetCRS`` (``CoordinateReferenceSystem``) optional -* scale: Float 0:1 optional +* ``scale`` (``Float``) optional -* interpolation: Interpolation 0:1 optional +* ``interpolation`` (``Interpolation``) optional -* emisphere: Boolean 0:1 optional +* ``emisphere`` (``Boolean``) optional -* result: SimpleFeatureCollection 1:1 required +* ``result`` (``SimpleFeatureCollection``) -RasterZonalStatistics(data, band, zones, classification): statistics -'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +``RasterZonalStatistics(data, band, zones, classification)``: returns ``statistics`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* data: GridCoverage2D 1:1 required +* ``data`` (``GridCoverage2D``) required -* band: Integer 0:1 optional +* ``band`` (``Integer``) optional -* zones: SimpleFeatureCollection 1:1 required +* ``zones`` (``SimpleFeatureCollection``) required -* classification: GridCoverage2D 0:1 optional +* ``classification`` (``GridCoverage2D``) optional -* statistics: SimpleFeatureCollection 1:1 required +* ``statistics`` (``SimpleFeatureCollection``) -RasterZonalStatistics2(source, bands, zones, classifier, nodata, mask, useROIAccessor, roi, statistics, minbounds, maxbounds, numbins, rangeData, localStats): zonal statistics -''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +``RasterZonalStatistics2(source, bands, zones, classifier, nodata, mask, useROIAccessor, roi, statistics, minbounds, maxbounds, numbins, rangeData, localStats)``: returns ``zonal statistics`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* source: GridCoverage2D 1:1 required +* ``source`` (``GridCoverage2D``) required -* bands: int 0:unbounded +* ``bands`` (``int``) -* zones: Object 0:unbounded +* ``zones`` (``Object``) -* classifier: GridCoverage2D 0:1 optional +* ``classifier`` (``GridCoverage2D``) optional -* nodata: Range 1:1 required +* ``nodata`` (``Range``) required -* mask: Geometry 1:1 required +* ``mask`` (``Geometry``) required -* useROIAccessor: Boolean 1:1 required +* ``useROIAccessor`` (``Boolean``) required -* roi: Polygon 1:1 required +* ``roi`` (``Polygon``) required -* statistics: StatsType 0:unbounded +* ``statistics`` (``StatsType``) -* minbounds: double 0:unbounded +* ``minbounds`` (``double``) -* maxbounds: double 0:unbounded +* ``maxbounds`` (``double``) -* numbins: int 0:unbounded +* ``numbins`` (``int``) -* rangeData: Object 0:unbounded +* ``rangeData`` (``Object``) -* localStats: Boolean 1:1 required +* ``localStats`` (``Boolean``) required -* zonal statistics: List 1:1 required +* ``zonal statistics`` (``List``) -RectangularClip(features, clip, preserveZ): result -'''''''''''''''''''''''''''''''''''''''''''''''''' +``RectangularClip(features, clip, preserveZ)``: returns ``result`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* features: SimpleFeatureCollection 1:1 required +* ``features`` (``SimpleFeatureCollection``) required -* clip: ReferencedEnvelope 1:1 required +* ``clip`` (``ReferencedEnvelope``) required -* preserveZ: Boolean 0:1 optional +* ``preserveZ`` (``Boolean``) optional -* result: SimpleFeatureCollection 1:1 required +* ``result`` (``SimpleFeatureCollection``) -Reproject(features, forcedCRS, targetCRS): result -''''''''''''''''''''''''''''''''''''''''''''''''' +``Reproject(features, forcedCRS, targetCRS)``: returns ``result`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* features: SimpleFeatureCollection 1:1 required +* ``features`` (``SimpleFeatureCollection``) required -* forcedCRS: CoordinateReferenceSystem 0:1 optional +* ``forcedCRS`` (``CoordinateReferenceSystem``) optional -* targetCRS: CoordinateReferenceSystem 0:1 optional +* ``targetCRS`` (``CoordinateReferenceSystem``) optional -* result: SimpleFeatureCollection 1:1 required +* ``result`` (``SimpleFeatureCollection``) -ScaleCoverage(coverage, xScale, yScale, xTranslate, yTranslate, interpolation): result -'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +``ScaleCoverage(coverage, xScale, yScale, xTranslate, yTranslate, interpolation)``: returns ``result`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* coverage: GridCoverage2D 1:1 required +* ``coverage`` (``GridCoverage2D``) required -* xScale: Double 1:1 required +* ``xScale`` (``Double``) required -* yScale: Double 1:1 required +* ``yScale`` (``Double``) required -* xTranslate: Double 1:1 required +* ``xTranslate`` (``Double``) required -* yTranslate: Double 1:1 required +* ``yTranslate`` (``Double``) required -* interpolation: Interpolation 0:1 optional +* ``interpolation`` (``Interpolation``) optional -* result: GridCoverage2D 1:1 required +* ``result`` (``GridCoverage2D``) -Simplify(features, distance, preserveTopology): result -'''''''''''''''''''''''''''''''''''''''''''''''''''''' +``Simplify(features, distance, preserveTopology)``: returns ``result`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* features: SimpleFeatureCollection 1:1 required +* ``features`` (``SimpleFeatureCollection``) required -* distance: Double 1:1 required +* ``distance`` (``Double``) required -* preserveTopology: Boolean 1:1 required +* ``preserveTopology`` (``Boolean``) required -* result: SimpleFeatureCollection 1:1 required +* ``result`` (``SimpleFeatureCollection``) -Snap(features, point, crs): result -'''''''''''''''''''''''''''''''''' +``Snap(features, point, crs)``: returns ``result`` +'''''''''''''''''''''''''''''''''''''''''''''''''' -* features: FeatureCollection 1:1 required +* ``features`` (``FeatureCollection``) required -* point: Point 1:1 required +* ``point`` (``Point``) required -* crs: CoordinateReferenceSystem 0:1 optional +* ``crs`` (``CoordinateReferenceSystem``) optional -* result: FeatureCollection 1:1 required +* ``result`` (``FeatureCollection``) -StyleCoverage(coverage, style): result -'''''''''''''''''''''''''''''''''''''' +``StyleCoverage(coverage, style)``: returns ``result`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''' -* coverage: GridCoverage2D 1:1 required +* ``coverage`` (``GridCoverage2D``) required -* style: Style 1:1 required +* ``style`` (``Style``) required -* result: GridCoverage2D 1:1 required +* ``result`` (``GridCoverage2D``) -Transform(features, transform): result -'''''''''''''''''''''''''''''''''''''' +``Transform(features, transform)``: returns ``result`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''' -* features: SimpleFeatureCollection 1:1 required +* ``features`` (``SimpleFeatureCollection``) required -* transform: String 1:1 required +* ``transform`` (``String``) required -* result: SimpleFeatureCollection 1:1 required +* ``result`` (``SimpleFeatureCollection``) -TransparencyFill(data): result -'''''''''''''''''''''''''''''' +``TransparencyFill(data)``: returns ``result`` +'''''''''''''''''''''''''''''''''''''''''''''' -* data: GridCoverage2D 1:1 required +* ``data`` (``GridCoverage2D``) required -* result: GridCoverage2D 1:1 required +* ``result`` (``GridCoverage2D``) -UnionFeatureCollection(first, second): result -''''''''''''''''''''''''''''''''''''''''''''' +``UnionFeatureCollection(first, second)``: returns ``result`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* first: SimpleFeatureCollection 1:1 required +* ``first`` (``SimpleFeatureCollection``) required -* second: SimpleFeatureCollection 1:1 required +* ``second`` (``SimpleFeatureCollection``) required -* result: SimpleFeatureCollection 1:1 required +* ``result`` (``SimpleFeatureCollection``) -Unique(features, attribute): result -''''''''''''''''''''''''''''''''''' +``Unique(features, attribute)``: returns ``result`` +''''''''''''''''''''''''''''''''''''''''''''''''''' -* features: SimpleFeatureCollection 1:1 required +* ``features`` (``SimpleFeatureCollection``) required -* attribute: String 1:1 required +* ``attribute`` (``String``) required -* result: SimpleFeatureCollection 1:1 required +* ``result`` (``SimpleFeatureCollection``) -VectorToRaster(features, rasterWidth, rasterHeight, title, attribute, bounds): result -''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +``VectorToRaster(features, rasterWidth, rasterHeight, title, attribute, bounds)``: returns ``result`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* features: SimpleFeatureCollection 1:1 required +* ``features`` (``SimpleFeatureCollection``) required -* rasterWidth: Integer 1:1 required +* ``rasterWidth`` (``Integer``) required -* rasterHeight: Integer 1:1 required +* ``rasterHeight`` (``Integer``) required -* title: String 0:1 optional +* ``title`` (``String``) optional -* attribute: String 1:1 required +* ``attribute`` (``String``) required -* bounds: Envelope 0:1 optional +* ``bounds`` (``Envelope``) optional -* result: GridCoverage2D 1:1 required +* ``result`` (``GridCoverage2D``) -VectorZonalStatistics(data, dataAttribute, zones): statistics -''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +``VectorZonalStatistics(data, dataAttribute, zones)``: returns ``statistics`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* data: SimpleFeatureCollection 1:1 required +* ``data`` (``SimpleFeatureCollection``) required -* dataAttribute: String 1:1 required +* ``dataAttribute`` (``String``) required -* zones: SimpleFeatureCollection 1:1 required +* ``zones`` (``SimpleFeatureCollection``) required -* statistics: SimpleFeatureCollection 1:1 required +* ``statistics`` (``SimpleFeatureCollection``) -area(geom): result -'''''''''''''''''' +``area(geom)``: returns ``result`` +'''''''''''''''''''''''''''''''''' -* geom: Geometry 1:1 required +* ``geom`` (``Geometry``) required -* result: double 1:1 required +* ``result`` (``double``) -boundary(geom): result -'''''''''''''''''''''' +``boundary(geom)``: returns ``result`` +'''''''''''''''''''''''''''''''''''''' -* geom: Geometry 1:1 required +* ``geom`` (``Geometry``) required -* result: Geometry 1:1 required +* ``result`` (``Geometry``) -buffer(geom, distance, quadrantSegments, capStyle): result -'''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +``buffer(geom, distance, quadrantSegments, capStyle)``: returns ``result`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* geom: Geometry 1:1 required +* ``geom`` (``Geometry``) required -* distance: Double 1:1 required +* ``distance`` (``Double``) required -* quadrantSegments: Integer 0:1 optional +* ``quadrantSegments`` (``Integer``) optional -* capStyle: BufferCapStyle 0:1 optional +* ``capStyle`` (``BufferCapStyle``) optional -* result: Geometry 1:1 required +* ``result`` (``Geometry``) -centroid(geom): result -'''''''''''''''''''''' +``centroid(geom)``: returns ``result`` +'''''''''''''''''''''''''''''''''''''' -* geom: Geometry 1:1 required +* ``geom`` (``Geometry``) required -* result: Geometry 1:1 required +* ``result`` (``Geometry``) -contains(a, b): result -'''''''''''''''''''''' +``contains(a, b)``: returns ``result`` +'''''''''''''''''''''''''''''''''''''' -* a: Geometry 1:1 required +* ``a`` (``Geometry``) required -* b: Geometry 1:1 required +* ``b`` (``Geometry``) required -* result: boolean 1:1 required +* ``result`` (``boolean``) -convexHull(geom): result -'''''''''''''''''''''''' +``convexHull(geom)``: returns ``result`` +'''''''''''''''''''''''''''''''''''''''' -* geom: Geometry 1:1 required +* ``geom`` (``Geometry``) required -* result: Geometry 1:1 required +* ``result`` (``Geometry``) -crosses(a, b): result -''''''''''''''''''''' +``crosses(a, b)``: returns ``result`` +''''''''''''''''''''''''''''''''''''' -* a: Geometry 1:1 required +* ``a`` (``Geometry``) required -* b: Geometry 1:1 required +* ``b`` (``Geometry``) required -* result: boolean 1:1 required +* ``result`` (``boolean``) -densify(geom, distance): result -''''''''''''''''''''''''''''''' +``densify(geom, distance)``: returns ``result`` +''''''''''''''''''''''''''''''''''''''''''''''' -* geom: Geometry 1:1 required +* ``geom`` (``Geometry``) required -* distance: Double 1:1 required +* ``distance`` (``Double``) required -* result: Geometry 1:1 required +* ``result`` (``Geometry``) -difference(a, b): result -'''''''''''''''''''''''' +``difference(a, b)``: returns ``result`` +'''''''''''''''''''''''''''''''''''''''' -* a: Geometry 1:1 required +* ``a`` (``Geometry``) required -* b: Geometry 1:1 required +* ``b`` (``Geometry``) required -* result: Geometry 1:1 required +* ``result`` (``Geometry``) -dimension(geom): result -''''''''''''''''''''''' +``dimension(geom)``: returns ``result`` +''''''''''''''''''''''''''''''''''''''' -* geom: Geometry 1:1 required +* ``geom`` (``Geometry``) required -* result: int 1:1 required +* ``result`` (``int``) -disjoint(a, b): result -'''''''''''''''''''''' +``disjoint(a, b)``: returns ``result`` +'''''''''''''''''''''''''''''''''''''' -* a: Geometry 1:1 required +* ``a`` (``Geometry``) required -* b: Geometry 1:1 required +* ``b`` (``Geometry``) required -* result: boolean 1:1 required +* ``result`` (``boolean``) -distance(a, b): result -'''''''''''''''''''''' +``distance(a, b)``: returns ``result`` +'''''''''''''''''''''''''''''''''''''' -* a: Geometry 1:1 required +* ``a`` (``Geometry``) required -* b: Geometry 1:1 required +* ``b`` (``Geometry``) required -* result: double 1:1 required +* ``result`` (``double``) -endPoint(geom): result -'''''''''''''''''''''' +``endPoint(geom)``: returns ``result`` +'''''''''''''''''''''''''''''''''''''' -* geom: LineString 1:1 required +* ``geom`` (``LineString``) required -* result: Point 1:1 required +* ``result`` (``Point``) -envelope(geom): result -'''''''''''''''''''''' +``envelope(geom)``: returns ``result`` +'''''''''''''''''''''''''''''''''''''' -* geom: Geometry 1:1 required +* ``geom`` (``Geometry``) required -* result: Geometry 1:1 required +* ``result`` (``Geometry``) -equalsExact(a, b): result -''''''''''''''''''''''''' +``equalsExact(a, b)``: returns ``result`` +''''''''''''''''''''''''''''''''''''''''' -* a: Geometry 1:1 required +* ``a`` (``Geometry``) required -* b: Geometry 1:1 required +* ``b`` (``Geometry``) required -* result: boolean 1:1 required +* ``result`` (``boolean``) -equalsExactTolerance(a, b, tolerance): result -''''''''''''''''''''''''''''''''''''''''''''' +``equalsExactTolerance(a, b, tolerance)``: returns ``result`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* a: Geometry 1:1 required +* ``a`` (``Geometry``) required -* b: Geometry 1:1 required +* ``b`` (``Geometry``) required -* tolerance: Double 1:1 required +* ``tolerance`` (``Double``) required -* result: boolean 1:1 required +* ``result`` (``boolean``) -exteriorRing(geom): result -'''''''''''''''''''''''''' +``exteriorRing(geom)``: returns ``result`` +'''''''''''''''''''''''''''''''''''''''''' -* geom: Polygon 1:1 required +* ``geom`` (``Polygon``) required -* result: Geometry 1:1 required +* ``result`` (``Geometry``) -geometryType(geom): result -'''''''''''''''''''''''''' +``geometryType(geom)``: returns ``result`` +'''''''''''''''''''''''''''''''''''''''''' -* geom: Geometry 1:1 required +* ``geom`` (``Geometry``) required -* result: String 1:1 required +* ``result`` (``String``) -getGeometryN(geom, index): result -''''''''''''''''''''''''''''''''' +``getGeometryN(geom, index)``: returns ``result`` +''''''''''''''''''''''''''''''''''''''''''''''''' -* geom: GeometryCollection 1:1 required +* ``geom`` (``GeometryCollection``) required -* index: Integer 1:1 required +* ``index`` (``Integer``) required -* result: Geometry 1:1 required +* ``result`` (``Geometry``) -getX(geom): result -'''''''''''''''''' +``getX(geom)``: returns ``result`` +'''''''''''''''''''''''''''''''''' -* geom: Point 1:1 required +* ``geom`` (``Point``) required -* result: double 1:1 required +* ``result`` (``double``) -getY(geom): result -'''''''''''''''''' +``getY(geom)``: returns ``result`` +'''''''''''''''''''''''''''''''''' -* geom: Point 1:1 required +* ``geom`` (``Point``) required -* result: double 1:1 required +* ``result`` (``double``) -interiorPoint(geom): result -''''''''''''''''''''''''''' +``interiorPoint(geom)``: returns ``result`` +''''''''''''''''''''''''''''''''''''''''''' -* geom: Geometry 1:1 required +* ``geom`` (``Geometry``) required -* result: Geometry 1:1 required +* ``result`` (``Geometry``) -interiorRingN(geom, index): result -'''''''''''''''''''''''''''''''''' +``interiorRingN(geom, index)``: returns ``result`` +'''''''''''''''''''''''''''''''''''''''''''''''''' -* geom: Polygon 1:1 required +* ``geom`` (``Polygon``) required -* index: Integer 1:1 required +* ``index`` (``Integer``) required -* result: Geometry 1:1 required +* ``result`` (``Geometry``) -intersection(a, b): result -'''''''''''''''''''''''''' +``intersection(a, b)``: returns ``result`` +'''''''''''''''''''''''''''''''''''''''''' -* a: Geometry 1:1 required +* ``a`` (``Geometry``) required -* b: Geometry 1:1 required +* ``b`` (``Geometry``) required -* result: Geometry 1:1 required +* ``result`` (``Geometry``) -intersects(a, b): result -'''''''''''''''''''''''' +``intersects(a, b)``: returns ``result`` +'''''''''''''''''''''''''''''''''''''''' -* a: Geometry 1:1 required +* ``a`` (``Geometry``) required -* b: Geometry 1:1 required +* ``b`` (``Geometry``) required -* result: boolean 1:1 required +* ``result`` (``boolean``) -isClosed(geom): result -'''''''''''''''''''''' +``isClosed(geom)``: returns ``result`` +'''''''''''''''''''''''''''''''''''''' -* geom: LineString 1:1 required +* ``geom`` (``LineString``) required -* result: boolean 1:1 required +* ``result`` (``boolean``) -isEmpty(geom): result -''''''''''''''''''''' +``isEmpty(geom)``: returns ``result`` +''''''''''''''''''''''''''''''''''''' -* geom: Geometry 1:1 required +* ``geom`` (``Geometry``) required -* result: boolean 1:1 required +* ``result`` (``boolean``) -isRing(geom): result -'''''''''''''''''''' +``isRing(geom)``: returns ``result`` +'''''''''''''''''''''''''''''''''''' -* geom: LineString 1:1 required +* ``geom`` (``LineString``) required -* result: boolean 1:1 required +* ``result`` (``boolean``) -isSimple(geom): result -'''''''''''''''''''''' +``isSimple(geom)``: returns ``result`` +'''''''''''''''''''''''''''''''''''''' -* geom: Geometry 1:1 required +* ``geom`` (``Geometry``) required -* result: boolean 1:1 required +* ``result`` (``boolean``) -isValid(geom): result -''''''''''''''''''''' +``isValid(geom)``: returns ``result`` +''''''''''''''''''''''''''''''''''''' -* geom: Geometry 1:1 required +* ``geom`` (``Geometry``) required -* result: boolean 1:1 required +* ``result`` (``boolean``) -isWithinDistance(a, b, distance): result -'''''''''''''''''''''''''''''''''''''''' +``isWithinDistance(a, b, distance)``: returns ``result`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* a: Geometry 1:1 required +* ``a`` (``Geometry``) required -* b: Geometry 1:1 required +* ``b`` (``Geometry``) required -* distance: Double 1:1 required +* ``distance`` (``Double``) required -* result: boolean 1:1 required +* ``result`` (``boolean``) -length(geom): result -'''''''''''''''''''' +``length(geom)``: returns ``result`` +'''''''''''''''''''''''''''''''''''' -* geom: Geometry 1:1 required +* ``geom`` (``Geometry``) required -* result: double 1:1 required +* ``result`` (``double``) -numGeometries(geom): result -''''''''''''''''''''''''''' +``numGeometries(geom)``: returns ``result`` +''''''''''''''''''''''''''''''''''''''''''' -* geom: Geometry 1:1 required +* ``geom`` (``Geometry``) required -* result: int 1:1 required +* ``result`` (``int``) -numInteriorRing(geom): result -''''''''''''''''''''''''''''' +``numInteriorRing(geom)``: returns ``result`` +''''''''''''''''''''''''''''''''''''''''''''' -* geom: Polygon 1:1 required +* ``geom`` (``Polygon``) required -* result: int 1:1 required +* ``result`` (``int``) -numPoints(geom): result -''''''''''''''''''''''' +``numPoints(geom)``: returns ``result`` +''''''''''''''''''''''''''''''''''''''' -* geom: Geometry 1:1 required +* ``geom`` (``Geometry``) required -* result: int 1:1 required +* ``result`` (``int``) -octagonalEnvelope(geom): result -''''''''''''''''''''''''''''''' +``octagonalEnvelope(geom)``: returns ``result`` +''''''''''''''''''''''''''''''''''''''''''''''' -* geom: Geometry 1:1 required +* ``geom`` (``Geometry``) required -* result: Geometry 1:1 required +* ``result`` (``Geometry``) -overlaps(a, b): result -'''''''''''''''''''''' +``overlaps(a, b)``: returns ``result`` +'''''''''''''''''''''''''''''''''''''' -* a: Geometry 1:1 required +* ``a`` (``Geometry``) required -* b: Geometry 1:1 required +* ``b`` (``Geometry``) required -* result: boolean 1:1 required +* ``result`` (``boolean``) -parameter(argumentName, values): parameterMap -''''''''''''''''''''''''''''''''''''''''''''' +``parameter(argumentName, values)``: returns ``parameterMap`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* argumentName: String 1:1 required +* ``argumentName`` (``String``) required -* values: Object 0:unbounded +* ``values`` (``Object``) -* parameterMap: Map 1:1 required +* ``parameterMap`` (``Map``) -pointN(geom, index): result -''''''''''''''''''''''''''' +``pointN(geom, index)``: returns ``result`` +''''''''''''''''''''''''''''''''''''''''''' -* geom: LineString 1:1 required +* ``geom`` (``LineString``) required -* index: Integer 1:1 required +* ``index`` (``Integer``) required -* result: Point 1:1 required +* ``result`` (``Point``) -polygonize(geom): result -'''''''''''''''''''''''' +``polygonize(geom)``: returns ``result`` +'''''''''''''''''''''''''''''''''''''''' -* geom: Geometry 1:1 required +* ``geom`` (``Geometry``) required -* result: Geometry 1:1 required +* ``result`` (``Geometry``) -relate(a, b): result -'''''''''''''''''''' +``relate(a, b)``: returns ``result`` +'''''''''''''''''''''''''''''''''''' -* a: Geometry 1:1 required +* ``a`` (``Geometry``) required -* b: Geometry 1:1 required +* ``b`` (``Geometry``) required -* result: String 1:1 required +* ``result`` (``String``) -relatePattern(a, b, Relate pattern): result -''''''''''''''''''''''''''''''''''''''''''' +``relatePattern(a, b, Relate pattern)``: returns ``result`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* a: Geometry 1:1 required +* ``a`` (``Geometry``) required -* b: Geometry 1:1 required +* ``b`` (``Geometry``) required -* Relate pattern: String 1:1 required +* ``Relate pattern`` (``String``) required -* result: boolean 1:1 required +* ``result`` (``boolean``) -reproject(geometry, sourceCRS, targetCRS): result -''''''''''''''''''''''''''''''''''''''''''''''''' +``reproject(geometry, sourceCRS, targetCRS)``: returns ``result`` +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* geometry: Geometry 1:1 required +* ``geometry`` (``Geometry``) required -* sourceCRS: CoordinateReferenceSystem 0:1 optional +* ``sourceCRS`` (``CoordinateReferenceSystem``) optional -* targetCRS: CoordinateReferenceSystem 0:1 optional +* ``targetCRS`` (``CoordinateReferenceSystem``) optional -* result: Geometry 1:1 required +* ``result`` (``Geometry``) -simplify(geom, distance): result -'''''''''''''''''''''''''''''''' +``simplify(geom, distance)``: returns ``result`` +'''''''''''''''''''''''''''''''''''''''''''''''' -* geom: Geometry 1:1 required +* ``geom`` (``Geometry``) required -* distance: Double 1:1 required +* ``distance`` (``Double``) required -* result: Geometry 1:1 required +* ``result`` (``Geometry``) -splitPolygon(polygon, line): result -''''''''''''''''''''''''''''''''''' +``splitPolygon(polygon, line)``: returns ``result`` +''''''''''''''''''''''''''''''''''''''''''''''''''' -* polygon: Geometry 1:1 required +* ``polygon`` (``Geometry``) required -* line: LineString 1:1 required +* ``line`` (``LineString``) required -* result: Geometry 1:1 required +* ``result`` (``Geometry``) -startPoint(geom): result -'''''''''''''''''''''''' +``startPoint(geom)``: returns ``result`` +'''''''''''''''''''''''''''''''''''''''' -* geom: LineString 1:1 required +* ``geom`` (``LineString``) required -* result: Point 1:1 required +* ``result`` (``Point``) -symDifference(a, b): result -''''''''''''''''''''''''''' +``symDifference(a, b)``: returns ``result`` +''''''''''''''''''''''''''''''''''''''''''' -* a: Geometry 1:1 required +* ``a`` (``Geometry``) required -* b: Geometry 1:1 required +* ``b`` (``Geometry``) required -* result: Geometry 1:1 required +* ``result`` (``Geometry``) -touches(a, b): result -''''''''''''''''''''' +``touches(a, b)``: returns ``result`` +''''''''''''''''''''''''''''''''''''' -* a: Geometry 1:1 required +* ``a`` (``Geometry``) required -* b: Geometry 1:1 required +* ``b`` (``Geometry``) required -* result: boolean 1:1 required +* ``result`` (``boolean``) -union(geom): result -''''''''''''''''''' +``union(geom)``: returns ``result`` +''''''''''''''''''''''''''''''''''' -* geom: Geometry 2:unbounded required +* ``geom`` (``Geometry``): min=2 max=unbounded -* result: Geometry 1:1 required +* ``result`` (``Geometry``) -within(a, b): result -'''''''''''''''''''' +``within(a, b)``: returns ``result`` +'''''''''''''''''''''''''''''''''''' -* a: Geometry 1:1 required +* ``a`` (``Geometry``) required -* b: Geometry 1:1 required +* ``b`` (``Geometry``) required -* result: boolean 1:1 required +* ``result`` (``boolean``) -PolygonLabelFunctionFactory -^^^^^^^^^^^^^^^^^^^^^^^^^^^ +``PolygonLabelFunctionFactory`` +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Contains 1 functions. -labelPoint(polygon, tolerance): labelPoint -'''''''''''''''''''''''''''''''''''''''''' - -* polygon: Geometry 1:1 required +``labelPoint(polygon, tolerance)``: returns ``labelPoint`` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -* tolerance: double 1:1 required +* ``polygon`` (``Geometry``) required -* labelPoint: Point 1:1 required +* ``tolerance`` (``double``) required +* ``labelPoint`` (``Point``) \ No newline at end of file diff --git a/docs/user/build/faq.rst b/docs/user/build/faq.rst index b26ef83cd25..131c55a8692 100644 --- a/docs/user/build/faq.rst +++ b/docs/user/build/faq.rst @@ -18,8 +18,8 @@ Complete build instructions are provided in the user guide: * :doc:`/build/index` -GeoTools makes use of the maven build system (in part to help us reused code from -a number of other java projects). +GeoTools makes use of the Maven build system (in part to help us reused code from +a number of other Java projects). To build all the modules:: @@ -42,7 +42,7 @@ To load the modules into the eclipse IDE. Linux and Mac: :file:`~/.m2/repository` ================== ======================================================== -2. Generate the .project and .classpath files needed for eclipse:: +2. Generate the ``.project`` and ``.classpath`` files needed for eclipse:: mvn eclipse:eclipse -Dall @@ -53,7 +53,7 @@ Why is Maven 3 Slower? Maven 3 is not faster out of the box with the default settings. -Gowever what is new is that you can ask it to use more than one core:: +However what is new is that you can ask it to use more than one core:: mvn install -Dall -T 2C @@ -68,11 +68,13 @@ This is the fastest build on my machine:: The above options: -* install (without clean) only recompiles modified code -* no profiles or flags are used to build optional code; onlt the core library is built -* skipTests - the tests are still built; they are just not run -* o - allows the build to work "offline" (thus no external servers are checked during the build) -* T 2C - builds with two threads per core + + install (without clean) only re-compiles modified code + + no profiles or flags are used to build optional code; only the core library + is built + + ``skipTests`` - the tests are still built; they are just not run + + ``o`` - allows the build to work "offline" (thus no external servers are + checked during the build) + + T 2C - builds with two threads per core I use this configuration to quickly push all local changes into my local maven repository so I can test in a downstream application such as uDig or GeoServer. @@ -82,15 +84,18 @@ How do I create an executable jar for my GeoTools app? If you're familiar with Maven you might have used the `assembly plugin `_ to create self-contained, executable jars. The bad news is -that this generally won't work with GeoTools. The problem is that GeoTools modules often define one or more files in its -META-INF/services directory with the same names as files defined in other modules. The assembly plugin just copies -files with the same name over the top of each other rather than merging their contents. - -The good news is that the `Maven shade plugin `_ can be -used instead and it will correctly merge the META-INF/services files from each of the GeoTools modules used by your -application. - -The POM below will create an executable jar for the GeoTools :doc:`/tutorial/quickstart/index` module which includes all of the required +that this generally won't work with GeoTools. The problem is that GeoTools +modules often define one or more files in its ``META-INF/services`` directory +with the same names as files defined in other modules. The assembly plugin just +copies files with the same name over the top of each other rather than merging +their contents. + +The good news is that the `Maven shade plugin +`_ can be used +instead and it will correctly merge the ``META-INF/services`` files from each of +the GeoTools modules used by your application. + +The pom below will create an executable jar for the GeoTools :doc:`/tutorial/quickstart/index` module which includes all of the required GeoTools modules and their dependencies. .. sourcecode:: xml diff --git a/docs/user/build/git.rst b/docs/user/build/git.rst index 31b74722e69..134eb6ac243 100644 --- a/docs/user/build/git.rst +++ b/docs/user/build/git.rst @@ -1,7 +1,8 @@ Using Git ========= -The following helpful git tips, as so many others, are attributed to IanS and have been stolen from his email. +The following helpful git tips, as so many others, are attributed to Ian +Schneider and have been stolen from his email. Git Repository ^^^^^^^^^^^^^^ @@ -27,7 +28,8 @@ This repository is setup with the following branches of GeoTools: Typical Development Environment ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Typically, a developer will create a local 'geotools' directory, move into that directory, and do a checkout of the GeoTools repository. Within the +Typically, a developer will create a local ``geotools`` directory, move into +that directory, and do a checkout of the GeoTools repository. Within the repository switching between branches is trivial:: [geotools]% git branch @@ -100,7 +102,7 @@ Doing another status reports no more local changes:: But also reports that our local branch is ahead of the remote branch by 1 commit. This is because we have yet to push the commit. Before pushing it is always a good idea to first pull in case we have any commits that conflict with -other commits that have already been pushed up to the repostory:: +other commits that have already been pushed up to the repository:: [geotools]% git pull geotools master [geotools]% git push geotools master @@ -139,7 +141,7 @@ If the change has been staged but not yet committed:: git checkout /path/to/file/to/rollback If the change has been committed **but not pushed** it gets interesting. If the change to rollback is at the tip of the branch -(ie is the most recent commit) you can use git reset:: +(i.e. is the most recent commit) you can use git reset:: git reset @@ -172,6 +174,6 @@ Tells you info about commits/revision history:: Blame ^^^^^ -My favourite. Annotates a document with who changed what and when:: +My favorite. Annotates a document with who changed what and when:: - git blame Sample.java \ No newline at end of file + git blame Sample.java diff --git a/docs/user/build/install/index.rst b/docs/user/build/install/index.rst index 37f626b6741..cc9ef863a8b 100644 --- a/docs/user/build/install/index.rst +++ b/docs/user/build/install/index.rst @@ -52,7 +52,7 @@ The following optional downloads provide increased functionality or performance: * Oracle (Optional): - * Obtain an ojdbc jar from Oracle or your Oracle installation + * Obtain a jdbc jar from Oracle or your Oracle installation * DB2 (Optional) diff --git a/docs/user/build/install/jdk.rst b/docs/user/build/install/jdk.rst index 501a31369bc..05483822437 100644 --- a/docs/user/build/install/jdk.rst +++ b/docs/user/build/install/jdk.rst @@ -3,12 +3,12 @@ Java Install GeoTools is written in the Java Programming Language. The library is targeted for Java 8. -Java Runtime Environment: +Java Run-time Environment: * Java 11 - GeoTools 21.x and above (OpenJDK tested) * Java 8 - GeoTools 15.x and above (OpenJDK and Oracle JRE tested) * Java 7 - GeoTools 11.x to GeoTools 14.x (OpenJDK and Oracle JRE tested) -* Java 6 - Geotools 8.x to GeoTools 10.x (Oracle JRE tested) +* Java 6 - GeoTools 8.x to GeoTools 10.x (Oracle JRE tested) * Java 5 - GeoTools 2.5.x to GeoTools 8.x (Sun JRE tested) * Java 1.4 - GeoTools 2.x to GeoTools 2.4.x (Sun JRE tested) @@ -30,7 +30,7 @@ Java Initial Final Compiler Setting Compatibility Java 8 GeoTools 21.x And Above compiler=1.8 Java 8, Java 11 Java 8 GeoTools 15.x GeoTools 20.x compiler=1.8 Java 8 Java 7 GeoTools 11.x GeoTools 14.x compiler=1.7 Java 7 -Java 6 Geotools 8.x GeoTools 10.x compiler=1.6 Java 6 +Java 6 GeoTools 8.x GeoTools 10.x compiler=1.6 Java 6 Java 5 GeoTools 2.5.x GeoTools 8.x compiler=1.5 Java 5 Java 1.4 GeoTools 2.x GeoTools 2.4.x compiler=1.4 Java 1.4 ========= ================ ================ ================= =============== @@ -39,17 +39,17 @@ GeoTools 21.x built with Java 8 can be used in a Java 11 environment. Each jar i GeoTools Java 8 development is supported on both OpenJDK and Oracle JDK as downloaded from: -========================= ================== ===== ===== ======= ======= ============== -Java 8 Provider License Linux macOS Solaris Windows Free Updates -========================= ================== ===== ===== ======= ======= ============== -Oracle JDK Binary Code Licene x x x x 2019 January -Oracle OpenJDK GPL x reference only -Oracle OpenJDK Binary Code Licene x x reference only -RedHat OpenJDK GPL x 2023 June -Adopt OpenJDK GPL x x x 2023 September -========================= ================== ===== ===== ======= ======= ============== +========================= =================== ===== ====== ======= ======= ============== +Java 8 Provider License Linux macOS Solaris Windows Free Updates +========================= =================== ===== ====== ======= ======= ============== +Oracle JDK Binary Code License x x x x 2019 January +Oracle OpenJDK GPL x reference only +Oracle OpenJDK Binary Code License x x reference only +RedHat OpenJDK GPL x 2023 June +Adopt OpenJDK GPL x x x 2023 September +========================= =================== ===== ====== ======= ======= ============== -Although the closed source Oracle Technology Network Oracle JDK 8 reached end-of-life in January 2019 `free Java 8 updates `__ are provided by Linux distros, AdoptOpenJDK, Azul, IBM, Red Hat, and others. +Although the closed source Oracle Technology Network Oracle JDK 8 reached end-of-life in January 2019 `free Java 8 updates `__ are provided by Linux distributions, AdoptOpenJDK, Azul, IBM, Red Hat, and others. .. note:: Windows users, when installing a JDK do not forget to install matching JRE: @@ -73,14 +73,14 @@ GeoTools 21.x built with Java 11 can only be used in a Java 11 environment (and GeoTools Java 11 development is supported on both OpenJDK and Oracle JDK as downloaded from: -========================= ================== ===== ===== ======= ======= ============== -Java 11 Provider License Linux macOS Solaris Windows Free Updates -========================= ================== ===== ===== ======= ======= ============== -Oracle JDK Binary Code Licene x x x x 2019 March -Oracle OpenJDK GPL x x x 2019 March -RedHat OpenJDK GPL x 2024 October -Adopt OpenJDK GPL x x x 2022 September -========================= ================== ===== ===== ======= ======= ============== +========================= =================== ===== ====== ======= ======= ============== +Java 11 Provider License Linux macOS Solaris Windows Free Updates +========================= =================== ===== ====== ======= ======= ============== +Oracle JDK Binary Code License x x x x 2019 March +Oracle OpenJDK GPL x x x 2019 March +RedHat OpenJDK GPL x 2024 October +Adopt OpenJDK GPL x x x 2022 September +========================= =================== ===== ====== ======= ======= ============== .. warning:: Since the API changes from Java version to version, building a GeoTools version with a newer Java SDK is risky (you may accidentally use a new method). Pull requests are tested against Java 8, but we do ask you to be careful. @@ -89,19 +89,19 @@ Why JAVA_HOME does not work on Windows How to use different versions of Java for building and running on windows. -Several projects expect to make use of the latest JRE runtime environment -(for speed or new features). If your computer is set up with both a stable JDK for buildin -GeoTools; and an experimental JDK for your other projects you will need to sort out how -to switch between them. +Several projects expect to make use of the latest JRE run-time environment +(for speed or new features). If your computer is set up with both a +stable JDK for building GeoTools; and an experimental JDK for your other +projects you will need to sort out how to switch between them. One technique is to set up a batch file similar to the following: -1. Hunt down the cmd.exe ( Start menu > Accessories > Command Prompt) and right click to send it to the desktop -2. Edit the desktop cmd.exe short cut and change the target to:: +1. Hunt down the ``cmd.exe`` ( Start menu > Accessories > Command Prompt) and right click to send it to the desktop +2. Edit the desktop ``cmd.exe`` short cut and change the target to:: %SystemRoot%\system32\cmd.exe /k C:\java\java8.bat -3. Create the C:\java\java8.bat file mentioned above:: +3. Create the ``C:\java\java8.bat`` file mentioned above:: set ANT_HOME=C:\java\apache-ant-1.9.4 set M2_HOME=C:\java\maven-3.0.5 @@ -110,8 +110,8 @@ One technique is to set up a batch file similar to the following: set PATH=%JAVA_HOME%\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Subversion\bin;%M2_HOME%\bin;%ANT_HOME%\bin 4. Please note that the construction of the PATH above is very important; ``JAVA_HOME\bin`` must - appear before ``SystemRoot\system32`` as the system32 contains a stub java.exe that looks up - the correct version of java to run in the registry. + appear before ``SystemRoot\system32`` as the ``system32`` contains a stub ``java.exe`` that looks up + the correct version of Java to run in the registry. .. image:: /images/jdk.png @@ -119,9 +119,9 @@ One technique is to set up a batch file similar to the following: ``My Computer\HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft > Java Development Kit > CurrentVersion`` is set to **1.8**. - The **1.8** entry documents the path to the version of java to run. + The **1.8** entry documents the path to the version of Java to run. - Placing JAVA_HOME on the path before System32 shortcuts this annoying "feature". + Placing JAVA_HOME on the path before ``System32`` shortcuts this annoying "feature". Java 8 Extensions ^^^^^^^^^^^^^^^^^ @@ -151,18 +151,18 @@ References: 2. Download JAI for your JDK by clicking on the link for your platform: - Example: jai-1_1_3-lib-windows-i586-jdk.exe + Example: ``jai-1_1_3-lib-windows-i586-jdk.exe`` 3. Use the one click installer to install JAI into your JDK 4. Download JAI for your JRE by clicking on the link for your platform: - Example: jai-1_1_3-lib-windows-i586-jre.exe + Example: ``jai-1_1_3-lib-windows-i586-jre.exe`` 5. Use the one click installer to install JAI into your JRE .. note:: - If you are working on linux you will of course need to choose the appropriate download. + If you are working on Linux you will of course need to choose the appropriate download. .. note:: @@ -194,7 +194,7 @@ References: 2. Download ImageIO for your JDK by clicking on the above link. - Example: jai_imageio-1_1-lib-windows-i586-jdk.exe + Example: ``jai_imageio-1_1-lib-windows-i586-jdk.exe`` 3. Use the one click installer to install ImageIO into your JDK @@ -202,11 +202,11 @@ References: 4. Download ImageIO for your JRE by clicking on the link for your platform - Example: jai_imageio-1_1-lib-windows-i586-jre.exe + Example: ``jai_imageio-1_1-lib-windows-i586-jre.exe`` 5. Use the one click installer to install the ImageIO into your JRE. - (If you are working on linux you will of course need to choose the appropriate download) + (If you are working on Linux you will of course need to choose the appropriate download) .. note:: @@ -224,14 +224,14 @@ ImageIO-Ext Install The installer provided here will install JAI and ImageIO if needed -The installer from the ImageIO-Ext website can be used to install into your JAVA_HOME (ie the JDK). If you like you can use this to install the software; and then copy the required jars into your JRE by hand (they end up in JAVA_HOME/jre/ext/libs and need to be copied into JRE/ext/libs). +The installer from the ImageIO-Ext website can be used to install into your JAVA_HOME (i.e. the JDK). If you like you can use this to install the software; and then copy the required jars into your JRE by hand (they end up in ``JAVA_HOME/jre/ext/libs`` and need to be copied into ``JRE/ext/libs``). 1. Download the appropriate version of ImageIO-ext: * ImageIO-EXT 1.0.10 * http://java.net/projects/imageio-ext - Tip: You can check the version of ImageIO-EXT used in the root pom.xml file. + Tip: You can check the version of ImageIO-EXT used in the root ``pom.xml`` file. 2. Download ImageIO for your JDK by clicking on the above link. @@ -252,18 +252,18 @@ This is only needed if the windows one-click installers don't work for you: * Perhaps you are on Linux? * Perhaps you are on Mac and the version of JAI/ImageIO included with your operating system is out of date? -The goal is to place the required jars into your lib/ext directory of both your JDK (for compiling) and your JRE (for running). +The goal is to place the required jars into your ``lib/ext`` directory of both your JDK (for compiling) and your JRE (for running). -Optional: macOS ImageIO -''''''''''''''''''''''' +Optional: mac OS ImageIO +'''''''''''''''''''''''' -The JAI ImageIO extension is not available as a download for macOS. However, you can use the jar from the Linux/windows download to get “pure java” functionality without hardware acceleration: +The JAI ImageIO extension is not available as a download for mac OS. However, you can use the jar from the Linux/windows download to get “pure Java” functionality without hardware acceleration: -1. Copy the jars to ~/Library/Java/Extensions +1. Copy the jars to ``~/Library/Java/Extensions`` 2. Check that the files are present as expected: - * clibwrapper_jiio.jar - * jai_core.jar - * mlibwrapper_jai.jar - * jai_codec.jar - * jai_imageio.jar + * ``clibwrapper_jiio.jar`` + * ``jai_core.jar`` + * ``mlibwrapper_jai.jar`` + * ``jai_codec.jar`` + * ``jai_imageio.jar`` diff --git a/docs/user/build/install/mvn.rst b/docs/user/build/install/mvn.rst index b6f31133dd8..78033d970e0 100644 --- a/docs/user/build/install/mvn.rst +++ b/docs/user/build/install/mvn.rst @@ -13,27 +13,27 @@ Download and Install Maven ^^^^^^^^^^^^^^^^^^^^^^^^^^ 1. Download Maven. Last tested with Maven 3.3.9. -2. Unzip the maven download to your computer: +2. Unzip the Maven download to your computer: - Example: C:\java\apache-maven-3.3.9. + Example: ``C:\java\apache-maven-3.3.9``. If you do not have an unzip program may we recommend: http://www.7-zip.org/ -3. You need to have the following environmental variables set for maven to work (note your paths may differ based on Java or Maven revision numbers): +3. You need to have the following environmental variables set for Maven to work (note your paths may differ based on Java or Maven revision numbers): - * JAVA_HOME = C:\Program Files\java\jdk1.8.0_91\ + * ``JAVA_HOME = C:\Program Files\java\jdk1.8.0_91\`` Location of your JDK installation - * M2_HOME = C:\java\apache-maven-3.0.5 + * ``M2_HOME = C:\java\apache-maven-3.0.5`` - Location of your maven installation + Location of your Maven installation - * PATH = %PATH%;%JAVA_HOME%\bin;%M2_HOME%\bin + * ``PATH = %PATH%;%JAVA_HOME%\bin;%M2_HOME%\bin`` - Include java and maven bin directory in your PATH + Include Java and Maven bin directory in your PATH -4. Open up a cmd window and type the following:: +4. Open up a ``cmd`` window and type the following:: > mvn -version Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-20 00:51:28+1100) @@ -52,6 +52,6 @@ install the latest version manually by following the `official installation inst Maven and Home Brew ^^^^^^^^^^^^^^^^^^^ -On MacOS the homebrew package manager provides a "formula" to install maven:: +On macOS the homebrew package manager provides a "formula" to install Maven:: brew install maven diff --git a/docs/user/build/install/ojdbc.rst b/docs/user/build/install/ojdbc.rst index 9b71215a6f0..90bea5a7ab1 100644 --- a/docs/user/build/install/ojdbc.rst +++ b/docs/user/build/install/ojdbc.rst @@ -3,9 +3,9 @@ Oracle (Optional) In order to use the Oracle module you need the proprietary JDBC driver from Oracle. -This page provides instructions for the plugins/jdbc/jdbc-oracle plugin: +This page provides instructions for the ``plugins/jdbc/jdbc-oracle`` plugin: -* The old unsupported Oracle datastore can be built with similar instructions. You will have to use -Doracle.jdbc in place of -Doracle when creating the Eclipse projects +* The old unsupported Oracle datastore can be built with similar instructions. You will have to use ``-Doracle.jdbc`` in place of ``-Doracle`` when creating the Eclipse projects * As of Oracle 10.2 oracle has decided to "seal" its jar files (a security option that can be turned on in the manifest file). This option limits access to package-protected members to classes defined in the package and in the same JAR file. This means that the only way to create a connection is via a DataSource (and we are not there yet since we still use JDBC Drivers). Please download a driver from the 10.1.x series in order to avoid the above problem. @@ -23,9 +23,9 @@ Unlike most external libraries used in GeoTools, we cannot redistribute this jar Switching between Oracle Profiles with oracle.jdbc property ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The oracle modules are all set up to work with a pretend "mock" jdbc driver in order to compile. To actually use the real thing you are going to need to set the oracle.jdbc property. +The oracle modules are all set up to work with a pretend "mock" jdbc driver in order to compile. To actually use the real thing you are going to need to set the ``oracle.jdbc`` property. -You will need to do this each time on the command line (as of Maven 2.0.4 there is no way to set a property in your setting.xml file that can be used to configure other profiles): +You will need to do this each time on the command line (as of Maven 2.0.4 there is no way to set a property in your ``settings.xml`` file that can be used to configure other profiles): Here is an example that builds eclipse .classpath and .project files using the real driver:: diff --git a/docs/user/build/install/sphinx.rst b/docs/user/build/install/sphinx.rst index dce4159a6d5..667a598c051 100644 --- a/docs/user/build/install/sphinx.rst +++ b/docs/user/build/install/sphinx.rst @@ -1,7 +1,7 @@ Sphinx (Optional) ----------------- -To build the geotools "doc" folder you will need to install the components of the sphinx documentation system. +To build the GeoTools "doc" folder you will need to install the components of the sphinx documentation system. Reference: @@ -36,40 +36,48 @@ Install Python: easy_install sphinx==1.0.7 +6. Install spellchecker:: + + pip install pyenchant + pip install sphinxcontrib-spelling + rst2pdf Optional Install ^^^^^^^^^^^^^^^^^^^^^^^^ -You can optionally install rst2pdf to build pdf documentation: +You can optionally install ``rst2pdf`` to build PDF documentation: -1. Install Visual Studio 2008 Express Edition (this provides windows with a C compiler). It is a free download on the Microsoft site. - You need to be sure to use the 2008 edition so that easy_install will compile something that can actually be linked to the Python executable. +1. Install Visual Studio 2008 Express Edition (this provides windows with + a C compiler). It is a free download on the Microsoft site. You need to be + sure to use the 2008 edition so that ``easy_install`` will compile something + that can actually be linked to the Python executable. -2. Use easy install to produce rst2pdf:: +2. Use easy install to produce ``rst2pdf``:: easy_install rst2pdf 3. This depends on the Python Image Library (which it can probably build now that you have a compiler). -4. If you cannot manage to build you can download a precompiled Python Image Library (PIL) from here: +4. If you cannot manage to build you can download a precompiled Python Image + Library (PIL) from here: * http://effbot.org/downloads/#pil (download the one for python 2.7) Mac Sphinx Install ^^^^^^^^^^^^^^^^^^ -You can use the distribution manager of your choice (example bru, macports, etc...). The following example -is for macports. +You can use the distribution manager of your choice (example ``bru``, ``macports``, +etc...). The following example is for ``macports``. -1. On OSX Use macports to install Python 2.7:: +1. On OSX Use ``macports`` to install Python 2.7:: sudo port install python27 sudo port install python_select sudo python_select python27 -2. You can use macports to install Python Image Library:: +2. You can use ``macports`` to install Python Image Library:: sudo port install py27-pil -3. You can now use python easy_install to install sphinx:: +3. You can now use python ``easy_install`` to install ``sphinx``:: sudo easy_install sphinx @@ -77,29 +85,39 @@ is for macports. sudo easy_install sphinx==1.0.7 -4. To build the PDF targets you will also need rst2pdf.:: +4. Install spellchecker:: + + pip install pyenchant + pip install sphinxcontrib-spelling + +5. To build the PDF targets you will also need ``rst2pdf``.:: sudo easy_install rst2pdf -5. If you uses easy_install to grab the python image library it easy to get compile errors. +6. If you uses ``easy_install`` to grab the python image library it easy to get + compile errors. Linux Sphinx Install ^^^^^^^^^^^^^^^^^^^^ -Use apt-get and easy install. +Use ``apt-get`` and ``easy_install``. 1. Python is usually available by default, if not:: apt-get install Python - You may need to use sudo (if for example you are on unbuntu) + You may need to use ``sudo`` (if for example you are on Ubuntu) -2. Use easy_install to graph sphinx (using sudo if required):: +2. Use easy_install to graph sphinx (using ``sudo`` if required):: easy_install sphinx - Optionally you can install a specifc version:: + Optionally you can install a specific version:: easy_install sphinx==1.0.7 - \ No newline at end of file + +3. Install spellchecker:: + + pip install pyenchant + pip install sphinxcontrib-spelling diff --git a/docs/user/build/maven/build.rst b/docs/user/build/maven/build.rst index 55b6f9be815..2189f396381 100644 --- a/docs/user/build/maven/build.rst +++ b/docs/user/build/maven/build.rst @@ -34,25 +34,25 @@ Your First Build C:\java\geotools>mvn install -5. If all is well, Maven should download the required .jar files and build GeoTools modules. +5. If all is well, Maven should download the required ``.jar`` files and build GeoTools modules. 6. At the end of this process it will display a list of all the modules which were built and installed correctly.:: [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESSFUL [INFO] ------------------------------------------------------------------------ - [INFO] Total time: 9 months, 3 weeks, 12 hours, 3 minuets, and 43 seconds + [INFO] Total time: 9 months, 3 weeks, 12 hours, 3 minutes, and 43 seconds [INFO] Finished at: Sat Feb 12 16:05:08 EST 2011 [INFO] Final Memory: 41M/87M [INFO] ------------------------------------------------------------------------ -7. The first build takes a while due to the download time for the .jar files. +7. The first build takes a while due to the download time for the ``.jar`` files. If you have any trouble check the common build failures at the bottom of this page. Build Failure ^^^^^^^^^^^^^ -It is all well and good to recognise a successful build, but how do you recognise a build that has failed? +It is all well and good to recognize a successful build, but how do you recognize a build that has failed? 1. If your build fails you will get feedback like this:: @@ -80,17 +80,17 @@ Expected Build times Depending on your hardware and internet connection: -* Building the first time, where maven needs to download everything, may take 20 to 30 minuets. -* Future builds check for the most recent .jar files from the internet. The checking is based of md5 checksums and does not take long. Building subsequently may take 10 minuets depending on your hardware and internet connection. -* After everything is downloaded can build "offline" and avoid the checking of mdf5 checksums resulting in a faster build of 5-7 minuets. -* Finally you can turn off tests (danger!) and build offline to get a build under 2 minuets +* Building the first time, where maven needs to download everything, may take 20 to 30 minutes. +* Future builds check for the most recent ``.jar`` files from the internet. The checking is based on an md5 checksum and does not take long. Building subsequently may take 10 minutes depending on your hardware and internet connection. +* After everything is downloaded can build "offline" and avoid the checking of md5 checksums resulting in a faster build of 5-7 minutes. +* Finally you can turn off tests (danger!) and build offline to get a build under 2 minutes Tips to speed up a build: * Do not do a "clean" build if you do not have to * Experiment with the best use of Maven 3 "threading" for your computer * Rebuild a single module after you have modified it -* Update your "settings.xml" file to point to a "mirror" in your country - allowing you to download closer to home +* Update your ``settings.xml`` file to point to a "mirror" in your country - allowing you to download from closer to home * Build offline (when everything is downloaded to your local repository) Common Build Problems @@ -100,10 +100,10 @@ The following common problems occur during a:: mvn -U clean install -Unable to find org.geotools.maven:javadoc:jar -''''''''''''''''''''''''''''''''''''''''''''' +Unable to find ``org.geotools.maven:javadoc:jar`` +''''''''''''''''''''''''''''''''''''''''''''''''' -We have a little of a chicken-and-the-egg problem here when building a tag for the first time. +We have a little of a chicken-and-egg problem here when building a tag for the first time. To fix you need to build the javadoc jar by hand. @@ -111,23 +111,23 @@ To fix you need to build the javadoc jar by hand. cd build/maven/javadoc -2. Build the javadoc module +2. Build the javadoc module:: mvn install 3. You can now return to the root of the project and restart your build. -Note that this plugin requires your JAVA_HOME to be set to a JDK as it makes use of the tools.jar (in order to build javadocs). +Note that this plugin requires your JAVA_HOME to be set to a JDK as it makes use of the ``tools.jar`` (in order to build javadocs). Unable to Delete Directory on Windows ''''''''''''''''''''''''''''''''''''' -Build systems like maven (that smash files around for a living) are generally incompatible with Microsoft Indexing Service. +Build systems like Maven (that smash files around for a living) are generally incompatible with Microsoft Indexing Service. From Lim Goh on email I would also like to point out for future reference that the Windows -Indexing Service is not 100% compatible with maven, and causes some -maven builds to break. Developers who use Windows 7 64-bit (or +Indexing Service is not 100% compatible with Maven, and causes some +Maven builds to break. Developers who use Windows 7 64-bit (or anything close like Vista or 32-bit) may have unsuccessful build due to "unable to delete directory". If that happens please try to disable Windows Indexing Service for the entire working copy and try diff --git a/docs/user/build/maven/eclipse.rst b/docs/user/build/maven/eclipse.rst index 61873103529..82649c05cd8 100644 --- a/docs/user/build/maven/eclipse.rst +++ b/docs/user/build/maven/eclipse.rst @@ -4,7 +4,7 @@ Maven Eclipse Plugin Maven can be used to work with the Eclipse IDE. While direct integration is currently underway (thanks to Sonyatype) we are documenting the traditional approach here for reference. Creating .project and .classpath files -#. You can use maven to set up the files needed for eclipse:: +#. You can use Maven to set up the files needed for eclipse:: mvn eclipse:eclipse @@ -13,7 +13,7 @@ Creating .project and .classpath files * .classpath file * .project file - The way to read the above line is we are using the eclipse plugin, and we are asking it to do the goal eclipse. The -Dall switch is used to include the unsupported modules. + The way to read the above line is we are using the eclipse plugin, and we are asking it to do the goal eclipse. The ``-Dall`` switch is used to include the unsupported modules. #. You can then import all the GeoTools projects into your Eclipse IDE. @@ -21,11 +21,11 @@ Creating .project and .classpath files From the :guilabel:`Import` dialog navigate to :menuselection:`General --> Existing projects into workspace` - Select your geotools checkout directory, the modules (with generated .project files) will be listed allowing you to import them all. + Select your ``geotools`` checkout directory, the modules (with generated .project files) will be listed allowing you to import them all. #. It will take a moment to compile the first time. - Note: Because maven and eclipse will both use **target/classes** you will need to perform a clean when switching between maven and eclipse for building. + Note: Because Maven and Eclipse will both use **target/classes** you will need to perform a clean when switching between Maven and Eclipse for building. #. You will need to run `mvn eclipse:eclipse` again if any dependencies change. @@ -38,10 +38,10 @@ Creating .project and .classpath files The other options are to specify a default output directory (so that eclipse and maven do not both use target/classes and trip on each other). -Customising the Name of the Generated Projects +Customizing the Name of the Generated Projects ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -You can customise the generated project names a little bit (useful you have an existing project like GeoServer with its own "main" project):: +You can customize the generated project names a little bit (useful you have an existing project like GeoServer with its own "main" project):: mvn eclipse:eclipse -Declipse.projectNameTemplate="[groupId].[artifactId]" @@ -49,7 +49,7 @@ An alternative approach could be:: mvn eclipse:eclipse -Declipse.projectNameTemplate="gt2-trunk-[artifactId]" -For more information see the maven eclipse plugin documentation. +For more information see the Maven eclipse plugin documentation. Working With Many Projects ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -66,7 +66,7 @@ For better performance in your IDE you can the open projects to those you are wo Creating .project and .classpath files with source code ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -In addition to downloading jars, maven can also download the associated source code. As source code is often much larger you are warned: +In addition to downloading jars, Maven can also download the associated source code. As source code is often much larger you are warned: 1. Generate with source code (THIS MAY TAKE TWO HOURS):: mvn eclipse:eclipse -DdownloadSources=true @@ -95,4 +95,4 @@ Tips and Tricks for working with Eclipse 3. GeoTools has defined templates you can import: - * build/eclipse/codetemplates.xml \ No newline at end of file + * ``build/eclipse/codetemplates.xml`` diff --git a/docs/user/build/maven/index.rst b/docs/user/build/maven/index.rst index bd92956ecdb..d868c95d707 100644 --- a/docs/user/build/maven/index.rst +++ b/docs/user/build/maven/index.rst @@ -19,11 +19,11 @@ Using Maven Project Files ^^^^^^^^^^^^^ -The key part of maven is the use of a "project object model" file (ie pom.xml). You will find a pom.xml file in all active modules. The project file tells you the name of the module, who maintains it, who develops it, and what it depends on. +The key part of Maven is the use of a "project object model" file (i.e. ``pom.xml``). You will find a ``pom.xml`` file in all active modules. The project file tells you the name of the module, who maintains it, who develops it, and what it depends on. -The most important part of the project file is the dependencies section as maven uses this to determine what order to build the modules in and what support jars to download when needed (if we move over to maven exclusively we will no longer need the extbin folder). +The most important part of the project file is the dependencies section as Maven uses this to determine what order to build the modules in and what support jars to download when needed (if we move over to Maven exclusively we will no longer need the ``extbin`` folder). -All the modules have some things in common, the module pom.xml files extend a pom.xml file which can be found in the GeoTools root directory. This root pom.xml file defines things, such as license and build settings which are common to the geotools library. The root pom.xml has a dependencyManagement section that lists the version numbers in one location (so we can be sure that each module is being built with dependencies that can work together). +All the modules have some things in common, the module ``pom.xml`` files extend a ``pom.xml`` file which can be found in the GeoTools root directory. This root ``pom.xml`` file defines things, such as license and build settings which are common to the GeoTools library. The root ``pom.xml`` has a ``dependencyManagement`` section that lists the version numbers in one location (so we can be sure that each module is being built with dependencies that can work together). Use of Notepad ^^^^^^^^^^^^^^ diff --git a/docs/user/build/maven/javadocs.rst b/docs/user/build/maven/javadocs.rst index 198e3c8512d..fabbf1ead7f 100644 --- a/docs/user/build/maven/javadocs.rst +++ b/docs/user/build/maven/javadocs.rst @@ -1,7 +1,7 @@ Generating Javadocs ------------------- -Javadoc can be generated using the standard mvn javadoc:javadoc command. +Javadoc can be generated using the standard ``mvn javadoc:javadoc`` command. * It can be generated for an individual module:: @@ -16,9 +16,9 @@ Javadoc can be generated using the standard mvn javadoc:javadoc command. Dependencies in aggregated javadoc ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -As of October 2006, aggregated javadoc using maven-javadoc-plugin version 2.0 fails to resolve all -external dependencies like JTS. It may be related to MJAVADOC-66, but the later said that the bug -is already fixed. +As of October 2006, aggregated javadoc using ``maven-javadoc-plugin`` version +2.0 fails to resolve all external dependencies like JTS. It may be related to +MJAVADOC-66, but the later said that the bug is already fixed. Waiting for the next maven-javadoc-plugin release in the hope that it will be fixed there. @@ -30,9 +30,10 @@ The **trunk/pom.xml** file contains the javadoc:javadoc goal configuration. This Excluded packages are: -* com.\* -* org.geotools.maven.\* -* org.geotools.referencing.util.\* + * ``com.\*`` + * ``org.geotools.maven.\*`` + * ``org.geotools.referencing.util.\*`` + * ``org.geotools.maven.\*`` * ``org.geotools.referencing.util.\*`` When Maven fails to generate the javadoc ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/docs/user/build/maven/pom.rst b/docs/user/build/maven/pom.rst index e3e594427ea..e58ae4cd160 100644 --- a/docs/user/build/maven/pom.rst +++ b/docs/user/build/maven/pom.rst @@ -1,14 +1,14 @@ Project Object Model (POM) Files -------------------------------- -Complete documentation for the project.xml file for maven can be found at the maven site, and in particular in the project descriptor part of the reference section. +Complete documentation for the project XML file for Maven can be found at the Maven site, and in particular in the project descriptor part of the reference section. We only show the things specific to a GeoTools **module pom.xml** file here. Extending a Parent Module ^^^^^^^^^^^^^^^^^^^^^^^^^ -The section allows one pom.xml file to inherit items from another. Modules should extend the pom.xml within the module, plugin, extension or demo directory they belong to: +The section allows one ``pom.xml`` file to inherit items from another. Modules should extend the ``pom.xml`` within the module, plugin, extension or demo directory they belong to: .. code-block:: xml @@ -22,7 +22,7 @@ Id ^^ The id should reflect the name of the module. -We use a “gt” prefix to avoid conflicts (as the groupId org.geotools does not appears in the final JAR filenames) +We use a “gt” prefix to avoid conflicts (as the ``groupId`` ``org.geotools`` does not appear in the final JAR filenames) Examples: @@ -34,15 +34,15 @@ This policy allows our “gt-main.jar” to avoid conflict with a application Dependency Management ^^^^^^^^^^^^^^^^^^^^^ -Dependencies are specified within the pom.xml file, but care should be taken to handle this in a consistent manner. +Dependencies are specified within the ``pom.xml`` file, but care should be taken to handle this in a consistent manner. New dependencies on another GeoTools module, should use: -* groupId - identify the project -* artifactId - identify the jar within that project -* version - ${project.version} to match the current build +* ``groupId`` - identify the project +* ``artifactId`` - identify the jar within that project +* ``version`` - ``${project.version}`` to match the current build -Sample pom.xml dependency entry:: +Sample ``pom.xml`` dependency entry:: org.geotools @@ -52,7 +52,7 @@ Sample pom.xml dependency entry:: New dependencies on a third-party jar need to be handled in two parts. -The dependency is supplied in the pom.xml file:: +The dependency is supplied in the ``pom.xml`` file:: javax.media @@ -61,12 +61,12 @@ The dependency is supplied in the pom.xml file:: test -And the dependency version is supplied in the “root” pom.xml file in the dependency management section. +And the dependency version is supplied in the “root” ``pom.xml`` file in the dependency management section. Dependency Version Changes ^^^^^^^^^^^^^^^^^^^^^^^^^^ -When a dependency changes you will need to update the root pom.xml "dependency management section" to reflect the new version number. +When a dependency changes you will need to update the root ``pom.xml`` "dependency management section" to reflect the new version number. You should be able to locate an entry like this and change the version number:: @@ -74,4 +74,4 @@ You should be able to locate an entry like this and change the version number:: net.java.dev.swing-layout swing-layout 1.0.2 - \ No newline at end of file + diff --git a/docs/user/build/maven/repositories.rst b/docs/user/build/maven/repositories.rst index ab3f9ff4ca2..045278ae735 100644 --- a/docs/user/build/maven/repositories.rst +++ b/docs/user/build/maven/repositories.rst @@ -2,23 +2,24 @@ Remote Repositories ------------------- There are repositories of jars required by GeoTools stored online. These repositories are listed -in the root pom.xml file. +in the root ``pom.xml`` file. You can browse them online at: -* http://central.maven.org/maven2 - maven central -* http://maven.geo-solutions.it/ - geosolutions repository used for imageio-ext, jai-ext, ... -* http://download.osgeo.org/webdav/geotools/ - osgeo repository used for geotools dependencies -* https://repo.boundlessgeo.com/release - boundless repo for releases + * http://central.maven.org/maven2 - maven central + * http://maven.geo-solutions.it/ - GeoSolutions repository used for ``imageio-ext``, ``jai-ext``, ... + * http://download.osgeo.org/webdav/geotools/ - OSGeo repository used for + GeoTools dependencies + * https://repo.boundlessgeo.com/release - Boundless repository for releases GeoTools itself is deployed to the following repositories: -* http://download.osgeo.org/webdav/geotools/ - geotools release repository -* http://repo.boundlessgeo.com/snapshot - geotools SNAPSHOT repository + * http://download.osgeo.org/webdav/geotools/ - GeoTools release repository + * http://repo.boundlessgeo.com/snapshot - GeoTools SNAPSHOT repository Or you can make use of the following cache: -* https://repo.boundlessgeo.com/main - boundless repository acting as a cache of the above + * https://repo.boundlessgeo.com/main - Boundless repository acting as a cache of the above Reducing Internet Downloads ^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/docs/user/build/maven/settings.rst b/docs/user/build/maven/settings.rst index c86f7b596f5..c2f1488daaf 100644 --- a/docs/user/build/maven/settings.rst +++ b/docs/user/build/maven/settings.rst @@ -1,7 +1,7 @@ Maven Local Settings -------------------- -On your machine you will find a directory in called 'm2'. This is where maven stores all downloaded jars and installed projects. +On your machine you will find a directory in called 'm2'. This is where Maven stores all downloaded jars and installed projects. ========== ============================================ Platform Directory @@ -13,14 +13,17 @@ Windows 7 ``C:\Users\USER\.m2`` The format of this directory is: -* .m2/repository - this is your local repository where jars have been downloaded or installed -* .m2/settings.xml - configuration file for site specific settings such as mirror to download from -* .m2/profiles.xml - configuration file for profiles (not often used) + * ``.m2/repository`` - this is your local repository where jars have been + downloaded or installed + * ``.m2/settings.xml`` - configuration file for site specific settings such as + mirror to download from + * ``.m2/profiles.xml`` - configuration file for profiles (not often used) -settings.xml -^^^^^^^^^^^^ +The ``settings.xml`` file +^^^^^^^^^^^^^^^^^^^^^^^^^ -You can provide an optional settings.xml file in this directory that is used to describe configuration and resources available on your machine. +You can provide an optional ``settings.xml`` file in this directory that is used +to describe configuration and resources available on your machine. Examples of use: @@ -29,10 +32,11 @@ Examples of use: true -* select testing profiles (so you can test against a local database, or geoserver install) -* Set up a mirror for better performance: + * select testing profiles (so you can test against a local database, or + GeoServer install) + * Set up a mirror for better performance: - Using ibiblio as your mirror of the central maven repository: + Using ibiblio as your mirror of the central Maven repository: .. code-block:: xml @@ -60,7 +64,10 @@ Examples of use: Local Repository ^^^^^^^^^^^^^^^^ -You should see that any third party jars, such as JTS, will have been installed in this repository. You should also see that all successful module builds (e.g. main, referencing...) have had their jars installed in a directory called org/geotools. +You should see that any third party jars, such as JTS, will have been installed +in this repository. You should also see that all successful module builds (e.g. +main, referencing...) have had their jars installed in a directory called +``org/geotools``. Tip: @@ -74,14 +81,15 @@ Configuring the heap size The Maven build may requires a fair amount of memory. For example javadoc generation requires a large heap size. If you need the maximal heap size increased check the root :file:`pom.xml` for settings. -To change the heap size of the maven command itself:: +To change the heap size of the Maven command itself:: set MAVEN_OPTS=-Xmx384M Configuring a proxy server ^^^^^^^^^^^^^^^^^^^^^^^^^^ -If you are behind a firewall, you will need maven to use a proxy server. +If you are behind a firewall, you will need Maven to use a proxy server. -* http://maven.apache.org/guides/mini/guide-proxies.html + * http://maven.apache.org/guides/mini/guide-proxies.html -The above link shows how modify the settings.xml file in your .m2 directory. +The above link shows how modify the ``settings.xml`` file in your ``.m2`` +directory. diff --git a/docs/user/build/maven/snapshots.rst b/docs/user/build/maven/snapshots.rst index c103d9f3b98..963c803b6cd 100644 --- a/docs/user/build/maven/snapshots.rst +++ b/docs/user/build/maven/snapshots.rst @@ -17,7 +17,7 @@ To respond to one of these emails include "-u" in your next build. git pull --rebase upstream master -2. build using the -U option:: +2. Build using the -U option:: mvn clean install -U -DskipTests @@ -30,9 +30,10 @@ If you are working on GeoServer or uDig or another project that depends on the l GeoTools release you will need to know how to deploy a SNAPSHOT (so members of your developer community do not get compile errors). -The build server ares is watching the repository, and will build and deploy a snapshot. If you really cannot wait: +The build server ``build.geoserver.org`` is watching the repository, and will +build and deploy a snapshot. If you really cannot wait: -1. Update to make sure you are not missing out on anyones work:: +1. Update to make sure you are not missing out on anyone’s work:: git pull --rebase upstream master @@ -40,7 +41,7 @@ The build server ares is watching the repository, and will build and deploy a sn mvn clean install -3. Commit - remember to include any Jira numbers in your log message:: +3. Commit - remember to include any Jira issue numbers in your log message:: mvn commit -m "Change to fix shapefile charset handling, see GEOT-1437" @@ -48,12 +49,12 @@ The build server ares is watching the repository, and will build and deploy a sn mvn push upstream master -4. Ensure your ~/.m2/settings.xml has your webdav credentials. +4. Ensure your ``~/.m2/settings.xml`` has your webdav credentials. - * osgeo - this is the same as your osgeo credentials - * boundlessgeo - ask on the developer email list + * ``osgeo`` - this is the same as your OSGeo credentials + * ``boundlessgeo`` - ask on the developer email list - The settings.xml should list both:: + The ``settings.xml`` should list both:: @@ -76,4 +77,4 @@ The build server ares is watching the repository, and will build and deploy a sn mvn deploy -Dmaven.test.skip=true -6. Let your community know via email! (The email can ask them to build with -U). \ No newline at end of file +6. Let your community know via email! (The email can ask them to build with -U). diff --git a/docs/user/build/maven/testing.rst b/docs/user/build/maven/testing.rst index 33a03beb853..781c2f6ae1b 100644 --- a/docs/user/build/maven/testing.rst +++ b/docs/user/build/maven/testing.rst @@ -47,8 +47,8 @@ The naming convention for these tests is to name them as "OnlineTest". Examples: -* PostgisDataStoreAPIOnlineTest.java -* WMS1_0_0_OnlineTest.java + * PostgisDataStoreAPIOnlineTest.java + * WMS1_0_0_OnlineTest.java 1. To execute online tests during a build, the online profiles is used:: @@ -61,8 +61,8 @@ Examples: * ``~/.geotools/db2.properties.example`` * ``~/.geotools/wps.properties.example`` -4. Rename one of the files to not end with "example" (i.e. rename to postgis.properties) -5. edit the file to fill in the connection parameters for the server you are testing against, and save. +4. Rename one of the files to not end with "example" (i.e. rename to ``postgis.properties``) +5. Edit the file to fill in the connection parameters for the server you are testing against, and save. 6. You can now run the online test against your server * Note many of the database tests are good and create a table, perform a test, and then remove the table when finished. diff --git a/docs/user/build/maven/tips.rst b/docs/user/build/maven/tips.rst index bf3f750fa9b..76910d247e7 100644 --- a/docs/user/build/maven/tips.rst +++ b/docs/user/build/maven/tips.rst @@ -1,7 +1,7 @@ Maven Tips ---------- -Maven has a fair few tricks and tips associated with its use. The major benefit is with a consistent project structure (and pom.xml description) a number of plugins can be used. +Maven has a fair few tricks and tips associated with its use. The major benefit is with a consistent project structure (and ``pom.xml`` description) a number of plugins can be used. Really Building All Modules ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -10,23 +10,23 @@ GeoTools plays host to a number of experiment "unsupported" modules; if you woul mvn install -Dall -The "-Dall" acts as a switch to part engages several profiles; you can also do this by hand with -P +The ``-Dall`` acts as a switch to part engages several profiles; you can also do this by hand with -P -The following "profiles" are included by the "-Dall": +The following "profiles" are included by the ``-Dall``: =================== ========== =================================================================== -Profile \-Dall Builds +Profile ``-Dall`` Builds =================== ========== =================================================================== ``-Ppending`` included several experimental modules ``-Praster`` included builds coverage tools -``-Pgeometry`` included builds iso 19107 geometry implementations +``-Pgeometry`` included builds ISO 19107 geometry implementations ``-Pswing`` included -``-Pwps`` included wps client -``-Pprocess`` included addotopma; geometry, raster and feature processes +``-Pwps`` included WPS client +``-Pprocess`` included geometry, raster and feature processes ``-Parchive`` modules that no longer work =================== ========== =================================================================== -Fore more details see :file:`unsupported/pom.xml` (or try ``mvn help:all-profiles`` for the complete list). +For more details see :file:`unsupported/pom.xml` (or try ``mvn help:all-profiles`` for the complete list). Parallel Builds ^^^^^^^^^^^^^^^ @@ -35,7 +35,7 @@ Maven 3 allows you to control your computing resources a bit more:: mvn install -Dall -T 2C -The above command builds using two threads for each cpu core available. +The above command builds using two threads for each CPU core available. You can also set an exact number of threads to use:: @@ -70,26 +70,26 @@ Provided you have done at least one complete build you should be able to build i cd modules/library/cql -2. Use maven to compile - it should do a complete build:: +2. Use Maven to compile - it should do a complete build:: mvn compile -3. Use maven to update the local repository - it should run the test cases and install the jar in the local +3. Use Maven to update the local repository - it should run the test cases and install the jar in the local repository for other modules (or applications) to use when they build.:: mvn install If you have not done a full build yet then the build may fail because it can't find the jar for a module it depends on. -* An error caused by not having another geotools module installed can be a little misleading:: + * An error caused by not having another GeoTools module installed can be a little misleading:: - Error: unable to download main-2.1.x.jar + Error: unable to download main-2.1.x.jar -* Maven failed to find main-2.1,x.jar in the local repository where a full build should have put it -* Maven tried to download the file from the internet (and failed) -* If you see an error like that, either do a full build or change into the module which is missing (main in this case) and type.:: + * Maven failed to find main-2.1,x.jar in the local repository where a full build should have put it + * Maven tried to download the file from the internet (and failed) + * If you see an error like that, either do a full build or change into the module which is missing (main in this case) and type.:: - maven install + maven install Avoiding Tests ^^^^^^^^^^^^^^ @@ -100,7 +100,7 @@ The following will build the tests - but not run them:: mvn -DskipTests install -This is useful for installing the postgis module test jar; which is used by the postgis-version module as a dependency. +This is useful for installing the PostGIS module test jar; which is used by the ``postgis-version`` module as a dependency. The following will not even build the tests:: @@ -111,7 +111,7 @@ Resuming After a Failure When doing a full build of GeoTools it can be disheartening when a build fails 90% of the way through causing you to fix and start again. -The -rf (resume from) parameter of is useful in these cases. It is used to resume a multi-module build such as GeoTools from a specific location to avoid rebuilding those modules you have already successfully build. +The ``-rf`` (resume from) parameter of is useful in these cases. It is used to resume a multi-module build such as GeoTools from a specific location to avoid rebuilding those modules you have already successfully build. 1. For instance, consider quickly building offline:: @@ -126,23 +126,23 @@ This same technique can be used to restart a build after fixing a failed test in Generate a Web Site ^^^^^^^^^^^^^^^^^^^ -Maven reports can be generated by the following command, to be executed from the directory that contains the parent pom.xml file:: +Maven reports can be generated by the following command, to be executed from the directory that contains the parent ``pom.xml`` file:: mvn site:site -The site are created in target/site directory of every module. An aggregated javadoc is also created in the parent target/site/apidocs directory. +The site are created in :file:`target/site` directory of every module. An aggregated javadoc is also created in the parent :file:`target/site/apidocs` directory. -Oracle ojdbc jar -^^^^^^^^^^^^^^^^ +Oracle JDBC Jar +^^^^^^^^^^^^^^^ -We are not in position to publish everything in a public maven repository. The ojdbc7 JDBC driver +We are not in position to publish everything in a public maven repository. The ``ojdbc7.jar`` JDBC driver (required to run oracle online tests) will need to be installed by hand. If you have access to the real driver you can rebuild the ``jdbc-oracle`` plugin -with ojdbc driver. --> +with jdbc driver. --> -1. Download the ojdbc jar from oracle -2. Install the ojdbc jar into your local maven repository:: +1. Download the jdbc jar from oracle +2. Install the jdbc jar into your local Maven repository:: mvn install:install-file -Dfile=ojdbc7.jar \ -DgroupId=com.oracle -DartifactId=ojdbc7 \ @@ -167,22 +167,22 @@ with ojdbc driver. --> [INFO] Final Memory: 3M/81M [INFO] ------------------------------------------------------------------------ -3. You can then supply -Doracle=true on the command line when building:: +3. You can then supply ``-Doracle=true`` on the command line when building:: cd modules/plugins/jdbc/jdbc-oracle mvn clean install -Doracle=true The ``gt-jdbc-oracle`` plugin is now deployed in your repository with a dependency - on the ojdbc oracle driver. + on the oracle JDBC driver. 4. Or when setting up eclipse:: mvn eclipse:eclipse -Dall -Doracle=true - The eclipse .project and .classpath generated now includes a reference to the ojdbc oracle + The eclipse :file:`.project` and :file:`.classpath` generated now includes a reference to the oracle JDBC driver. 5. Or when running online tests:: cd modules/plugin/jdbc/jdbc-oracle/ - mvn test -Doracle=true -P online \ No newline at end of file + mvn test -Doracle=true -P online diff --git a/docs/user/build/source.rst b/docs/user/build/source.rst index bb95662287a..976230ef1be 100644 --- a/docs/user/build/source.rst +++ b/docs/user/build/source.rst @@ -4,7 +4,7 @@ Source Code The GeoTools source code is organized into the following structure: ======================== ========================================================================= -``build/`` java projects that help with our build process +``build/`` Java projects that help with our build process ``docs/`` documentation and website source in rich structured text ``modules/library/`` the core library allowing your application to be spatial ``modules/extensions/`` extensions built on top of the library that do useful things @@ -52,11 +52,12 @@ Please just check out the code and have fun. If you are interested in getting co C:\java> -#. Checkout geotools using git (a new directory "geotools" will be created):: +#. Checkout GeoTools using git (a new directory :file:`geotools` will be created):: C:\java> git clone git://github.com/geotools/geotools.git -#. This will create a geotools directory that contains the source code for this project +#. This will create a file:`geotools` directory that contains the source code +for this project Notes: @@ -74,4 +75,7 @@ Notes: http://www.sbf5.com/~cduan/technical/git/ -* Although links to various IDE interfaces will be made available, no GUI will substitute for an understanding of the underlying git versioning model, and how the system is actually doing work. +* Although links to various IDE interfaces will be made available, no GUI will + substitute for an understanding of the underlying git versioning model, and how + the system is actually doing work. + diff --git a/docs/user/conf.py b/docs/user/conf.py index 6ae7e1a5066..e4789a3d252 100644 --- a/docs/user/conf.py +++ b/docs/user/conf.py @@ -4,9 +4,9 @@ # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ['sphinx.ext.extlinks'] +extensions = ['sphinx.ext.extlinks','sphinxcontrib.spelling'] -extlinks = { +extlinks = { 'geoserver': ('http://docs.geoserver.org/latest/en/user/%s','') } @@ -20,3 +20,5 @@ master_doc = 'index' html_title='GeoTools %s User Guide' % release + +spelling_show_suggestions=False diff --git a/docs/user/extension/brewer/colorbrewer.rst b/docs/user/extension/brewer/colorbrewer.rst index 64711cabb8c..0313335eb80 100644 --- a/docs/user/extension/brewer/colorbrewer.rst +++ b/docs/user/extension/brewer/colorbrewer.rst @@ -11,8 +11,8 @@ The class that does the work is called StyleGenerator. .. image:: /images/StyleGenerator.PNG -StyleGenerator takes a Color[] (either from ColorBrewer or provided by you!) and -will create a Style containing a Rule for entry indicated by a Classifier. +StyleGenerator takes a ``Color[]`` (either from ColorBrewer or provided by you!) +and will create a Style containing a Rule for entry indicated by a Classifier. .. literalinclude:: /../src/main/java/org/geotools/brewer/BrewerExamples.java :language: java @@ -22,7 +22,9 @@ will create a Style containing a Rule for entry indicated by a Classifier. ColorBrewer ^^^^^^^^^^^ -The colorbrewer project defines a "good" set of palettes backed a description of how appropriate each set of colours is for different uses (grayscale printing, display with a projector, friendly to color a blind audience or all three!). +The ColorBrewer project defines a "good" set of palettes backed a description of +how appropriate each set of colors is for different uses (gray-scale printing, +display with a projector, friendly to color blind audience or all three!). Website ''''''' @@ -50,7 +52,10 @@ on suitability and the number of samples that are able to be represented. .. image:: /images/ColorBrewer.PNG -The palettes used for these styles are defined by the colorbrewer project and are defined with a range of metadata allowing you to select an appropriate palette for different uses (grayscale printing, display with a projector, friendly to color a blind audience or all three!). +The palettes used for these styles are defined by the ColorBrewer project and +are defined with a range of metadata allowing you to select an appropriate +palette for different uses (gray-scale printing, display with a projector, +friendly to color a blind audience or all three!). 1. Create ColorBrewer (it will load the built-in palettes). @@ -70,7 +75,9 @@ The palettes used for these styles are defined by the colorbrewer project and ar Example ''''''' -Here is a complete example showing the steps required to generate a FeatureTypeStyle with a predefined palette for the provided SimpleFeatureCollection. +Here is a complete example showing the steps required to generate a +FeatureTypeStyle with a predefined palette for the provided +SimpleFeatureCollection. .. literalinclude:: /../src/main/java/org/geotools/brewer/BrewerExamples.java :language: java diff --git a/docs/user/extension/brewer/faq.rst b/docs/user/extension/brewer/faq.rst index d3b46f98222..bc12d04151c 100644 --- a/docs/user/extension/brewer/faq.rst +++ b/docs/user/extension/brewer/faq.rst @@ -4,7 +4,7 @@ Brewer FAQ Q: I have 47 classes to represent and ColorBrewer only goes up to 12! ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Feel free to create your own Color[] for use with StyleGenerator. + Feel free to create your own ``Color[]`` for use with StyleGenerator. Q: But why does it only go up to 12? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -12,8 +12,9 @@ Q: But why does it only go up to 12? This is a surprisingly common question! Have a look at the http://colorbrewer2.org/ website above; the point of the research is that the -human eye cannot tell very many colours apart. Indeed the number goes down depending on what -you are trying communicate (ie that the things shown are of equal importance, or do they form a smooth spread of values?). +human eye cannot tell very many colors apart. Indeed the number goes down +depending on what you are trying communicate (i.e. that the things shown are of +equal importance, or do they form a smooth spread of values?). -In other words you are free to create a pretty map with more than 12 colours; but you should not -be surprised if that is too complicated for people to understand. \ No newline at end of file +In other words you are free to create a pretty map with more than 12 colors; but you should not +be surprised if that is too complicated for people to understand. diff --git a/docs/user/extension/brewer/index.rst b/docs/user/extension/brewer/index.rst index 098e5485946..0bbf62acccf 100644 --- a/docs/user/extension/brewer/index.rst +++ b/docs/user/extension/brewer/index.rst @@ -2,7 +2,7 @@ Brewer ====== -The Brewer module helps you create interesting or appropriate content based on your data. This is as close to the concept of a "theme" as we come to in the GeoTools library with this extension using categorisation functions defined by gt-main as a basis for the generation of styles. +The Brewer module helps you create interesting or appropriate content based on your data. This is as close to the concept of a "theme" as we come to in the GeoTools library with this extension using categorization functions defined by ``gt-main`` as a basis for the generation of styles. .. sidebar:: Details diff --git a/docs/user/extension/graph/index.rst b/docs/user/extension/graph/index.rst index 97b66b32290..aa4d22f245d 100644 --- a/docs/user/extension/graph/index.rst +++ b/docs/user/extension/graph/index.rst @@ -2,7 +2,8 @@ Graph ===== -The gt-graph package defines the concept of a graph (or network) made up of geotools Features. +The ``gt-graph`` package defines the concept of a graph (or network) made up of +GeoTools Features. **Maven**:: @@ -26,19 +27,20 @@ ported to GeoTools. The Graph module makes use of concepts and (classes) from the GeoTools core: -* Feature - atomic unit of geographic information -* FeatureType - keeps track of what attributes each Feature can hold -* FeatureID - a unique id associated with each Feature (must start with a non-numeric character) + * ``Feature`` - atomic unit of geographic information + * ``FeatureType`` - keeps track of what attributes each Feature can hold + * ``FeatureID`` - a unique id associated with each Feature (must start with + a non-numeric character) In addition to the Feature API from core, the graph module makes use of relationships. Usually relationships are based on spatial comparisons between features, although you may be able to quickly establish a relationship using your feature attributes. -* Graph constructed from LineStrings based on "shared end points" +* Graph constructed from ``LineStrings`` based on "shared end points" Example a road network used for navigation. -* Graph constructed from Polygons based on "touches" +* Graph constructed from ``Polygons`` based on "touches" Example graph of watersheds used for ground water analysis. @@ -80,25 +82,25 @@ Graph Access A Graph supports simple direct access is supported using: -* Graph.getNodes() -* Graph.getEdges() + + ``Graph.getNodes()`` + + ``Graph.getEdges()`` You can also pass in a visitor in order to traverse the graph contents: -* Graph.visitNodes( visitor ) -* Graph.visitEdges( visitor ) + + ``Graph.visitNodes( visitor )`` + + ``Graph.visitEdges( visitor )`` The visitor can also control when to stop the process using: -* Graph.queryNodes( visitor ) -* Graph.queryEdges( visitor ) + * ``Graph.queryNodes( visitor )`` + * ``Graph.queryEdges( visitor )`` To provide control your visitor can indicate when it wants to stop, backtrack or continue using: - * GraphTraversal.CONTINUE - * GraphTraversal.KILL_BRANCH - * GraphTraversal.STOP - * GraphTraversal.SUSPEND + * ``GraphTraversal.CONTINUE`` + * ``GraphTraversal.KILL_BRANCH`` + * ``GraphTraversal.STOP`` + * ``GraphTraversal.SUSPEND`` Graph Traversal ^^^^^^^^^^^^^^^ @@ -112,7 +114,7 @@ An alternative to direct access is the configure a **GraphTraversal** using: * **GraphWalker**: walker being iterated over the graph (usually to accomplish a specific goal) - GeoTools provides out of the box implementations for many common problems: finding the the + GeoTools provides out of the box implementations for many common problems: finding the shortest path, partition a graph into sections, or visiting all the elements. Directed Graph @@ -131,12 +133,13 @@ Building GraphBuilder ^^^^^^^^^^^^ -At a low level graph creation is handled using a GraphBuilder. We have a range +At a low level graph creation is handled using a ``GraphBuilder``. We have a range of implementations available. The important point is that you control them by -calling buildNode, and buildEdge repeatedly allowing it to build up an internal +calling ``buildNode``, and ``buildEdge`` repeatedly allowing it to build up an internal representation of your Graph. -When you are satisfied with the result you can call getGraph() to retrieve the result. +When you are satisfied with the result you can call ``getGraph()`` to retrieve +the result. .. image:: /images/graph_builder.PNG @@ -151,11 +154,11 @@ Example :start-after: // graphExample start :end-before: // graphExample end -2. To make use of your graph we will use a GraphVisitor: +2. To make use of your graph we will use a ``GraphVisitor``: - The following OrphanVistor is called for "each" GraphComponent where - it has a chance to check if the GraphComponent is an orphan (ie has - no relationships) or not. + The following ``OrphanVistor`` is called for "each" ``GraphComponent`` where it + has a chance to check if the ``GraphComponent`` is an orphan (i.e. has no + relationships) or not. .. literalinclude:: /../src/main/java/org/geotools/graph/GraphExamples.java :language: java @@ -168,14 +171,14 @@ GraphGenerator ^^^^^^^^^^^^^^ The other approach is we have a number of generators which will automatically create a -Graph for you based on information you feed in. The GraphGenerators use a GraphBuilder +Graph for you based on information you feed in. The ``GraphGenerators`` use a ``GraphBuilder`` to build up each node and edge internally; so you will need to be careful to construct them with the correct builder for the problem you are wishing to solve. .. image:: /images/graph_generator.PNG -Each one of these implementations is set up to handle different kinds of data (Features, LineStrings, etc...) +Each one of these implementations is set up to handle different kinds of data (``Features``, ``LineStrings``, etc...) so please be sure to read the javadocs. Building Graph from a FeatureCollection @@ -229,9 +232,10 @@ Building Graph from Line Segments Building a FeatureCollection from your Graph -------------------------------------------- -Once the graph is built each, edge#getObject() will hold the original feature used to built it. +Once the graph is built each, ``edge.getObject()`` will hold the original +feature used to built it. -You can traverse your graph and build up FeatureCollection as you go.:: +You can traverse your graph and build up ``FeatureCollection`` as you go.:: SimpleFeatureCollection features = new DefaultFeatureCollection(); diff --git a/docs/user/extension/grid.rst b/docs/user/extension/grid.rst index 038a559afa3..0784e88fde7 100644 --- a/docs/user/extension/grid.rst +++ b/docs/user/extension/grid.rst @@ -25,8 +25,10 @@ The Grids utility class provides methods to create grids of rectangular or hexag Creating square grids ^^^^^^^^^^^^^^^^^^^^^ -The easiest way to create a basic grid is with the static methods in the **Grids** utility class. -This example creates a lat-lon grid with squares 10 degrees wide to display over a map of Australia: +The easiest way to create a basic grid is with the static methods in the +**Grids** utility class. This example creates a latitude longitude grid with +squares +10 degrees wide to display over a map of Australia: .. literalinclude:: /../src/main/java/org/geotools/grid/GridExamples.java :language: java @@ -40,13 +42,15 @@ Here is the resulting grid: Grids for display in different map projections ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The grid created in the previous section consists of SimpleFeatures, each of which has a minimal -polygon, ie. one represented by four corner vertices. This is fine if you only need to display it in -the one map projection. But say we need to display the above map in EPSG:4462 (Lambert's Conformal -Conic for Australia). The image below shows a square grid created in WGS84 (lat-lon) and then -transformed into Lambert's Conformal Conic. Because we only have vertices for the grid cell corners -the cell edges appear straight rather than curved. We've used 20 degree wide grid squares in this -example to make this effect obvious: +The grid created in the previous section consists of SimpleFeatures, each of +which has a minimal polygon, i.e. one represented by four corner vertices. This +is fine if you only need to display it in the one map projection. But say we +need to display the above map in EPSG:4462 (Lambert's Conformal Conic for +Australia). The image below shows a square grid created in WGS84 (latitude +longitude) and then transformed into Lambert's Conformal Conic. Because we only +have vertices for the grid cell corners the cell edges appear straight rather +than curved. We've used 20 degree wide grid squares in this example to make this +effect obvious: .. image:: /images/grid_transformed.png @@ -65,9 +69,9 @@ Creating hexagonal grids ^^^^^^^^^^^^^^^^^^^^^^^^ The Grids class also has methods to create hexagonal grids. These have the property that all six -neighbours of a grid element lie at an equal distance, in contrast to rectangular grids where the -diagonal neighbours are more distant than the orthogonal neighbours. This makes hexagonal grids -useful for analysing contagious spatial processes such as disease spread, wildfire, urban +neighbors of a grid element lie at an equal distance, in contrast to rectangular grids where the +diagonal neighbors are more distant than the orthogonal neighbors. This makes hexagonal grids +useful for analyzing contagious spatial processes such as disease spread, wildfire, urban development and animal movement. Creating a basic hexagonal grid is simple: @@ -81,8 +85,8 @@ Which gives this result: .. image:: /images/grid_hex.png -As with square grids, there is also a version of the createHexagonalGrid method that takes an -additional double argument for vertex spacing. +As with square grids, there is also a version of the ``createHexagonalGrid`` +method that takes an additional double argument for vertex spacing. Working with a user-defined feature type ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -142,9 +146,10 @@ elements you can go down to the next level and use the Oblongs and Hexagons clas Oblongs ''''''' -This class is responsible for creating rectangular grid elements and grids (its name was chosen to -avoid confusion with java.awt.Rectangle). You can use this class directly when you want to create a -grid with rectangular, rather than square, elements as in this example: +This class is responsible for creating rectangular grid elements and grids (its +name was chosen to avoid confusion with ``java.awt.Rectangle``). You can use +this class directly when you want to create a grid with rectangular, rather than +square, elements as in this example: .. literalinclude:: /../src/main/java/org/geotools/grid/GridExamples.java :language: java @@ -180,10 +185,11 @@ Line grids For displaying a map grid over features you don't really need polygons. Lines will suffice and also have the advantage that they can be more flexibly styled, e.g. different line thickness, color and -labelling for major vs minor grid lines. +labeling for major vs minor grid lines. -The **Lines** utility class provides method to create *ortho-lines*, ie. lines parallel to the map -projection axes. In the example below, we create a grid of lines at two *levels*: major lines at +The **Lines** utility class provides method to create *ortho-lines*, i.e. lines +parallel to the map projection axes. In the example below, we create a grid of +lines at two *levels*: major lines at 10 degree spacing and minor lines at 2 degree spacing. The levels are indicated by integer values with larger values taking precedence over smaller (values are arbitrary, only their rank order matters): diff --git a/docs/user/extension/ogc/index.rst b/docs/user/extension/ogc/index.rst index 0aa5443b9b5..69cd7fdfcb7 100644 --- a/docs/user/extension/ogc/index.rst +++ b/docs/user/extension/ogc/index.rst @@ -1,7 +1,7 @@ OGC === -Generated Java objects to match the XML schemas employed by gt-xml. +Generated Java objects to match the XML schemas employed by ``gt-xml`` .. toctree:: @@ -15,4 +15,4 @@ Generated Java objects to match the XML schemas employed by gt-xml. References: * :doc:`gt-xml ` -* :doc:`gt-xsd ` \ No newline at end of file +* :doc:`gt-xsd ` diff --git a/docs/user/extension/ogc/ows.rst b/docs/user/extension/ogc/ows.rst index 4ab1abe140e..35b7d6c8982 100644 --- a/docs/user/extension/ogc/ows.rst +++ b/docs/user/extension/ogc/ows.rst @@ -1,6 +1,6 @@ -net.opengis.ows ---------------- +``net.opengis.ows`` +-------------------- -Additional generated objects for "open web services", beyond the core filter modules provided by gt-main. +Additional generated objects for "open web services", beyond the core filter modules provided by ``gt-main.`` -No documentation has been supplied. \ No newline at end of file +No documentation has been supplied. diff --git a/docs/user/extension/ogc/wcs.rst b/docs/user/extension/ogc/wcs.rst index f7bcd3ee86b..6898f2c7868 100644 --- a/docs/user/extension/ogc/wcs.rst +++ b/docs/user/extension/ogc/wcs.rst @@ -1,6 +1,6 @@ -net.opengis.wcs ---------------- +``net.opengis.wcs`` +-------------------- Additional generated objects for web coverage service. -No documentation has been supplied. \ No newline at end of file +No documentation has been supplied. diff --git a/docs/user/extension/ogc/wfs.rst b/docs/user/extension/ogc/wfs.rst index 642e14f667d..1714563a2a1 100644 --- a/docs/user/extension/ogc/wfs.rst +++ b/docs/user/extension/ogc/wfs.rst @@ -1,6 +1,6 @@ -net.opengis.wfs ---------------- +``net.opengis.wfs`` +------------------- Additional generated objects for web feature service. -No documentation has been supplied. \ No newline at end of file +No documentation has been supplied. diff --git a/docs/user/extension/ogc/wfsv.rst b/docs/user/extension/ogc/wfsv.rst index 18d6614548b..a76d2f48503 100644 --- a/docs/user/extension/ogc/wfsv.rst +++ b/docs/user/extension/ogc/wfsv.rst @@ -1,9 +1,9 @@ -net.opengis.wfsv ----------------- +``net.opengis.wfsv`` +-------------------- Additional generated objects for "versioned" extension to web feature service. This is an extension of the basic web feature service protocol with the ability to query for feature history. -No documentation has been supplied. \ No newline at end of file +No documentation has been supplied. diff --git a/docs/user/extension/ogc/wps.rst b/docs/user/extension/ogc/wps.rst index 45a6890dc84..bad67d2d5d8 100644 --- a/docs/user/extension/ogc/wps.rst +++ b/docs/user/extension/ogc/wps.rst @@ -1,6 +1,6 @@ -net.opengis.wps ---------------- +``net.opengis.wps`` +-------------------- Additional generated objects for web processing service. -No documentation has been supplied. \ No newline at end of file +No documentation has been supplied. diff --git a/docs/user/extension/ogc/xlink.rst b/docs/user/extension/ogc/xlink.rst index c75b8beb86f..964520c06d1 100644 --- a/docs/user/extension/ogc/xlink.rst +++ b/docs/user/extension/ogc/xlink.rst @@ -1,6 +1,6 @@ -org.w3.xlink ------------- +``org.w3.xlink`` +----------------- Additional generated objects for XLink. -No documentation has been supplied. \ No newline at end of file +No documentation has been supplied. diff --git a/docs/user/extension/transform/transform.rst b/docs/user/extension/transform/transform.rst index e96fda12bbb..9fbc31d1186 100644 --- a/docs/user/extension/transform/transform.rst +++ b/docs/user/extension/transform/transform.rst @@ -4,11 +4,11 @@ Transform plugin The *gt-transform* module allows to wrap ``SimpleFeatureSource`` or ``SimpleFeatureStore`` objects and transform their features and feature types. The transformation abilities include: * renaming existing attributes - * convert an attribute type to a different type (via Converters api) + * convert an attribute type to a different type (via Converters API) * create a new attribute as an Expression of existing attributes (the module will try to figure out the target type of the new attribute if none is provided) * remove attributes -The transformed feature source will make sure all ``Filter`` and ``Query`` are translated back to the original feature type when accessing data, and will apply the transformations on the fly when returning data. If the original source was writeable, the transformed version will still work as writeable, with back transformations of renamed/retyped attributes. +The transformed feature source will make sure all ``Filter`` and ``Query`` are translated back to the original feature type when accessing data, and will apply the transformations on the fly when returning data. If the original source was writable, the transformed version will still work as writable, with back transformations of renamed/retyped attributes. **Maven**:: diff --git a/docs/user/extension/validation.rst b/docs/user/extension/validation.rst index 4192e31f3ad..c0f32cb6516 100644 --- a/docs/user/extension/validation.rst +++ b/docs/user/extension/validation.rst @@ -33,7 +33,7 @@ GeoTools library. As a result **ValidationProcessor** is is a ready to use software component with its own file formats and so forth. It is not trying to implement any standards in order to integrate with your -your existing infrastructure; it is up to you to host a :doc:`Repository ` allowing the **ValidationProcessor** to access your organisations data. +your existing infrastructure; it is up to you to host a :doc:`Repository ` allowing the **ValidationProcessor** to access your organizations data. The key concepts offered by the Validation Processor are: @@ -49,10 +49,10 @@ The design of the ValidationProcessor is similar in spirit to JUnit tests; a "te Configuration ------------- -THe ValidationProcessor is configured using: +The ValidationProcessor is configured using: * plugin configuration: plugins are defined using a combination of xml and an implementing Java class. This configuration can be reused between - applications; and are aligned with your organisation data quality policies. + applications; and are aligned with your organization data quality policies. Here is an example:: @@ -104,9 +104,9 @@ THe ValidationProcessor is configured using: This file defines a suite of two tests that will be performed against LAKES. * One of these is a reference the the **Is Valid Geometry** plugin defined above. Note that this - test is restricted to the typeRef "LAKES:lakes" + test is restricted to the ``typeRef`` "LAKES:lakes" - * The second test is an integrity test that needs to make reference to another layer (ie typeRef "STREAMS.streams"). + * The second test is an integrity test that needs to make reference to another layer (i.e. ``typeRef`` "STREAMS.streams"). The test is defined to prevent lakes and streams being used to describe the same water work. Feature Validation Example diff --git a/docs/user/extension/wms/index.rst b/docs/user/extension/wms/index.rst index fa3c15ef62e..8350407d1fb 100644 --- a/docs/user/extension/wms/index.rst +++ b/docs/user/extension/wms/index.rst @@ -2,7 +2,7 @@ WMS === -The gt-wms extension offers a full featured web map server client. This allows your application to connect to a range of web map services, review the capabilities and issue requests such as "GetMap" and "GetInfo". +The ``gt-wms`` extension offers a full featured web map server client. This allows your application to connect to a range of web map services, review the capabilities and issue requests such as "GetMap" and "GetInfo". .. sidebar:: Details diff --git a/docs/user/extension/wms/wms.rst b/docs/user/extension/wms/wms.rst index 42a7bbdff64..fabbfe7fa66 100644 --- a/docs/user/extension/wms/wms.rst +++ b/docs/user/extension/wms/wms.rst @@ -29,7 +29,7 @@ This page contains examples how how to connect and use the GeoTools WebMapServer //For example, the capabilities it returned was not valid } - Assuming nothing went wrong, we now have a WebMapServer object "wms" + Assuming nothing went wrong, we now have a WebMapServer object ``wms`` that contains the Capabilities document of returned from the server. It can also provide further communication with the server. @@ -38,7 +38,7 @@ WMSCapabilities WMSCapabilities is used to describe the abilities and published information available via a Web Map Service. -You can retrive a WMSCapabilities directly from your WebMapService:: +You can retrieve a WMSCapabilities directly from your WebMapService:: WMSCapabilities capabilities = wms.getCapabilities(); @@ -163,7 +163,7 @@ Other common activities: * Requesting with a style - If you want to request the map with some of its available styles use the appropriate addLayer method:: + If you want to request the map with some of its available styles use the appropriate ``addLayer`` method:: Layer[] layers = WMSUtils.getNamedLayers(capabilities); List styles = layers[2].getStyles(); diff --git a/docs/user/extension/wmts/index.rst b/docs/user/extension/wmts/index.rst index 5e696f67b20..81b34eb46f9 100644 --- a/docs/user/extension/wmts/index.rst +++ b/docs/user/extension/wmts/index.rst @@ -2,7 +2,7 @@ WMTS ==== -The gt-wmts extension builds on top of the :doc:`gt-tile-client <../tile-client/index>` module in order to offer a web map tile service client. +The ``gt-wmts`` extension builds on top of the :doc:`gt-tile-client <../tile-client/index>` module in order to offer a web map tile service client. This allows your application to connect to KVP or REST based web map tile services, review the capabilities and issue requests such as "GetTile". @@ -25,4 +25,4 @@ References: * http://www.opengeospatial.org/standards/wmts (OGC standard) * http://www.geowebcache.org/ (WMTS server) -* :doc:`gt-tile-client <../tile-client/index>` \ No newline at end of file +* :doc:`gt-tile-client <../tile-client/index>` diff --git a/docs/user/extension/wmts/wmts.rst b/docs/user/extension/wmts/wmts.rst index 170af110553..11344ec1f63 100644 --- a/docs/user/extension/wmts/wmts.rst +++ b/docs/user/extension/wmts/wmts.rst @@ -33,7 +33,7 @@ for a remote "Web Map Tile Server" and can be used to examine and retrieve publi // For example, the capabilities it returned was not valid } - Assuming nothing went wrong, we now have a WebMapTileServer object "wmts" + Assuming nothing went wrong, we now have a WebMapTileServer object ``wmts`` that contains the Capabilities document of returned from the server. It can also provide further communication with the server. @@ -68,7 +68,7 @@ Service contains metadata information about the server: Request ^^^^^^^ -The WMTS Operations describe the requests entrypoints: +The WMTS Operations describe the requests entry points: .. code-block:: java @@ -177,7 +177,7 @@ Making a GetTile request is more interesting than looking at WMSCapabilities. Set responses = wmts.issueRequest(req); We are getting a Set of Tiles, which are all the Tiles needed to fill - the bbox we requested. + the bounding box we requested. 5. In order to get the tile images, we'll have to use the info in the Tiles: diff --git a/docs/user/extension/xsd/core.rst b/docs/user/extension/xsd/core.rst index 6430b341298..692016f333d 100644 --- a/docs/user/extension/xsd/core.rst +++ b/docs/user/extension/xsd/core.rst @@ -1,7 +1,7 @@ XSD-Core -------- -These extensions are used by the gt-xml module to handle basic XML schema types +These extensions are used by the ``gt-xml`` module to handle basic XML schema types and XLink. References: diff --git a/docs/user/extension/xsd/fes.rst b/docs/user/extension/xsd/fes.rst index 5d16e6962c7..91e4e066641 100644 --- a/docs/user/extension/xsd/fes.rst +++ b/docs/user/extension/xsd/fes.rst @@ -1,4 +1,4 @@ XSD-FES -------- -Filter 2.0 schema for gt-xml. \ No newline at end of file +Filter 2.0 schema for ``gt-xml`` diff --git a/docs/user/extension/xsd/filter.rst b/docs/user/extension/xsd/filter.rst index 09ba568e4ee..62ff2716a32 100644 --- a/docs/user/extension/xsd/filter.rst +++ b/docs/user/extension/xsd/filter.rst @@ -1,4 +1,4 @@ XSD-Filter ---------- -Filter 1.0 schema for gt-xml. \ No newline at end of file +Filter 1.0 schema for ``gt-xml`` diff --git a/docs/user/extension/xsd/gml2.rst b/docs/user/extension/xsd/gml2.rst index 726a1853e25..a1b8127fa1c 100644 --- a/docs/user/extension/xsd/gml2.rst +++ b/docs/user/extension/xsd/gml2.rst @@ -1,4 +1,4 @@ XSD GML2 -------- -GML2 schema for gt-gml. \ No newline at end of file +GML2 schema for ``gt-gml`` diff --git a/docs/user/extension/xsd/gml3.rst b/docs/user/extension/xsd/gml3.rst index 11a7575ecfa..55454da1588 100644 --- a/docs/user/extension/xsd/gml3.rst +++ b/docs/user/extension/xsd/gml3.rst @@ -1,4 +1,4 @@ XSD-GML3 -------- -GML3 schema for gt-xml. \ No newline at end of file +GML3 schema for ``gt-xml`` diff --git a/docs/user/extension/xsd/index.rst b/docs/user/extension/xsd/index.rst index 31fb2ed39df..f113a7a10f1 100644 --- a/docs/user/extension/xsd/index.rst +++ b/docs/user/extension/xsd/index.rst @@ -1,8 +1,8 @@ XSD === -These extensions are used by the gt-xml module to capture common XML schemas -(and represent them programatically using the eclipse XSD library). This work +These extensions are used by the ``gt-xml`` module to capture common XML schemas +(and represent them programmatically using the eclipse XSD library). This work prevents GeoTools from needing to contact the Internet when working with basic XML schema bindings and XLinks. @@ -24,4 +24,4 @@ XML schema bindings and XLinks. References: * :doc:`gt-xml ` -* :doc:`gt-ogc ` \ No newline at end of file +* :doc:`gt-ogc ` diff --git a/docs/user/extension/xsd/kml.rst b/docs/user/extension/xsd/kml.rst index de727a88fee..e7d0d5d08b8 100644 --- a/docs/user/extension/xsd/kml.rst +++ b/docs/user/extension/xsd/kml.rst @@ -1,7 +1,7 @@ XSD-KML ------- -KML schema and bindings for gt-xml allowing the handling of FeatureCollection +KML schema and bindings for ``gt-xml`` allowing the handling of FeatureCollection and Feature content. References: diff --git a/docs/user/extension/xsd/ows.rst b/docs/user/extension/xsd/ows.rst index 4b042e8cfb3..e418567d926 100644 --- a/docs/user/extension/xsd/ows.rst +++ b/docs/user/extension/xsd/ows.rst @@ -1,4 +1,4 @@ XSD OWS ------- -Open web services (OWS) schema for gt-xml. \ No newline at end of file +Open web services (OWS) schema for ``gt-xml`` diff --git a/docs/user/extension/xsd/sld.rst b/docs/user/extension/xsd/sld.rst index ad721bb57e7..8cc2135ce4c 100644 --- a/docs/user/extension/xsd/sld.rst +++ b/docs/user/extension/xsd/sld.rst @@ -1,4 +1,4 @@ XSD SLD ------- -SLD Schema for gt-xml. \ No newline at end of file +SLD Schema for ``gt-xml`` diff --git a/docs/user/extension/xsd/wcs.rst b/docs/user/extension/xsd/wcs.rst index bbbb3472ece..b9bd8b44c65 100644 --- a/docs/user/extension/xsd/wcs.rst +++ b/docs/user/extension/xsd/wcs.rst @@ -1,4 +1,4 @@ XSD WCS ------- -Web coverage service (WCS) schema for gt-xml. \ No newline at end of file +Web coverage service (WCS) schema for ``gt-xml`` diff --git a/docs/user/extension/xsd/wfs.rst b/docs/user/extension/xsd/wfs.rst index 748aaeabc61..8d7d0868c23 100644 --- a/docs/user/extension/xsd/wfs.rst +++ b/docs/user/extension/xsd/wfs.rst @@ -1,4 +1,4 @@ XSD WFS ------- -Web feature service (WFS) for gt-xml. \ No newline at end of file +Web feature service (WFS) for ``gt-xml`` diff --git a/docs/user/extension/xsd/wms.rst b/docs/user/extension/xsd/wms.rst index 8a94a4fd923..87163f978f6 100644 --- a/docs/user/extension/xsd/wms.rst +++ b/docs/user/extension/xsd/wms.rst @@ -1,4 +1,4 @@ XSD WMS ------- -Web map service (WMS) schema for gt-xml. \ No newline at end of file +Web map service (WMS) schema for ``gt-xml`` diff --git a/docs/user/extension/xsd/wps.rst b/docs/user/extension/xsd/wps.rst index 3f33366eb65..b4829404436 100644 --- a/docs/user/extension/xsd/wps.rst +++ b/docs/user/extension/xsd/wps.rst @@ -1,4 +1,4 @@ XSD WPS ------- -Web processing service (WPS) schema for gt-xml. \ No newline at end of file +Web processing service (WPS) schema for ``gt-xml`` diff --git a/docs/user/extension/ysld.rst b/docs/user/extension/ysld.rst index 07e50ef37e1..f7a4cd9619e 100644 --- a/docs/user/extension/ysld.rst +++ b/docs/user/extension/ysld.rst @@ -108,7 +108,7 @@ Color examples: fill-color: rgb(255,0,255) Color literals can be specified either as a 6 digit hex string or a 3 argument -rgb function call. +``rgb`` function call. Filters ''''''' @@ -166,7 +166,7 @@ Lists and arrays are specified as space delimited. For example: Anchors & References '''''''''''''''''''' -With Yaml it is possible to reference other parts of a document. With this +With YAML it is possible to reference other parts of a document. With this it is possible to support variables and mix ins. An example of a color variable: .. code-block:: yaml @@ -643,4 +643,4 @@ YSLD also provides a validator, which can be called using: Ysld.validate(ysld); -This call accepts the everything that `Ysld.parse(ysld)` does, and returns a list of exceptions corresponding to syntax errors. \ No newline at end of file +This call accepts the everything that `Ysld.parse(ysld)` does, and returns a list of exceptions corresponding to syntax errors. diff --git a/docs/user/geotools.rst b/docs/user/geotools.rst index bda02c0239c..01a3c844173 100644 --- a/docs/user/geotools.rst +++ b/docs/user/geotools.rst @@ -53,7 +53,7 @@ Core Features GeoTools also operates as part of a wider community with a staging area used to foster new talent and promote experimentation. - Some highlights are swing support (used in our tutorials!), swt, local and web process support, + Some highlights are swing support (used in our tutorials!), SWT, local and web process support, additional symbology, additional data formats, generation of grids and a couple of implementations of ISO Geometry. @@ -62,21 +62,57 @@ Supported Formats * raster formats and data access - arcsde, arcgrid, geotiff, grassraster, image (JPEG, TIFF, GIF, PNG), imageio-ext-gdal, - imagemosaic, imagepyramid, JP2K, matlab - -* Database "jdbc-ng" support - - db2, h2, mysql, oracle, postgis, spatialite, sqlserver + + ``arcsde`` + + ``arcgrid`` + + ``geotiff`` + + ``grassraster`` + + image ( ``JPEG`` ``TIFF`` ``GIF`` ``PNG`` ), + + ``imageio-ext-gdal`` + + ``imagemosaic`` + + ``imagepyramid`` + + ``JP2K`` + + ``matlab`` + +* Database ``jdbc-ng`` support + + + ``db2`` + + ``h2`` + + ``mysql`` + + ``oracle`` + + ``postgis`` + + ``spatialite`` + + ``sqlserver`` * Vector formats and data access - app-schema, arcsde, csv, dxf, geojson, org, property, shapefile, wfs + + + ``app-schema`` + + ``arcsde`` + + ``csv`` + + ``dxf`` + + ``geojson`` + + ``property`` + + ``shapefile`` + + ``wfs`` + * XML Bindings Java data structures and bindings provided for the following: - xsd-core (xml simple types), fes, filter, gml2, gml3, kml, ows, sld, wcs, wfs, wms, wps. + + + ``xsd-core`` (xml simple types) + + ``fes`` + + ``filter`` + + ``gml2`` + + ``gml3`` + + ``kml`` + + ``ows`` + + ``sld`` + + ``wcs`` + + ``wfs`` + + ``wms`` + + ``wmts`` + + ``wps`` Additional Geometry, Filter and Style parser/encoders available for DOM and SAX applications. diff --git a/docs/user/library/coverage/arcsde.rst b/docs/user/library/coverage/arcsde.rst index 6b302c5fcd0..c7aaab9415f 100644 --- a/docs/user/library/coverage/arcsde.rst +++ b/docs/user/library/coverage/arcsde.rst @@ -10,12 +10,12 @@ References: ArcSDE Raster ^^^^^^^^^^^^^ -Since Geotools 2.3.x and 2.4.x. +Since GeoTools 2.3.x and 2.4.x. ESRI's ArcSDE spatial database product allows raster data to be stored inside a host RDBMS. ArcSDE then provides a standard API to access the raster data. It's worth noting that the merits of storing large chunks of raster data inside an RDBMS are arguable. Perhaps the DBMS is better at handling Disk I/O, and perhaps there are enterprise or data-management advantages. However, many people actually store raster data inside ArcSDE, so there is a need to support it. -Connecting to ArcSDE Raster datasets -'''''''''''''''''''''''''''''''''''' +Connecting to ArcSDE Raster data sets +''''''''''''''''''''''''''''''''''''' When using ArcSDE Raster support, you can use it just like a standard GridCoverage2DReader. However, when instantiating it, you must pass it a String or File containing the URL of the SDE instance @@ -48,7 +48,7 @@ Raster Support Features * Connection pooling (based on GT ArcSDE connection pooling) * Auto-discovery of available CRS information -* Pyramid support (RRD or "overviews"), if present in the underlying raster dataset +* Pyramid support (RRD or "overviews"), if present in the underlying raster data set * 3 or 4 Band unsigned-byte RGBX Rasters * Colormapped rasters @@ -57,7 +57,7 @@ Raster Support Features Supported Raster Types '''''''''''''''''''''' -Currently ArcSDE Raster support is limited to 3-band or 4-band, one-byte-per-band, non-colormapped rasters. Support for further ArcSDE raster types is in progress. To check out what's on the roadmap, look at the GeoTools ArcSDE Raster Format information page. +Currently ArcSDE Raster support is limited to 3-band or 4-band, one-byte-per-band, non-colormapped rasters. Support for further ArcSDE raster types is in progress. To check out what's on the road map, look at the GeoTools ArcSDE Raster Format information page. ======== ======================================= Support Raster Type @@ -70,7 +70,7 @@ no Non unsigned-byte Rasters General configuration notes ''''''''''''''''''''''''''' -Also make sure that the port number specified is the same as in the services file (%(%(%systemRoot%\system32\drivers\etc\services in windows), it should contain a line like (if yours is different then change the port param of your datastore definition):: +Also make sure that the port number specified is the same as in the services file ``(%(%(%systemRoot%\system32\drivers\etc\services in windows)``, it should contain a line like (if yours is different then change the port parameter of your datastore definition):: esri_sde 5151/tcp @@ -82,7 +82,7 @@ Also make sure that the port number specified is the same as in the services fil There is limited support for different kinds of rasters (see the Raster Support Features section below for specific details) and the code has only been used in one ArcSDE environment. - The 'Raster Support Plan' section, below, outlines a plan to make the Geotools ArcSDE raster + The 'Raster Support Plan' section, below, outlines a plan to make the GeoTools ArcSDE raster code both support more formats, as well as enter the mainline development tree/process. Raster Support Plan: diff --git a/docs/user/library/coverage/coverageio.rst b/docs/user/library/coverage/coverageio.rst index 8be58d0f2c8..00948afb1db 100644 --- a/docs/user/library/coverage/coverageio.rst +++ b/docs/user/library/coverage/coverageio.rst @@ -1,6 +1,6 @@ Coverage IO Plugin ------------------ -Unsupported plugin containing base classes for coveage io opertaions. +Unsupported plugin containing base classes for coverage IO operations. -No documentation has been provided. \ No newline at end of file +No documentation has been provided. diff --git a/docs/user/library/coverage/faq.rst b/docs/user/library/coverage/faq.rst index d00952d3a7a..64a126c9691 100644 --- a/docs/user/library/coverage/faq.rst +++ b/docs/user/library/coverage/faq.rst @@ -34,12 +34,12 @@ JAI Image I/O system When combined, these subsystems provide immense power to the GeoTools coverage module but this dependency does require that programmers who wish to use and extend the module must learn to use these other Java modules. -To get the most out of the gt-coverage module developers should be familiar with the underlying mathematical ideas. Knowledge of ideas such as an Affine Transforms (for rotating and scaling) is required to work effectively with the coverage module. Affines are explained any computer graphics textbooks, and on many web sites, if you need a refresher. +To get the most out of the ``gt-coverage`` module developers should be familiar with the underlying mathematical ideas. Knowledge of ideas such as an Affine Transforms (for rotating and scaling) is required to work effectively with the coverage module. Affines are explained any computer graphics textbooks, and on many web sites, if you need a refresher. Q: How to make raster data work in a NetBeans based application? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Reporterly, the NetBeans classloader breaks ImageIO plugin mechanism which is used +Reportedly, the NetBeans class loader breaks ImageIO plugin mechanism which is used to locate image format readers, image input and output streams, and the like. To work around it, run the following line of code, only once, before any raster access:: diff --git a/docs/user/library/coverage/geotiff.rst b/docs/user/library/coverage/geotiff.rst index 2c58fe87b91..3f7561be78a 100644 --- a/docs/user/library/coverage/geotiff.rst +++ b/docs/user/library/coverage/geotiff.rst @@ -1,7 +1,7 @@ GeoTIFF Plugin -------------- -The gt-geotiff module in the plugin group provides access to the GeoTiff file format. +The ``gt-geotiff`` module in the plugin group provides access to the GeoTiff file format. **References** diff --git a/docs/user/library/coverage/geotiff_new.rst b/docs/user/library/coverage/geotiff_new.rst index a7a707129a0..ddddfd3f043 100644 --- a/docs/user/library/coverage/geotiff_new.rst +++ b/docs/user/library/coverage/geotiff_new.rst @@ -3,4 +3,4 @@ GeoTIFF New Plugin Unsupported plugin experimenting with accessing GeoTIFF. -No documenation has been provided. \ No newline at end of file +No documentation has been provided. diff --git a/docs/user/library/coverage/grassraster.rst b/docs/user/library/coverage/grassraster.rst index 66a133315ea..5046df32d90 100644 --- a/docs/user/library/coverage/grassraster.rst +++ b/docs/user/library/coverage/grassraster.rst @@ -2,8 +2,8 @@ GrassRaster Plugin ------------------ The module supplies support for reading and writing GRASS rasters. The metadata contain both the -colortable and the categories (if available) of the raster map. The original colortable of the -GRASS raster is read into the geotools coverage Categories and can as such be visualized +color table and the categories (if available) of the raster map. The original color table of the +GRASS raster is read into the GeoTools coverage categories and can as such be visualized if using a default styler. **Maven**:: @@ -14,23 +14,27 @@ if using a default styler. ${geotools.version} -Data structure of a rastermap ------------------------------ - -Raster data in GRASS are strictly bound to their workspace. Since a workspace is something more on userlevel, I will from now on use grass database for the folder structure and workspace for what the user will interact with at application level. - -A GRASS raster map consists of several files in several subdirectories in a mapset, organized as follows: - -* cellhd/: map header including projection code, coordinates representing the spatial extent of the raster map, number of rows and columns, resolution, and information about map compression; -* cell/, fcell/ or grid3/: generic matrix of values in a compressed, portable format which depends on the raster data type (integer, floating point or 3D grid); -* hist/: history file which contains metadata such as the data source, the command that was used to generate the raster map, or other information provided by the user; -* cats/: optional category file which contains text or numeric labels assigned to the raster map categories; -* colr/: optional color table; -* cell_misc/: optional timestamp, range of values, quantization rules (for floating point maps) and null (no-data) files; -* WIND: contains the active processing region and the resolution -* PROJ_INFO: contains the information about the projection -* PROJ_UNITS: contains the information about projection units used -* vector/: contain the vector data since GRASS 6 +Data structure of a raster map +------------------------------ + +Raster data in GRASS are strictly bound to their workspace. Since a +workspace is something more on user level, I will from now on use grass +database for the folder structure and workspace for what the user will +interact with at application level. + +A GRASS raster map consists of several files in several subdirectories +in a ``mapset`` , organized as follows: + +* ``cellhd/``: map header including projection code, coordinates representing the spatial extent of the raster map, number of rows and columns, resolution, and information about map compression; +* ``cell/``, ``fcell/`` or ``grid3/``: generic matrix of values in a compressed, portable format which depends on the raster data type (integer, floating point or 3D grid); +* ``hist/``: history file which contains metadata such as the data source, the command that was used to generate the raster map, or other information provided by the user; +* ``cats/``: optional category file which contains text or numeric labels assigned to the raster map categories; +* ``colr/``: optional color table; +* ``cell_misc/``: optional timestamp, range of values, quantization rules (for floating point maps) and null (no-data) files; +* ``WIND``: contains the active processing region and the resolution +* ``PROJ_INFO``: contains the information about the projection +* ``PROJ_UNITS``: contains the information about projection units used +* ``vector/``: contain the vector data since GRASS 6 Usage ----- diff --git a/docs/user/library/coverage/grid.rst b/docs/user/library/coverage/grid.rst index 5fe59a977fa..1f76a065e41 100644 --- a/docs/user/library/coverage/grid.rst +++ b/docs/user/library/coverage/grid.rst @@ -15,9 +15,9 @@ If you already know what kind of file you have you have you can create the reade GeoTiffReader reader = new GeoTiffReader(file, new Hints(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolean.TRUE)); GridCoverage2D coverage = reader.read(null); -You can also create a GridCoverage "by hand" if you have a BufferedImage in memory that you would like to place onto a map. +You can also create a GridCoverage "by hand" if you have a ``BufferedImage`` in memory that you would like to place onto a map. -Here is an example of creating a grid coverage from a tile (containing a bufferedImage and a ReferencedEnvelope location: +Here is an example of creating a grid coverage from a tile (containing a ``BufferedImage`` and a ``ReferencedEnvelope`` location: .. literalinclude:: /../src/main/java/org/geotools/coverage/CoverageExamples.java :language: java @@ -49,19 +49,23 @@ You can also evaluate the coverage at a specific point in order to determine wha RenderedImage ''''''''''''' -We can trivially get an AWT image from a GridCoverage2D with a simple call to the getRenderedImage() method. The result is a standard RenderedImage. +We can trivially get an AWT image from a ``GridCoverage2D`` with a simple call to +the ``getRenderedImage()`` method. The result is a standard ``RenderedImage``. Obviously we can combine two of these steps to go directly from the created grid coverage to the final image:: RenderedImage ri = myGridCoverage.getView(ViewType.GEOPHYSICS).getRenderedImage(); -It should be possible, when generating the RenderedImage to specify the color scheme to use for that particular image. Currently this -is handled as part of the rendering process using a RasterSymbolizer. +It should be possible, when generating the ``RenderedImage`` to specify the color scheme to use for that particular image. Currently this +is handled as part of the rendering process using a ``RasterSymbolizer``. Advanced ^^^^^^^^ -The coverage module provides some powerful methods to use the different views of the grid coverage. Many of these uses are backed by the standard JAI mechanisms behind the scenes, sometimes combined with the georeferencing operations of the referencing module. +The coverage module provides some powerful methods to use the different +views of the grid coverage. Many of these uses are backed by the +standard JAI mechanisms behind the scenes, sometimes combined with the +georeferencing operations of the referencing module. The GeoTools coverage module provides **Operations** for convenience, this class bundles up the sophisticated and powerful internal mechanism of the processing package. The package summary in javadocs begins the explanation of the internal mechanism. This documentation page will need to be expanded with a better explanation of the coverage module operation system. @@ -70,7 +74,7 @@ The basic pattern of the operations mechanism runs as follows: 1. Instantiate a new Processor 2. Get the parameter group for the desired operation 3. Configure the parameters in the parameter group -4. Call the doOperation(..) method on the Processor +4. Call the ``doOperation(..)`` method on the Processor With several options for configuration along the way. @@ -105,7 +109,16 @@ We can use the resample(..) method to transform any GridCoverage to another CRS. Wow, this is getting fun! -This georeferencing transformation works backwards from what one might naively expect and from what happens with vector data. With vector data, tranformations take the positions in the original referencing system and calculate the positions in the target referencing system. In the GridCoverage system, we are expecting a regular grid in the target referencing system. Therefore, we first calculate the position of the grid points in the target referencing system, then, for each, we calculate the equivalent position in the original referencing system and estimate the value which the original grid would have at that calculated position. This is why we go through the resample(..) operation. +This georeferencing transformation works backwards from what one might +naively expect and from what happens with vector data. With vector +data, transformations take the positions in the original referencing +system and calculate the positions in the target referencing system. In +the GridCoverage system, we are expecting a regular grid in the target +referencing system. Therefore, we first calculate the position of the grid +points in the target referencing system, then, for each, we calculate the +equivalent position in the original referencing system and estimate the +value which the original grid would have at that calculated position. This +is why we go through the ``resample(..)`` operation. interpolate ''''''''''' @@ -154,7 +167,8 @@ Users can create their own operations and add them to the operation system. CoverageStack ^^^^^^^^^^^^^ -We can combine several GridCoverage2D instances into a 3 dimensional stack of coverages using the CoverageStack class. +We can combine several GridCoverage2D instances into a 3 dimensional +stack of coverages using the CoverageStack class. Utility classes ^^^^^^^^^^^^^^^ diff --git a/docs/user/library/coverage/image.rst b/docs/user/library/coverage/image.rst index c369666abe6..0e5f360af58 100644 --- a/docs/user/library/coverage/image.rst +++ b/docs/user/library/coverage/image.rst @@ -30,64 +30,56 @@ raster images with an associated world file.:: AbstractGridFormat format = GridFormatFinder.findFormat( file ); GridCoverage2DReader reader = format.getReader( file ); -World files have the same name as the image (different file extension) and contain just -enough information to convert pixel coordinates to real world coordinates. They do not -store any coordinate reference system information for the coordinates. +World files have the same name as the image (different file extension) +and contain just enough information to convert pixel coordinates to real +world coordinates. They do not store any coordinate reference system +information for the coordinates. -The gt-image plugin depends on Java to read the image file; so depending on how you have -JAI / Image IO configured the following should be supported: +The gt-image plugin depends on Java to read the image file; so depending +on how you have JAI / Image IO configured the following should be +supported: -============= ======================= ===================== -Image Format Image Format Extension World File Extension -============= ======================= ===================== -JPEG file.jpg or file.jpeg file.jgw or file.wld -TIFF file.tif or file.tiff file.tfw or file.wld -PNG file.png file.pgw or file.wld -GIF file.gif file.gfw or file.wld -============= ======================= ===================== +============= ============================== ============================== +Image Format Image Format Extension World File Extension +============= ============================== ============================== +JPEG ``file.jpg`` or ``file.jpeg`` ``file.jgw`` or ``file.wld`` +TIFF ``file.tif`` or ``file.tiff`` ``file.tfw`` or ``file.wld`` +PNG ``file.png`` ``file.pgw`` or ``file.wld`` +GIF ``file.gif`` ``file.gfw`` or ``file.wld`` +============= ============================== ============================== World File ^^^^^^^^^^ -A world file is a small text file that says where the corners of the image is. The extension of -a world file is the first and last letters of the image extension with "w" appended at the end. -The coordinates are in the units of the projections, so -180,180 -90,90 for lat/long. +A world file is a small text file that says where the corners of the +image is. The extension of a world file is the first and last letters +of the image extension with "w" appended at the end. The coordinates +are in the units of the projections, so -180,180 -90,90 for lat/long. -If your image is not in lat/long you will have to include a .prj file, which is a text file with -the WKT definition of the coordinate system that should be used. +If your image is not in lat/long you will have to include a ``.prj`` file, +which is a text file with the WKT definition of the coordinate system +that should be used. Example contents of a world file are as follows: -+------+----------------+---------------------------------------------------------------+ -|Line | Example | Definition | -+======+================+===============================================================+ -|1 |0.0359281435 | Horizontal scale for a pixel | -+------+----------------+---------------------------------------------------------------+ -|2 |0.0000000000 | Rotation for row, usually zero | -+------+----------------+---------------------------------------------------------------+ -|3 |0.0000000000 | Rotation for column, usually zero | -+------+----------------+---------------------------------------------------------------+ -|4 |-0.0359281437 | Vertical scale for pixel, usually negative as rasters count | -| | | down from the upper left corner | -+------+----------------+---------------------------------------------------------------+ -|5 |-179.9820349282 | Translation, usually "easting" location of the upper left | -| | | pixel (ie column 0) | -+------+----------------+---------------------------------------------------------------+ -|6 |89.9820359281 | Translation, usually "northing" location of the upper left | -| | | pixel (ie row 0) | -+------+----------------+---------------------------------------------------------------+ - -The Translation information can be thought of as the location of the upper left pixel, this -location is provided in the units of the projections being used: - -* For lat/long this location should be in the range -180,180 -90,90 -* If your image is not in lat/long you will have to include a .prj file, which is a text file with the - WKT definition of the coordinate system that should be used. +====== ================ ================================================================ +Line Example Definition +====== ================ ================================================================ +1 0.0359281435 Horizontal scale for a pixel +2 0.0000000000 Rotation for row, usually zero +3 0.0000000000 Rotation for column, usually zero +4 -0.0359281437 Vertical scale for pixel, usually negative as rasters count + down from the upper left corner +5 -179.9820349282 Translation, usually "easting" location of the upper left + pixel (i.e. column 0) +6 89.9820359281 Translation, usually "northing" location of the upper left + pixel (i.e. row 0) +====== ================ ================================================================ **Projection File** -A projection file (prj) is WKT representation of the projection the image is in: +A projection file (``prj``) is WKT representation of the projection the image is in. **image.prj**:: @@ -97,9 +89,9 @@ A projection file (prj) is WKT representation of the projection the image is in: JPEG Example ^^^^^^^^^^^^ -If your image is world.jpg then you need a world.jgw file and optionally a world.prj file. +If your image is ``world.jpg`` then you need a ``world.jgw`` file and optionally a ``world.prj`` file. -An example world.jgw:: +An example ``world.jgw``:: 0.0359281435 0.0000000000 @@ -108,7 +100,7 @@ An example world.jgw:: -179.9820349282 89.9820359281 -An example world.prj is:: +An example ``world.prj`` is:: GEOGCS["GCS_WGS_1984", DATUM["WGS_1984", SPHEROID["WGS_1984",6378137,298.257223563]], PRIMEM["Greenwich",0], UNIT["Degree",0.017453292519943295]] diff --git a/docs/user/library/coverage/imageio.rst b/docs/user/library/coverage/imageio.rst index 5b55c9eb0ba..552b69bfcdf 100644 --- a/docs/user/library/coverage/imageio.rst +++ b/docs/user/library/coverage/imageio.rst @@ -1,11 +1,11 @@ ImageIO-EXT GDAL Plugin ----------------------- -The ImageIO-EXT plug-in allows geotools to make use of the additional formats provided via the +The ImageIO-EXT plug-in allows GeoTools to make use of the additional formats provided via the Java Extension ImageIO-EXT. The Java ImageIO library comes with a few formats out of the box (such as PNG, etc...) the -imageio-ext project provides support for additional geospatial formats. +ImageIO-EXT project provides support for additional geospatial formats. **References** @@ -26,7 +26,7 @@ At the GeoTools level, the set of formats supported by the GeoTools ImageIO-Ext is composed of: * DTED Elevation Raster -* ESRI .hdr labelled +* ESRI ``.hdr`` labeled * Erdas Imagine Images * NITF: National Imagery Transmission Format * ECW: ERMapper Compressed Wavelets @@ -43,7 +43,7 @@ file formats: * Arc/Info ASCII Grid * Arc/Info Binary Grid -* ENVI .hdr Labelled +* ENVI ``.hdr`` labeled * ENVISAT Image Format * GDAL VRT * GeoTIFF diff --git a/docs/user/library/coverage/index.rst b/docs/user/library/coverage/index.rst index 54f11e2fd55..48980cffd20 100644 --- a/docs/user/library/coverage/index.rst +++ b/docs/user/library/coverage/index.rst @@ -11,7 +11,7 @@ The gt-coverage module is responsible for: * implementation of the coverage interfaces from :doc:`gt-opengis <../opengis/index>` such as GridCoverage2D and Format * Bridging between Java Advanced Imaging, JAI Image IO and Java Image facilities and the geospatial idea of a GridCoverage -* Recognising additional formats available on the CLASSPATH using **GridFormatFinder** +* Recognizing additional formats available on the CLASSPATH using **GridFormatFinder** The module supports the use of coverage information (i.e. raster) from a range of sources. diff --git a/docs/user/library/coverage/internal/format.rst b/docs/user/library/coverage/internal/format.rst index 6f8cb700068..ed001bcacf1 100644 --- a/docs/user/library/coverage/internal/format.rst +++ b/docs/user/library/coverage/internal/format.rst @@ -3,17 +3,17 @@ Format The standard way to access an external data source to create GeoTools GridCoverage instances currently requires creating several classes: -1. A javax.imageio.ImageReader class to access the data source and providing the methods to create: +1. A ``javax.imageio.ImageReader`` class to access the data source and providing the methods to create: - * java.awt.image.RenderedImage - * javax.imageio.metadata.IIOMetadata instance defining both: + * ``java.awt.image.RenderedImage`` + * ``javax.imageio.metadata.IIOMetadata`` instance defining both: - * the meaning of the numeric values in the RenderedImage; and - * the georeferencing parameters to geolocate the image + * the meaning of the numeric values in the ``RenderedImage``; and + * the georeferencing parameters to geolocate the image 2. A builder of the GridCoverage2D which uses the above information to create an instance. -The gt-opengis module documentation explains the concepts behind this work. It should eventually be possible to reduce the effort required of programmers wishing to use this part of the library (in particular a standard way to define all the different kinds of metadata for grid coverages). +The ``gt-opengis`` module documentation explains the concepts behind this work. It should eventually be possible to reduce the effort required of programmers wishing to use this part of the library (in particular a standard way to define all the different kinds of metadata for grid coverages). This page explores some of the examples available today. @@ -26,12 +26,20 @@ This ImageReader will need to provide both a RenderedImage and an object which e The final step involves writing a class which can create a GridCoverage2D. That class will need to get the RenderedImage from the ImageReader and will need to parse the IIOMetaData instance also obtained from the ImageReader to extract the required information on both the meaning of the data and the georeferencing of the image. With that information, the class will use the GridCoverageFactory in the coverage module to instantiate the GridCoverage2d. * Unfortunately, we have not yet arrived at a design sufficiently powerful and flexible to handle the creation of GridCoverage instances from all the different kinds of data a user can have. Therefore, it is the programmer using the GeoTools library who must create a system to generate a new GridCoverage for each data file type they need to access. It is up to that programmer, based on the knowledge of the data format and the data contents of the files their applications use, to extract any generalization which they can get to avoid having to write a new class for every file. -* Some work has been done in GeoAPI and GeoTools to start to create a more general framework. For example, the class that builds a GridCoverage is generally called a GridCoverageReader since it is based on an ImageReader---there is even an interface of that name in GeoAPI. Unfortunately, this is work in progress and the API will probably change once we start work to finalize the standard way to access grid data. Programmers today should ignore all that work and build their own. However, the unsupported module coverageio and coverageio-netcdf may have useful ideas for programmers who wish to look at that code. - -This page refers to the DEM example from the gt-opengis explanation of GridCoverage. +* Some work has been done in GeoAPI and GeoTools to start to create + a more general framework. For example, the class that builds a + GridCoverage is generally called a GridCoverageReader since it is + based on an ImageReader---there is even an interface of that name in + GeoAPI. Unfortunately, this is work in progress and the API will probably + change once we start work to finalize the standard way to access grid + data. Programmers today should ignore all that work and build their + own. However, the unsupported module ``coverageio`` and ``coverageio-netcdf`` + may have useful ideas for programmers who wish to look at that code. + +This page refers to the DEM example from the ``gt-opengis`` explanation of GridCoverage. ========== ==================== ============== ====================== -RAW Data Category Value Colour +RAW Data Category Value Color ========== ==================== ============== ====================== -9999 QualitativeCategory NaN new Color(0,0,0,0) -8888 QualitativeCategory NaN Color.WHITE @@ -40,12 +48,12 @@ RAW Data Category Value Colour **ImageReader** -The ImageReader class is part of the javax.imageio package. It is an abstract class which needs only a few methods defined to work the critical ones being: +The ImageReader class is part of the ``javax.imageio`` package. It is an abstract class which needs only a few methods defined to work the critical ones being: -* getImageMetadata(..): IIOMetaData -* read(..): BufferedImage +* ``getImageMetadata(..)``: ``IIOMetaData`` +* ``read(..)``: ``BufferedImage`` -The key difficulty, apart from being able to generate the image, being how to build the IIOMetaData object. In our case, we subclass that object adding the metadata information we will need. +The key difficulty, apart from being able to generate the image, being how to build the ``IIOMetaData`` object. In our case, we subclass that object adding the metadata information we will need. The core functionality of this class follows the standard Java Image I/O framework which is explained in the package documentation which includes the useful Java Image I/O API Guide. @@ -57,7 +65,7 @@ The core functionality of this class follows the standard Java Image I/O framewo We must also create a class which is able to draw on the ImageReader we created above and use its contents to create the GridCoverage2D. This is merely a matter of using the ImageReader to get all the required pieces and reassembling those pieces to work for the Factory we use to create the GridCoverage2D. -The ImageReader can furnish the required RenderedImage using the read(..) method. The rest of the required information which is described below will need to be extracted from the IIOMetaData object obtained from the getImageMetadata(..) method (depending, as explained in the note above, on where the programmer decides to obtain all the required metadata). +The ImageReader can furnish the required RenderedImage using the ``read(..)`` method. The rest of the required information which is described below will need to be extracted from the IIOMetaData object obtained from the ``getImageMetadata(..)`` method (depending, as explained in the note above, on where the programmer decides to obtain all the required metadata). The builder will have to wrap up the following steps. @@ -128,7 +136,7 @@ Available Plugins Keeping the above implementation advice in mind we can review some of the plugin modules that support reading and writing of images from or to file or databases. -The simple plugins provide access to a single file format of two dimensional images. More complex plugins can read, sometimes even create, image tiles mosaicing original data sets which can be very large, possibly much larger than available memory, into manageable pieces or tiles providing hierarchical levels of generalisations in pyramids or combinations of the pyramids and mosaics. Other complex plugins can handle more complex file formats such as the multi-dimensional file formats used to store temporal series of images, or multi-valued imagery. +The simple plugins provide access to a single file format of two dimensional images. More complex plugins can read, sometimes even create, image tiles mosaicing original data sets which can be very large, possibly much larger than available memory, into manageable pieces or tiles providing hierarchical levels of generalizations in pyramids or combinations of the pyramids and mosaics. Other complex plugins can handle more complex file formats such as the multi-dimensional file formats used to store temporal series of images, or multi-valued imagery. These implementations show a range of design approaches and you are free to explore your own ideas. @@ -144,7 +152,7 @@ Simple Imagery Several plugins provide access to simple imagery, generally a single 2 dimensional block of pixels. These Input/Output (I/O) packages are provided in separate plugins modules to GeoTools often in the 'plugin' group of modules. -These plugins use either the geo-referencing information stored in the file format itself or use a second file with the geo-referencing information, a so-called 'world' file in the 'image+world file' type formats. +These plugins use either the georeferencing information stored in the file format itself or use a second file with the georeferencing information, a so-called 'world' file in the 'image+world file' type formats. Because GeoTools has not yet defined a single approach to for creating GridCoverages, alternative approaches have emerged for reading and writing GridCoverages from external sources. Previous sections have discussed how a user can create their own system to read and write files. This section presents the approaches used in the plugin system. @@ -160,18 +168,19 @@ Mosaics and Pyramids GeoTools provides modules capable of working with tiles of images which form mosaics or pyramids. Such tilings are very useful where programs need to provide efficient access to imagery either to small sections of a large image or at several levels of resolution to enable zooming. -GeoSolutions has created a set of modules in the plugins group to read mosaics and pyramids from pre-generated files. +GeoSolutions has created a set of modules in the plugins group to read +mosaics and pyramids from pregenerated files. * Image Mosaic Plugin * Image Pyramid Plugin -Christian Mueller has created the imagemosaic-jdbc module to read pre-generated tiles which are stored in a database. +Christian Mueller has created the ``imagemosaic-jdbc`` module to read pregenerated tiles which are stored in a database. * Image Mosaicing Pyramidal JDBC Plugin -An alternative approach has been created in the coverageio module of the unsupported module group. +An alternative approach has been created in the ``coverageio`` module of the unsupported module group. Multi-dimensional ''''''''''''''''' -There are also several approaches to handling multi-dimensional data, again with different approaches taken by different groups. Usually these groups are working with NetCDF files from different organisations (and thus have different conventions to contend with). \ No newline at end of file +There are also several approaches to handling multi-dimensional data, again with different approaches taken by different groups. Usually these groups are working with NetCDF files from different organizations (and thus have different conventions to contend with). diff --git a/docs/user/library/coverage/jdbc/customized.rst b/docs/user/library/coverage/jdbc/customized.rst index 5f60f79601b..8476ef180cc 100644 --- a/docs/user/library/coverage/jdbc/customized.rst +++ b/docs/user/library/coverage/jdbc/customized.rst @@ -12,12 +12,14 @@ concerning raster data. * An existing database layout (tables,views) holding the raster data. -Image Mosaicing Pyramidal JDBC Plugin has an interface called org.geotools.gce.imagemosaic.jdbc.JDBCAccess. -Classes implementing this interface are responsible for the jdbc communication. Additionally, there is an -abstract base class with some default implementations, org.geotools.gce.imagemosaic.jdbc.JDBCAccessCustom. +Image Mosaicing Pyramidal JDBC Plugin has an interface called +``org.geotools.gce.imagemosaic.jdbc.JDBCAccess``. Classes implementing this +interface are responsible for the jdbc communication. Additionally, +there is an abstract base class with some default implementations, +``org.geotools.gce.imagemosaic.jdbc.JDBCAccessCustom``. A customized implementation should subclass this class and implement two methods. The name of this -subclass is a configuration parameter in the xml config file. +subclass is a configuration parameter in the XML configuration file. The concrete procedure '''''''''''''''''''''' @@ -26,9 +28,9 @@ The concrete procedure The abstract super class has some nice methods, especially - * Connection getConnection() - * Config getConfig() - * CoordinateReferenceSystem getCRS + * ``Connection getConnection()`` + * ``Config getConfig()`` + * ``CoordinateReferenceSystem getCRS()`` Here is an example:: @@ -55,13 +57,13 @@ The concrete procedure 2. Initialize the meta info - This is done in the method initialize. This method is called only once for each coverage / xml - config file. + This is done in the method initialize. This method is called only once for each coverage / XML + configuration file. - The essential part is to create a list of org.geotools.gce.imagemosaic.jdbc.ImageLevelInfo objects. + The essential part is to create a list of ``org.geotools.gce.imagemosaic.jdbc.ImageLevelInfo`` objects. - The info object at index 0 describes the base image, at index 1 is the info for the first pyramid, - and so on. If there are no pyramids, the list has only one info object. + The ``info`` object at index 0 describes the base image, at index 1 is the info for the first pyramid, + and so on. If there are no pyramids, the list has only one ``info`` object. A code template:: @@ -102,53 +104,53 @@ The concrete procedure 3. Fetch raster data - This is done in the method startTileDecoders. There are a lot of parameters, maybe not all + This is done in the method ``startTileDecoders``. There are a lot of parameters, maybe not all are useful for a custom implementation. - Rectangle pixelDimension + ``Rectangle pixelDimension`` The requested size in pixel of the result image, perhaps not needed - GeneralEnvelope requestEnvelope + ``GeneralEnvelope requestEnvelope`` The requested size in world coordinates - ImageLevelInfo info + ``ImageLevelInfo info`` The info object of the pyramid to use - LinkedBlockingQueue tileQueue + ``LinkedBlockingQueue tileQueue`` Queue for holding tile queue elements - GridCoverageFactory coverageFactory + ``GridCoverageFactory coverageFactory`` perhaps not needed This method is responsible for 1. Fetching the tiles for the given level, the area covered may be larger than the area requested - in the requestEnvelope parameter. This is the minimum to implement. - 2. Additionally to 1. , mosiac the the tiles to one image. - 3. Additionally to 2. , crop the image according to the requestEnvelope param - 4. Additionally to 3, use the pixel dimension of the image and the pixelDimension parameter to + in the ``requestEnvelope`` parameter. This is the minimum to implement. + 2. Additionally to 1. , mosaic the tiles to one image. + 3. Additionally to 2. , crop the image according to the ``requestEnvelope`` parameters + 4. Additionally to 3, use the pixel dimension of the image and the ``pixelDimension`` parameter to rescale the image. The interesting construct is the tile queue and a tile queue element. Before this method is - called, a tile queue is created. Additionally an ImageComposerThread is created an started. This + called, a tile queue is created. Additionally an ``ImageComposerThread`` is created an started. This thread is responsible for creating the result image. Depending on the implementation possibilities described above, this thread is responsible to do the missing steps. As an example: - * if the custom implementation of startTileDecoders implements step 1 and 2, - * the ImageComposerThread will do the missing steps 3 and 4. + * if the custom implementation of ``startTileDecoders`` implements step 1 and 2, + * the ``ImageComposerThread`` will do the missing steps 3 and 4. - The primary job of the startTileDecoders method is to fetch the image data as fast as possible, + The primary job of the ``startTileDecoders`` method is to fetch the image data as fast as possible, creating on or more tile queue elements and put these elements into the queue. The - ImageCompoerThread starts working when the first element is in the queue. It stops working when + ``ImageComposerThread`` starts working when the first element is in the queue. It stops working when it reads a special END Element. A tile queue element for itself has * an optional name - * a BufferedImage object - * a GeneralEnvelope describing the the tile rectangle in world coordinates + * a ``BufferedImage`` object + * a ``GeneralEnvelope`` describing the the tile rectangle in world coordinates A code template:: @@ -158,13 +160,10 @@ The concrete procedure GridCoverageFactory coverageFactory) throws IOException { try { Connection con = getConnection(); - // getting the index of the level info object int level = getLevelInfos().indexOf(info); - // this example reads exactly one tile BufferedImage img = getBufferedImage(level, con); - GeneralEnvelope genv = new GeneralEnvelope(info.getCrs()); genv.setRange(0, info.getExtentMinX(), info.getExtentMaxX()); genv.setRange(1, info.getExtentMinY(), info.getExtentMaxY()); @@ -178,25 +177,25 @@ The concrete procedure tileQueue.add(TileQueueElement.ENDELEMENT); } - This is a simple template. A more complex implementation can be found in class JDBCAccessBase. + This is a simple template. A more complex implementation can be found in class ``JDBCAccessBase``. This implementation fetches tiles, starts decoder threads to utilize full CPU power, waits for all decoder threads to finish and sends the end element. HINT: Hurry up to bring your first tile queue element into the queue. - IMPORTANT: This method must be thread safe, do not modify instance vars or implement other + IMPORTANT: This method must be thread safe, do not modify instance variables or implement other actions causing problems under load. -The Config file -''''''''''''''' +The Configuration file +'''''''''''''''''''''' -Here is an example config file:: +Here is an example configuration file:: - + @@ -219,13 +218,13 @@ Here is an example config file:: Most elements are self explanatory, the detailed documentation is in Image Mosaicing Pyramidal JDBC Plugin -* The name attribute of the Element must be custom. -* The name attribute of the Element holds the class name of your implementation, org.mycompany.jdbc.MyJDBCAccessImpl in this example. +* The name attribute of the ```` Element must be custom. +* The name attribute of the ```` Element holds the class name of your implementation, ``org.mycompany.jdbc.MyJDBCAccessImpl`` in this example. Deployment '''''''''' -Package the Java class(es) in a jar file and copy this jar file to your classpath. +Package the Java classes in a jar file and copy this jar file to your classpath. Java Example '''''''''''' @@ -233,4 +232,3 @@ Java Example How to use the new coverage? Again, see at the end of Image Mosaicing Pyramidal JDBC Plugin. -Document generated by Confluence on Feb 16, 2011 06:43 \ No newline at end of file diff --git a/docs/user/library/coverage/jdbc/db2.rst b/docs/user/library/coverage/jdbc/db2.rst index e66c880d32a..4e8bc735236 100644 --- a/docs/user/library/coverage/jdbc/db2.rst +++ b/docs/user/library/coverage/jdbc/db2.rst @@ -3,7 +3,7 @@ Prepare db2 with spatial extender Preparing a db2 database needs the following steps: -1. After you created the db, use the db2se utility to do the following:: +1. After you created the db, use the ``db2se`` utility to do the following:: db2se enable_db db_name diff --git a/docs/user/library/coverage/jdbc/ddl.rst b/docs/user/library/coverage/jdbc/ddl.rst index a6f32227262..97e7c1104cb 100644 --- a/docs/user/library/coverage/jdbc/ddl.rst +++ b/docs/user/library/coverage/jdbc/ddl.rst @@ -8,45 +8,44 @@ Call Syntax:: Options: -* \-config - - The URL or the file name of your xml configuration +* ``-config`` + The URL or the file name of your XML configuration -* \-spatialTNPrefix - +* ``-spatialTNPrefix`` The Prefix of the spatial tables. A prefix of "SPAT" results in tables SPAT_0,SPAT_1,.... -* \-tileTNPrefix +* ``-tileTNPrefix`` The Prefix of the tile tables. Only needed if you plan to store image data in a separate table. -* \-pyramids +* ``-pyramids`` Number of pyramid tables -* \-statementDelim +* ``-statementDelim`` - The sql statement delimiter used in the scripts + The SQL statement delimiter used in the scripts -* \-srs +* ``-srs`` - The srs needed for a spatial extension. Not required for universal and mysql. + The SRS needed for a spatial extension. Not required for universal and MySQL. -* \-targetDir +* ``-targetDir`` The directory where to put the script templates. Generated Scripts ^^^^^^^^^^^^^^^^^ -createmeta.sql - The create table statement for the metatable +``createmeta.sql`` + The create table statement for the meta table -dropmeta.sql + ``dropmeta.sql`` The drop table statement for the meta table -add_.sql - All statements for adding a coverage named (taken from the config) + ``add_.sql`` + All statements for adding a coverage named (taken from the configuration) -remove_.sql - All statements for removing a coverage named (taken from the config) + ``remove_.sql`` + All statements for removing a coverage named (taken from the configuration + ) diff --git a/docs/user/library/coverage/jdbc/faq.rst b/docs/user/library/coverage/jdbc/faq.rst index 29d17000513..182e29aa6d0 100644 --- a/docs/user/library/coverage/jdbc/faq.rst +++ b/docs/user/library/coverage/jdbc/faq.rst @@ -6,23 +6,23 @@ Q: How to Build image pyramids and tiles? Creating the pyramids and tiles is not part of this module. -As a recommendation you can use gdal_retile which has been developed exactly for this requirement: +As a recommendation you can use ``gdal_retile`` which has been developed exactly for this requirement: * http://www.gdal.org/gdal_retile.html -A good idea is to download the fwtools containing gdal_retile.py: +A good idea is to download the ``fwtools`` containing ``gdal_retile.py``: * http://fwtools.maptools.org/. -The output of gdal_retile.py can be imported into the database with the import utility (described later). +The output of ``gdal_retile.py`` can be imported into the database with the import utility (described later). A good practice is to use a color table for your source image(s). Less memory consumption and a better performance are the results. If you have an already tiled source image, be sure that each -source tile uses the same color table, otherwise use gdal_merge.py (GDAL utility) to produce a big -single image and apply rgb2pct.py (GDAL utility). +source tile uses the same color table, otherwise use ``gdal_merge.py`` (GDAL utility) to produce a big +single image and apply ``rgb2pct.py`` (GDAL utility). Q: How to import the tiles and the georeferencing information? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Importing the data is database dependent. If you have a spatial extension, the gdal_retile.py utility -produces the proper world,shape or CSV files which you can import with a database utility. +Importing the data is database dependent. If you have a spatial extension, the ``gdal_retile.py`` utility +produces the proper world, shape or CSV files which you can import with a database utility. diff --git a/docs/user/library/coverage/jdbc/import.rst b/docs/user/library/coverage/jdbc/import.rst index 40514cd3bed..e31623f1f87 100644 --- a/docs/user/library/coverage/jdbc/import.rst +++ b/docs/user/library/coverage/jdbc/import.rst @@ -1,24 +1,25 @@ -Using the java import utility +Using the Java import utility ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The classpath for the utility is set in the manifest file of gt-imagemosiac-jdbc.jar, so you +The classpath for the utility is set in the manifest file of +``gt-imagemosiac-jdbc.jar``, so you do not need to bother about dependencies. -The only problem are the jdbc drivers for the the database. First you need to download the jar files. +The only problem are the JDBC drivers for the the database. First you need to download the jar files. * DB2 - We need db2jcc.jar and db2jcc_license.jar. Download from: + We need ``db2jcc.jar`` and ``db2jcc_license.jar``. Download from: https://www14.software.ibm.com/webapp/iwm/web/preLogin.do?lang=en_US&source=swg-idsjs11 * Oracle - We need ojdbc14.jar. Download from: + We need ``ojdbc14.jar``, download from: http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc9201.html -* Postgres +* Postgis http://jdbc.postgresql.org/download.html @@ -28,129 +29,134 @@ The only problem are the jdbc drivers for the the database. First you need to do * Other DB Systems - Google is your friend + Google is your friend. The problem is to put the jars in the classpath. According to the Sun documentation: * http://java.sun.com/j2se/1.5.0/docs/tooldocs/findingclasses.html - a class path in a manifest overrides the CLASSPATH environment variable and the -cp or - -classpath java option. + a class path in a manifest overrides the CLASSPATH environment variable and + the ``-cp`` or + ``-classpath`` java option. Solutions: -* A solution is to copy the jar files into /lib/ext of your java runtime. In this case the extension +* A solution is to copy the jar files into ``/lib/ext`` of your java runtime. In this case the extension class loader is responsible to load your jdbc drivers. -* Another approach is to investigate into the -X options of your java - runimte. java -X gives help. if there is an option -Xbootclasspath/a: you can avoid copying the - jdbc jar file into the /lib/ext directory and call "java -Xbootclasspath/a: -jar ...." +* Another approach is to investigate into the ``-X`` options of your java + runtime. java ``-X`` gives help. if there is an option ``-Xbootclasspath/a:`` you can avoid copying the + jdbc jar file into the /lib/ext directory and call ``java -Xbootclasspath/a: -jar ....`` Call Syntax ''''''''''' Common options: -* -config +* ``-config`` - the URL or the file name of the xml config file , e.g "file:/temp/mymap.xml" + the URL or the file name of the XML configuration file , e.g ``file:/temp/mymap.xml`` -* -commitCount +* ``-commitCount`` (optional), default 100, insert records in chunks to improve performance -Importing excactly one level +Importing exactly one level -* -spatialTN +* ``-spatialTN`` the name of the spatial table which must already exist -* -tileTN +* ``-tileTN`` the name of the tile table which must already exist. When using a joined table, the tile table name has to be equal to the spatial table name -Importing all tiles including the pyramids as produced by gdal_retile.py +Importing all tiles including the pyramids as produced by ``gdal_retile.py`` -* -spatialTNPrefix +* ``-spatialTNPrefix`` the prefix of spatial table names (produced by the ddl generation utility) -* -tileTNPrefix + +* ``-tileTNPrefix`` the prefix of tiles table names (produced by the ddl generation utility) -To import the output of gdal_retile.py using world files (one level):: +To import the output of ``gdal_retile.p`` using world files (one level):: java -jar gt-imagemosaic-jdbc.jar import -config URLOrFileName -spatialTN spatialTableName -tileTN tileTableName [-commitCount commitCount] -dir dir -ext extension -To import the output of gdal_retile.py using world files (all levels):: +To import the output of ``gdal_retile.py`` using world files (all levels):: java -jar gt-imagemosaic-jdbc.jar import -config URLOrFileName -spatialTNPrefix spatialTableNamePrefix -tileTNPrefix tileTableNamePrefix [-commitCount commitCount] -dir dir -ext extension Options -* -dir +* ``-dir`` The directory containing tiles -* -ext + +* ``-ext`` - The file extension (png,jpg,tif,..). The extension must have exactly 3 chars. The world files - must have an extension of "wld" or an extension according to the standard for building word files - (removing the 2. character and appending a 'w'). + The file extension (``png``, ``jpg``, ``tif``,..). The extension must have exactly 3 chars. The world files + must have an extension of "``wld``" or an extension according to the standard for building word files + (removing the 2 character and appending a 'w'). - image.tif -> image.tfw, image.png -> image.pgw,.... + ``image.tif -> image.tfw``, ``image.png -> image.pgw``,.... -To import the output of gdal_retile.py using a shape file (one level):: +To import the output of ``gdal_retile.py`` using a shape file (one level):: java -jar gt-imagemosaic-jdbc.jar import -config URLOrFileName -spatialTN spatialTableName -tileTN tileTableName [-commitCount commitCount] -shape shapeURLOrFileName -shapeKeyField shapeKeyField -To import the output of gdal_retile.py using a shape file (all levels):: +To import the output of ``gdal_retile.py`` using a shape file (all levels):: java -jar gt-imagemosaic-jdbc.jar import -config URLOrFileName -spatialTNPrefix spatialTableNamePrefix -tileTNPrefix tileTableNamePrefix [-commitCount commitCount] -shape shapeURLOrFileName -shapeKeyField shapeKeyField Options -* -shape +* ``-shape`` the URL or the file name of the shape file , e.g "file:/temp/index.shp" -* -shapeKeyField + +* ``-shapeKeyField`` the name of the attribute in the shape file holding the file names for the tiles -To import the output of gdal_retile.py using a csv file (one level):: +To import the output of ``gdal_retile.py`` using a CSV file (one level):: java -jar gt-imagemosaic-jdbc.jar import -config URLOrFileName -spatialTN spatialTableName -tileTN tileTableName [-commitCount commitCount] -csv csvURLOrFileName -csvDelim csvDelim -To import the output of gdal_retile.py using a csv file (all levels):: +To import the output of ``gdal_retile.p`` using a CSV file (all levels):: java -jar gt-imagemosaic-jdbc.jar import -config URLOrFileName -spatialTNPrefix spatialTableNamePrefix -tileTNPrefix tileTableNamePrefix [-commitCount commitCount] -csv csvURLOrFileName -csvDelim csvDelim Options -* -csv +* ``-csv`` - the URL or the file name of the csv file , e.g "file:/temp/index.csv" -* -csvDelim + the URL or the file name of the CSV file , e.g "``file:/temp/index.csv``" + +* ``-csvDelim`` - The column delimiter in the csv file. + The column delimiter in the CSV file. -The csv file has exactly 5 columns. +The CSV file has exactly 5 columns. 1. Filename of the tile -2. minx -3. maxx -4. miny -5. maxy +2. ``minx`` +3. ``maxx`` +4. ``miny`` +5. ``maxy`` -Ensure using a point as decimal separator and do not use grouping speparators for the -coordinates. "12345.6789" is ok, "12.345,6789" is not supported. +Ensure using a point as decimal separator and do not use grouping separators for the +coordinates. "12345.6789" is OK, "12.345,6789" is not supported. -A csv example:: +A CSV example:: oek4000_1_1.tif;109546.250000;429601.536800;333297.122340;573436.750000 oek4000_1_2.tif;429601.536800;688046.180892;333297.122340;573436.750000 diff --git a/docs/user/library/coverage/jdbc/index.rst b/docs/user/library/coverage/jdbc/index.rst index 9fc4a518c04..87cc9127be2 100644 --- a/docs/user/library/coverage/jdbc/index.rst +++ b/docs/user/library/coverage/jdbc/index.rst @@ -3,10 +3,10 @@ Image Mosaic JDBC ----------------- -This **gt-imagemosaic-jdbc** plugin is intended to handle large images stored as tiles in a JDBC +This ``gt-imagemosaic-jdbc`` plugin is intended to handle large images stored as tiles in a JDBC database. Tiles created by pyramids are also stored in the database. The utility uses the indexing -of databases to speed up access to the requested tiles, the plugin for itself has a multithreaded -architecture to make use of dual/quad core CPUs and multiprocessor systems. +of databases to speed up access to the requested tiles, the plugin for itself has a multi-threaded +architecture to make use of dual/quad core CPUs and multi-processor systems. .. sidebar:: Details @@ -26,14 +26,15 @@ This plugin should give you the possibility to handle large images with their py Credits: -* This module was funded by Google as part of the GSOC 08 program. +* This module was funded by Google as part of the Google Summer of Code + 2008 program. Tested Database Systems * DB2 (with or without Spatial Extender) * Oracle (with or without Location Based Services, Oracle Spatial not needed) * MySql -* Postgres (with or without Postgis) +* PostgreSQL (with or without Postgis) * H2 Example Use @@ -83,7 +84,7 @@ Mapping of table and attribute names Since there a lot of naming conventions in different enterprises, it is not ideal to force the use of predefined table and attribute names. In our example, the names of the spatial and tile tables is selectable, the name of the meta table and all the attribute names were assumed. The mapping of these names is part of the XML configuration. The corresponding XML fragment shows the mapping of the assumed names. -A sample XML fragment file **mapping.xml.inc**:: +A sample XML fragment file ``mapping.xml.inc``:: @@ -115,21 +116,22 @@ A sample XML fragment file **mapping.xml.inc**:: The structure of this XML Fragment is kept very simple, use it as a pattern. -The name attribute of the has to be one of the following values +The name attribute of the ```` has to be one of the following values -* universal (a vendor neutral JDBC approach which should work with any JDBC database with BLOB support) -* db2 (use spatial extender) -* mysql (use the spatial features of mysql) -* postgis (use the spatial features of postgis) +* ``universal`` (a vendor neutral JDBC approach which should work with any JDBC database with BLOB support) +* ``db2`` (use spatial extender) +* ``mysql`` (use the spatial features of MySQL) +* ``postgis`` (use the spatial features of Postgis) * oracle (use location based services included in every oracle edition, no oracle spatial needed !!!) -If your spatial extension is universal you need to specify ,,,, but you can omit . +If your spatial extension is universal you need to specify ````, +````, ````, ````, but you can omit ````. -In all other cases, you need the Element and can omit ,,,. +In all other cases, you need the ```` Element and can omit ````, ````, ````, ````. Be careful with the case sensitivity of different DBMS products. Look here http://www.alberton.info/dbms_identifiers_and_case_sensitivity.html and here http://en.wikibooks.org/wiki/SQL_dialects_reference/Data_structure_definition/Delimited_identifiers. -In the above example, we have which will result in an attribute name of MAXX for DB2 and Oracle, but maxx for postgres. A good strategy would be to use identifiers (table and attribute Names ) consisting of uppercase /lowercase letters, depending on your DBMS. +In the above example, we have ```` which will result in an attribute name of ``MAXX`` for DB2 and Oracle, but ``maxx`` for PostgreSQL. A good strategy would be to use identifiers (table and attribute Names ) consisting of upper case /lower case letters, depending on your DBMS. This approach assures that there are no predefined table and attribute names, allowing seamless integration into existing naming conventions. @@ -145,9 +147,13 @@ Each Map with its pyramids is configured by an XML File. The Configuration can b JDBC Connect configuration ^^^^^^^^^^^^^^^^^^^^^^^^^^ -Dependent on the deployment environment, there are different possibilities for connection to the database. Using this plugin in a client java application will require a JDBC Driver Connect, operation within a J2EE Container should prefer a JNDI Datasource connect (your admin will be happy) . +Dependent on the deployment environment, there are different possibilities +for connection to the database. Using this plugin in a client Java +application will require a JDBC Driver Connect, operation within a J2EE +Container should prefer a JNDI data source connect (your admin will be +happy) . -A sample XML fragment file for a JDBC Driver Connection to the H2 database **connect.xml.inc**:: +A sample XML fragment file for a JDBC Driver Connection to the H2 database ``connect.xml.inc``:: @@ -159,7 +165,7 @@ A sample XML fragment file for a JDBC Driver Connection to the H2 database **con -XML Fragment for connection to a JNDI Datasource **connect.xml.inc**:: +XML Fragment for connection to a JNDI data source ``connect.xml.inc``:: @@ -169,9 +175,10 @@ XML Fragment for connection to a JNDI Datasource **connect.xml.inc**:: Map Configuration ^^^^^^^^^^^^^^^^^ -Now we can put the things together and create the config file for a map. +Now we can put the things together and create the configuration +file for a map. -Example file map.xml:: +Example file ``map.xml``:: - + @@ -191,28 +198,36 @@ Example file map.xml:: &connect; -The DOCTYPE includes two XML entity references to the connect.xml.inc and mapping.xml.inc. The XML parser includes these fragments at parsing time. +The ``DOCTYPE`` includes two XML entity references to the ``connect.xml.inc`` +and ``mapping.xml.inc``. The XML parser includes these fragments at parsing time. Elements: -config +``config`` The root element. The version attribute is reserved for future versions of this plugin. Must be "1.0." -coverageName +``coverageName`` The name of your map. This name is used for searching the meta data in the meta table. -coordsys - The name of a coordinate reference system, will be referenced by CRS.decode() of the geotools library. +``coordsys`` + The name of a coordinate reference system, will be referenced by ``CRS.decode()`` + of the GeoTools + library. -scaleop - The interpolation method to use (1 = nearest neighbour, 2 = bipolar, 3 = bicubic) +``scaleop`` + The interpolation method to use (1 = ``nearest neighbor``, 2 = ``bipolar``, 3 = ``bicubic``) -axisOrder +``axisOrder`` The module compares the CRS from the read request to the CRS stored in the configuration. If the axis order differ, an x axis switch is performed. Some clients are doing this before calling the module and the plugin switches again resulting in the original envelope. A value of "true" suppresses this switch. -verify - if you have image data and georeferencing information in different tables and the the attribute cardinality is true , the plugin will check the number of records in each table. If the numbers are not equal, the image/pyramid will be removed and you see a warning in the log. This check is intended for testing environments, set the value to false in production environments to avoid bad performance. +``verify`` + if you have image data and georeferencing information in different + tables and the attribute cardinality is true , the plugin will + check the number of records in each table. If the numbers are not + equal, the image/pyramid will be removed and you see a warning in the + log. This check is intended for testing environments, set the value + to false in production environments to avoid bad performance. **Configuration Summary** diff --git a/docs/user/library/coverage/jdbc/internal.rst b/docs/user/library/coverage/jdbc/internal.rst index 51ab4d06b95..b7840bc0803 100644 --- a/docs/user/library/coverage/jdbc/internal.rst +++ b/docs/user/library/coverage/jdbc/internal.rst @@ -1,11 +1,11 @@ Image Mosaic JDBC Design ------------------------- +------------------------- -Outline of the multithreaded architecture -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Outline of the multi-threaded architecture +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The multithreaded architecture is based on synchronized Queue available since SDK 5.0. The following threads will be used: +The multi-threaded architecture is based on synchronized Queue available since SDK 5.0. The following threads will be used: * One ImageComposer thread which reads GridCoverages from the Queue, mosaicing the image and finally rescales the image for the requested dimension. * For each tile, a TileDecoder thread which decodes the tile, crops the tile if necessary and puts the result as GridCoverage in the queue. @@ -20,7 +20,7 @@ If the requested CRS is not equal to the CRS of the tiles, transform the request 4. Wait for all ImageDecoder Threads 5. Put a predefined End Message in the queue which causes the ImageComposer Thread to finish its work 6. Wait for the ImageComposer Thread -7. If the requested CRS ist not equal to the CRS of the tiles, reproject the image +7. If the requested CRS is not equal to the CRS of the tiles, reproject the image 8. Return the GridCoverage Database Design @@ -28,44 +28,44 @@ Database Design First, we need a Meta Table for holding Information for each pyramid of the maps. This table has 9 columns as described below -* Name (String): The name of the map -* SpatialTable (String): The name of the table where to find the georeferencing information -* TileTable (String): The name of the table where to find the tile data stored as BLOB. -* ResX (Double): The resolution of the x-axis -* ResY (Double): The resolution of the y-axis -* MinX (Double): The minimum X of the extent -* MinY (Double): The minimum Y of the extent -* MaxX (Double): The maximum X of the extent -* MaxY(Double): The maximum Y of the extent +* ``Name`` (String): The name of the map +* ``SpatialTable`` (String): The name of the table where to find the georeferencing information +* ``TileTable`` (String): The name of the table where to find the tile data stored as BLOB. +* ``ResX`` (Double): The resolution of the x-axis +* ``ResY`` (Double): The resolution of the y-axis +* ``MinX`` (Double): The minimum X of the extent +* ``MinY`` (Double): The minimum Y of the extent +* ``MaxX`` (Double): The maximum X of the extent +* ``MaxY`` (Double): The maximum Y of the extent **Important** -The only fields you have to fill are Name,SpatialTable and TileTable. These three fields together are the primary key. All other fields will be calculated by the plugin. It is not necessary to do calculations. The plugin implements the following mechanism during the first request: +The only fields you have to fill are ``Name``, ``SpatialTable`` and ``TileTable``. These three fields together are the primary key. All other fields will be calculated by the plugin. It is not necessary to do calculations. The plugin implements the following mechanism during the first request: -1. Check if ResX or ResY is null, if true, calculate the values from a random chosen tile from the corresponding tile table. -2. Check if one of MinX,MinY,MaxX,MaxY is null, if true, calculate the values from the corresponding spatial table. -3. If something has been calculated, store these values into to db to avoid recalculation at the next restart +1. Check if ``ResX`` or ``ResY`` is null, if true, calculate the values from a random chosen tile from the corresponding tile table. +2. Check if one of ``MinX``, ``MinY``, ``MaxX``, ``MaxY`` is null, if true, calculate the values from the corresponding spatial table. +3. If something has been calculated, store these values into to the database to avoid recalculation at the next restart -This approach assures that the probably costly calculation is only executed once, but updating,adding or removing tiles requires you to nullify one of the MinX,MinY,MaxX,MaxY Attributes to force a new extent calculation. +This approach assures that the probably costly calculation is only executed once, but updating,adding or removing tiles requires you to nullify one of the ``MinX``, ``MinY``, ``MaxX``, ``MaxY`` attributes to force a new extent calculation. **First example** Assume we have a Map called Europe with 2 Pyramids. Since we have 3 levels, we need 3 tile tables and 3 spatial tables. Lets start filling the META table. -====== ============= ========== ===== ===== ===== ===== ===== ===== -Name SpatialTable TileTable ResX ResY MinX MinY MaxX MaxY -====== ============= ========== ===== ===== ===== ===== ===== ===== -Europe EUSPAT0 EUTILE0 . . . . . . -Europe EUSPAT1 EUTILE1 . . . . . . -Europe EUSPAT2 EUTILE2 . . . . . . -====== ============= ========== ===== ===== ===== ===== ===== ===== +======== ================ ============= ======== ======== ======== ======== ======== ======== +``Name`` ``SpatialTable`` ``TileTable`` ``ResX`` ``ResY`` ``MinX`` ``MinY`` ``MaxX`` ``MaxY`` +======== ================ ============= ======== ======== ======== ======== ======== ======== +Europe EUSPAT0 EUTILE0 . . . . . . +Europe EUSPAT1 EUTILE1 . . . . . . +Europe EUSPAT2 EUTILE2 . . . . . . +======== ================ ============= ======== ======== ======== ======== ======== ======== Remember: You do not have to fill the other attributes. A tile table needs the following attributes: * Location (String) : A unique identifier for the tile -* Data (Blob) : The image data (Encoded in a format readable by JAI, e. g. png,jpeg,...) +* Data (Blob) : The image data (Encoded in a format readable by JAI, e.g. ``png``, ``jpeg``,...) The table EUTILE0 for example ( 0x.... indicates binary data) @@ -83,25 +83,25 @@ A spatial table contains the georeferencing information. Depending on your datab A spatial Table without using a spatial extension needs the following attributes: -* Location (String) : A unique identifier used for joining into the tiles table -* MinX (Double): min x of the tile extent -* MinY (Double): min y of the tile extent -* MaxX (Double): max x of the tile extent -* MaxY (Double): max y of the tile extent +* ``Location`` (String) : A unique identifier used for joining into the tiles table +* ``MinX`` (Double): minimum X of the tile extent +* ``MinY`` (Double): minimum Y of the tile extent +* ``MaxX`` (Double): maximum X of the tile extent +* ``MaxY`` (Double): maximum Y of the tile extent The table EUSPAT0 for example. -=========== ===== ===== ===== ===== -Location MinX MinY MaxX MaxY -=========== ===== ===== ===== ===== -Tile_1_1 10 10 20 20 -Tile_1_2 20 10 30 20 -=========== ===== ===== ===== ===== +=============== ========= ========= ========= ========= +``Location`` ``MinX`` ``MinY`` ``MaxX`` ``MaxY`` +=============== ========= ========= ========= ========= +Tile_1_1 10 10 20 20 +Tile_1_2 20 10 30 20 +=============== ========= ========= ========= ========= A spatial Table using a spatial extension needs the following attributes: -* Location (String) : A unique identifier used for joining into the tiles table -* Geometry (Geometry): A Multipolygon type provided by your db +* ``Location`` (String) : A unique identifier used for joining into the tiles table +* ``Geometry`` (Geometry): A multi-polygon type provided by your database. The table EUTILE0 for example @@ -116,33 +116,33 @@ Reducing the number of tables Since the number of rows in a spatial table has to be equal to the number of rows in a tile table, there is a one to one relationship. It is no problem to join these tables. Applying this redesign to our samples results in the following table structure: -====== ============= ========== ===== ===== ===== ===== ===== ===== -Name SpatialTable TileTable ResX ResY MinX MinY MaxX MaxY -====== ============= ========== ===== ===== ===== ===== ===== ===== -Europe EU0 EU0 . . . . . . -Europe EU1 EU1 . . . . . . -Europe EU2 EU2 . . . . . . -====== ============= ========== ===== ===== ===== ===== ===== ===== +========== ================= ============== ========= ========= ========= ========= ========= ========= +``Name`` ``SpatialTable`` ``TileTable`` ``ResX`` ``ResY`` ``MinX`` ``MinY`` ``MaxX`` ``MaxY`` +========== ================= ============== ========= ========= ========= ========= ========= ========= +Europe EU0 EU0 . . . . . . +Europe EU1 EU1 . . . . . . +Europe EU2 EU2 . . . . . . +========== ================= ============== ========= ========= ========= ========= ========= ========= The EU0 Table -========== ===== ===== ===== ===== ========== -Location MinX MinY MaxX MaxY Data -========== ===== ===== ===== ===== ========== -Tile_1_1 10 10 20 20 0x10011.. -Tile_1_2 20 10 30 20 0x00011.. -========== ===== ===== ===== ===== ========== +============== ========= ========= ========= ========= ============== +``Location`` ``MinX`` ``MinY`` ``MaxX`` ``MaxY`` ``Data`` +============== ========= ========= ========= ========= ============== +Tile_1_1 10 10 20 20 0x10011.. +Tile_1_2 20 10 30 20 0x00011.. +============== ========= ========= ========= ========= ============== or using a geometry column -========== =========== ============ -Location Geom Data -========== =========== ============ -Tile_1_1 0x00111... 0x10011.. -Tile_1_2 0x10011... 0x00011.. -========== =========== ============ +============== =============== ================ +``Location`` ``Geom`` ``Data`` +============== =============== ================ +Tile_1_1 0x00111... 0x10011.. +Tile_1_2 0x10011... 0x00011.. +============== =============== ================ -Further DB Design Rules +Further Database Design Rules * It is possible to add custom columns to your tables * It is possible to create one meta table for all your maps and pyramid levels , or create one meta table for each map containing records for the map and its pyramids, or do any mixture of these two approaches, the only rule is to store a map and its pyramids level together in the same meta table. diff --git a/docs/user/library/coverage/jdbc/jdbc.rst b/docs/user/library/coverage/jdbc/jdbc.rst index b1c53b62695..57b581c10f5 100644 --- a/docs/user/library/coverage/jdbc/jdbc.rst +++ b/docs/user/library/coverage/jdbc/jdbc.rst @@ -3,7 +3,8 @@ Prepare a jdbc database For each image level we have to create a spatial and a tiles table, or a joined table. -Attention: The syntax may differ depending on your used database. For postgres use FLOAT8 instead of DOUBLE and BYTEA instead of BLOB +Attention: The syntax may differ depending on your used database. For PostgreSQL +use FLOAT8 instead of DOUBLE and BYTEA instead of BLOB 1. The tile table :: diff --git a/docs/user/library/coverage/jdbc/mysql.rst b/docs/user/library/coverage/jdbc/mysql.rst index 7cbe5d26004..42b535d98e1 100644 --- a/docs/user/library/coverage/jdbc/mysql.rst +++ b/docs/user/library/coverage/jdbc/mysql.rst @@ -1,4 +1,4 @@ -Prepare for mysql +Prepare for MySQL ----------------- 1. Create the tile table:: diff --git a/docs/user/library/coverage/jdbc/performance.rst b/docs/user/library/coverage/jdbc/performance.rst index 3dcc59038a9..39b85404e66 100644 --- a/docs/user/library/coverage/jdbc/performance.rst +++ b/docs/user/library/coverage/jdbc/performance.rst @@ -7,7 +7,7 @@ Universal ''''''''' Here is a proposal if you have more tiles in the x direction than in the y direction. If the -opposite is true, switch Minx / Miny and Max/ Maxy:: +opposite is true, switch ``Minx`` / ``Miny`` and ``Maxx``/ ``Maxy``:: CREATE INDEX IX_SPATIAL0_1 ON SPATIAL0(MinX,MinY) CREATE INDEX IX_SPATIAL0_2 ON SPATIAL0(MaxX,MaxY) @@ -15,7 +15,7 @@ opposite is true, switch Minx / Miny and Max/ Maxy:: DB2 Spatial Extender '''''''''''''''''''' -Use gseidx utility (ADVISE) to get a proposal for the last 3 parameters (grid sizes):: +Use ``gseidx`` utility (ADVISE) to get a proposal for the last 3 parameters (grid sizes):: CREATE INDEX IX_SPATIAL0 ON SPATIAL0(GEOM) EXTEND USING db2gse.spatial_index (10000.0, 100000.0, 1000000.0) diff --git a/docs/user/library/coverage/jdbc/postgis.rst b/docs/user/library/coverage/jdbc/postgis.rst index 1da34b4d535..ad8aa982e89 100644 --- a/docs/user/library/coverage/jdbc/postgis.rst +++ b/docs/user/library/coverage/jdbc/postgis.rst @@ -1,4 +1,4 @@ -Prepare for postgis +Prepare for PostGIS ------------------- 1. Install PostGIS @@ -7,7 +7,7 @@ Prepare for postgis * http://www.postgis.org/docs/ch02.html -2. Spatially enabling a postgres db needs the following steps from the command line:: +2. Spatially enabling a PostgreSQL database needs the following steps from the command line:: createlang plpgsql [yourdatabase] psql -d [yourdatabase] -f lwpostgis.sql diff --git a/docs/user/library/coverage/jdbc/prepare.rst b/docs/user/library/coverage/jdbc/prepare.rst index 2170c467338..2d56750994c 100644 --- a/docs/user/library/coverage/jdbc/prepare.rst +++ b/docs/user/library/coverage/jdbc/prepare.rst @@ -3,16 +3,17 @@ Prepare with gdal_retile **Introduction to gdal_retily.py** -Attention: These examples were executed on a linux, box, if you have a Microsoft platform, you must change your path names. -Additionally, the executable is gdal_retile.bat instead of gdal_retile.py +Attention: These examples were executed on a Linux, box, if you have a Microsoft platform, you must change your path names. +Additionally, the executable is ``gdal_retile.bat`` instead of +``gdal_retile.py``. -The following examples assume we have a big image called big.tif. +The following examples assume we have a big image called ``big.tif``. * First simple example:: gdal_retile.py -targetDir /tmp/test big.tif - Result: In the directory /temp/test are many georeferenced tiles, pixelsize 256x256, which will mosaic to the original image. + Result: In the directory ``/tmp/test`` are many georeferenced tiles, pixelsize 256x256, which will mosaic to the original image. * Example of specific size:: @@ -28,13 +29,13 @@ The following examples assume we have a big image called big.tif. gdal_retile.py -levels 3 -ps 512 512 -targetDir /tmp/test big.tif - Result: There are 3 additional subdirectories /tmp/test/1,/tmp/test/2,/tmp/test/3 containing the tiles for 3 pyramid levels. + Result: There are 3 additional subdirectories ``/tmp/test/1``, ``/tmp/test/2``, ``/tmp/test/3`` containing the tiles for 3 pyramid levels. -* If we have already a set of tiles (\*.tif) and need only the tiled pyramids:: +* If we have already a set of tiles (``*.tif``) and need only the tiled pyramids:: gdal_retile.py -levels 3 -pyramidOnly -ps 512 512 -targetDir /tmp/test *.tif -* If we have already a set of tiles (\*.tif or \*.png or ...) and need to retile and to build pyramids:: +* If we have already a set of tiles (``*.tif`` or ``*.png``) and need to retile and to build pyramids:: gdal_retile.py -levels 3 -ps 512 512 -targetDir /tmp/test *.tif @@ -42,9 +43,9 @@ The following examples assume we have a big image called big.tif. Common problems: -* If you have many tiles , the \*.tif pattern could result in a "command line buffer exceeded" error. This is not a problem of the utility. +* If you have many tiles , the ``*.tif`` pattern could result in a "command line buffer exceeded" error. This is not a problem of the utility. - In this situation you have to create a file listing all the tif files with absolute path names (Lets call it tilelist.txt ) + In this situation you have to create a file listing all the TIF files with absolute path names (Lets call it ``tilelist.txt``) and then change the above command to:: gdal_retile.py -levels 3 -ps 512 512 -targetDir /tmp/test --optfile tilelist.txt @@ -59,14 +60,14 @@ Now we can decide how to prepare the georeferencing information: This produces a csv file for for each image level. - * The csv has 5 columns: filename,minx,maxx,miny,maxy. + * The csv has 5 columns: ``filename``, ``minx``, ``maxx``, ``miny``, ``maxy``. * Each record describes the georeferencing information for a tile. * Exporting the georeferencing information into a shape file:: gdal_retile.py -levels 3 -ps 512 512 -tileIndex index.shp -tileIndexField LOCATION -targetDir /tmp/test --optfile tilelist.txt - This produces shape files named index.shp with a geometry attribute LOCATION. + This produces shape files named ``index.shp`` with a geometry attribute ``LOCATION``. Use http://www.gdal.org/ogr/ogrinfo.html to check the content. * Exporting the georeferencing information into world files:: diff --git a/docs/user/library/coverage/jdbc/setup.rst b/docs/user/library/coverage/jdbc/setup.rst index 956b426b153..18802f6198e 100644 --- a/docs/user/library/coverage/jdbc/setup.rst +++ b/docs/user/library/coverage/jdbc/setup.rst @@ -5,8 +5,8 @@ Setup Example Prepare your image data in advance. The size of the images has a big influence on performance. - Here, we are not talking about the size of an encoded image (jpeg,png), the size of the decoded - image requesting java heap memory is interesting. + Here, we are not talking about the size of an encoded image (``jpeg``, ``png``), the size of the decoded + image requesting Java heap memory is interesting. * One of the best possibilities is to use an image with one band and an indexed color table. * A not so good solution is using a RGBA image needing four bands and requesting 3-4 times more @@ -26,8 +26,8 @@ Setup Example 2. The next step is to create the table for the meta info. - Attention: All the table and attribute names have to correspond to the xml mapping fragment, - otherwise the plugin will not work. If there is a valid xml config, you can use the following + Attention: All the table and attribute names have to correspond to the XML mapping fragment, + otherwise the plugin will not work. If there is a valid XML configuration, you can use the following utility to create ddl script templates. .. toctree:: @@ -47,7 +47,7 @@ Setup Example * The other options are dedicated to selected databases using their spatial extension. - The spatialExtension element in the xml mapping fragment is used to specify the option to use. + The ``spatialExtension`` element in the XML mapping fragment is used to specify the option to use. .. toctree:: :maxdepth: 1 diff --git a/docs/user/library/coverage/jp2k.rst b/docs/user/library/coverage/jp2k.rst index c10e399fd1c..45f97c677b3 100644 --- a/docs/user/library/coverage/jp2k.rst +++ b/docs/user/library/coverage/jp2k.rst @@ -3,7 +3,7 @@ JP2K Plugin The JP2K plug-in allows GeoTools to make use of the JP2K format provided via the available JP2K image readers in the JAI ImageIO project plus an optional ImageIO plugin based on the Kakadu -library which is activated only when the Kakadu SDK is in the path (the Kakakdu SDK is not +library which is activated only when the Kakadu SDK is in the path (the Kakadu SDK is not Open Source but it comes with a variety of licenses). Notice that: @@ -24,17 +24,18 @@ Use of Kakadu Much better performances in accessing JP2K data with respect to standard JAI ImageIO and GDAL supported SDKs are obtained by directly using the Kakadu libraries in this plugin. Please, note that the Image I/O-Ext project contains also a plug-in built on top of GDAL which in turn uses Kakadu as well, however this new plugin does not need GDAL but only the Kakadu binaries. -In order to know how to build your Kakadu native libs needed to enable support for it, please, check the imageio-ext setup guide. If your Java Runtime Environment includes the Kakadu native libraries, you will be able to support the JP2K format by means of this plugin, otherwise the JP2K format data access capabilities will be provided by the SUN's ImageIO JP2K plugin. The plugin, when Kakadu is in the path, is able to parse georeferencing information by supporting the following mechanisms: +In order to know how to build your Kakadu native libraries +needed to enable support for it, please, check the ``imageio-ext`` setup guide. If your Java Runtime Environment includes the Kakadu native libraries, you will be able to support the JP2K format by means of this plugin, otherwise the JP2K format data access capabilities will be provided by the SUN's ImageIO JP2K plugin. The plugin, when Kakadu is in the path, is able to parse georeferencing information by supporting the following mechanisms: 1. World File + PRJ File (they take precedence over the other mechanism and therefore they can be used to override missing or improper georeferencing). 2. Degenerate GeoTIFF Box (seems that the wording GeoJP2 cannot be used for licensing problems, but that is essentially how everybody calls this box) -3. MSIG WorldFile Box (if presents), contained within propers UUID boxes. +3. MSIG WorldFile Box (if present), contained within proper UUID boxes. Notes: * This plugin allows to override the georeferencing information as it is obtained from the internal supported JP2K Boxes. This means that if the CRS is missing - and/or incorrect you can ovveride it via providing a PRJ file (filename.prj); + and/or incorrect you can override it via providing a projection file (``filename.prj``); on the same line, if you want to override the grid to world transformation you can do that via providing a world file(filename.j2w, filename.wld). * Notice that at this time, no GMLJP2 support has been implemented even though that @@ -44,27 +45,27 @@ Notes: Standard JP2K readers -In case you will use the SUN's ImageIO JP2K plugins (as an instance, in case you don't have a copy of the Kakadu software), we have not yet implemented full support to the georeferencing information contained within the JP2K metadata. For this reason, you need to add a PRJ and a WorldFile (J2W file or WLD file) beside your JP2K dataset, in case you want to be able to serve it as a geospatial dataset. +In case you will use the SUN's ImageIO JP2K plugins (as an instance, in case you don't have a copy of the Kakadu software), we have not yet implemented full support to the georeferencing information contained within the JP2K metadata. For this reason, you need to add a PRJ and a WorldFile (J2W file or WLD file) beside your JP2K data set, in case you want to be able to serve it as a geospatial data set. Format parameters A set of parameters allows to customize the way the coverage will be accessed: -InputTransparentColor +``InputTransparentColor`` Set the transparent color for the image -USE_JAI_IMAGEREAD +``USE_JAI_IMAGEREAD`` Controls the low level mechanism to read the granules. If ‘true’ the plugin will make use of JAI ImageRead operation and its deferred loading mechanism, if ‘false’ it will perform direct ImageIO read calls which will result in immediate loading. -USE_MULTITHREADING - if ‘true’, the plugin will use a version of the JAI ImageRead with support for multithreading loading. +``USE_MULTITHREADING`` + if ‘true’, the plugin will use a version of the JAI ImageRead with support for multi-threading loading. -SUGGESTED_TILE_SIZE +``SUGGESTED_TILE_SIZE`` Controls the tile size of the input images when using tiled read. It consists of two positive integers separated by a comma, like 512,512. **Code Example** -Here below we have added some code to show how to interact with the plugin to read JP2K data as GridCoverage2D. There is not much difference between this code and the code to interact with, let's say, a GeoTiff.:: +Here below we have added some code to show how to interact with the plugin to read JP2K data as ``GridCoverage2D``. There is not much difference between this code and the code to interact with, let's say, a GeoTiff.:: final File file = new File ("/home/simone/data/geosolutions.jp2"); final JP2KReader reader = new JP2KReader (file); diff --git a/docs/user/library/coverage/matlab.rst b/docs/user/library/coverage/matlab.rst index 2e4aa0c1c80..94b8b004df3 100644 --- a/docs/user/library/coverage/matlab.rst +++ b/docs/user/library/coverage/matlab.rst @@ -1,7 +1,7 @@ Matlab Plugin ------------- -Unsupported plugin to read SAS matlab files with georeferencing information. +Unsupported plugin to read SAS Matlab files with georeferencing information. No documentation has been provided. diff --git a/docs/user/library/coverage/mosaic.rst b/docs/user/library/coverage/mosaic.rst index 7a847d09281..1a1fd53b276 100644 --- a/docs/user/library/coverage/mosaic.rst +++ b/docs/user/library/coverage/mosaic.rst @@ -44,7 +44,7 @@ An example data set looks something like:: The property file is REQUIRED and use to provide a bunch of settings: - Example bluemarble.properties:: + Example ``bluemarble.properties``:: # #Thu Jan 11 14:53:30 CET 2007 @@ -58,22 +58,23 @@ An example data set looks something like:: Where the following are required: * Name - * ExpandToRGB: true if we need to expand the color model from indexed to rgba + * ``ExpandToRGB``: true if we need to expand the color model from indexed to + ``rgba`` * If all your images use the same indexed palette you can set this to false and get a large performance gain - * Levels: list of resolutions + * ``Levels``: list of resolutions - * Format: level_0_x_resolution, level_0_y_resolution, level_1_x_resolution, + * ``Format``: level_0_x_resolution, level_0_y_resolution, level_1_x_resolution, level_1_y_resolution * This measure of resolution describes how big each pixel is in real world units - * Sample calculation: envelope.getLength(0) / image.getWidth() + * Sample calculation: ``envelope.getLength(0) / image.getWidth()`` * You can define several levels in order to capture overview files if you have them - * LevelsNum: the number of levels mentioned above - * Envelope2D: bounds in the CRS specified in the prj file + * ``LevelsNum``: the number of levels mentioned above + * ``Envelope2D``: bounds in the CRS specified in the ``.prj`` file - * Format: "minX,minY maxX,maxY" + * ``Format``: ``minX,minY maxX,maxY`` - * NumFiles: should be the same as the number of features in your shapefile + * ``NumFiles``: should be the same as the number of features in your shapefile diff --git a/docs/user/library/coverage/multidim.rst b/docs/user/library/coverage/multidim.rst index f2505564ad6..af09acc8501 100644 --- a/docs/user/library/coverage/multidim.rst +++ b/docs/user/library/coverage/multidim.rst @@ -8,7 +8,8 @@ The following Module contains two new plugins for reading the following raster f * NetCDF * Grib -Also the module contains a sub-module called coverage-api containing a few classes than can be used for creating a new plugin +Also the module contains a sub-module called ``gt-coverage-api`` containing a +few classes than can be used for creating a new plugin for another multidimensional raster format. It should be pointed out that the two modules internally use the `Unidata JAVA Libraries `_ @@ -96,15 +97,15 @@ The data dimension values will be mapped to three bands called quality, pressure Default Enhance Mode ++++++++++++++++++++ -The default `Enhance `_ mode used +The default `Enhance `_ mode used by GeoTools is `Enhance.CoordSys`, in order to change the enhance mode use the following system properties: -- org.geotools.coverage.io.netcdf.enhance.CoordSystems -- org.geotools.coverage.io.netcdf.enhance.ScaleMissing -- org.geotools.coverage.io.netcdf.enhance.ConvertEnums -- org.geotools.coverage.io.netcdf.enhance.ScaleMissingDefer +- ``org.geotools.coverage.io.netcdf.enhance.CoordSystems`` +- ``org.geotools.coverage.io.netcdf.enhance.ScaleMissing`` +- ``org.geotools.coverage.io.netcdf.enhance.ConvertEnums`` +- ``org.geotools.coverage.io.netcdf.enhance.ScaleMissingDefer`` -These can be set individually. According to the NetCDF-Java docs it is not safe to use ScaleMissing and ScaleMissingDefer +These can be set individually. According to the NetCDF-Java docs it is not safe to use ``ScaleMissing`` and ``ScaleMissingDefer`` simultaneously. GRIB diff --git a/docs/user/library/coverage/netCDF.rst b/docs/user/library/coverage/netCDF.rst index d625a1df55d..767ab8a6f4c 100644 --- a/docs/user/library/coverage/netCDF.rst +++ b/docs/user/library/coverage/netCDF.rst @@ -1,6 +1,12 @@ -netCDF Plugin +NetCDF Plugin ------------- -The NetCDF plugin supports gridded NetCDF files having dimensions following the COARDS convention (custom, Time, Elevation, Lat, Lon). The NetCDF plugin supports plain NetCDF datasets (.nc files) as well .ncml files (which aggregate and/or modify one or more datasets) and Feature Collections. It supports Forecast Model Run Collection Aggregations (FMRC) either through the NCML or Feature Collection syntax. It supports an unlimited amount of custom dimensions, including runtime. +The NetCDF plugin supports gridded NetCDF files having dimensions +following the COARDS convention (custom, Time, Elevation, Lat, Lon). The +NetCDF plugin supports plain NetCDF data sets (``.nc`` files) as well ``.ncml`` +files (which aggregate and/or modify one or more data sets) and Feature +Collections. It supports Forecast Model Run Collection Aggregations +(FMRC) either through the NCML or Feature Collection syntax. It supports +an unlimited amount of custom dimensions, including runtime. -Further documentation is available in `the GeoServer project `_ \ No newline at end of file +Further documentation is available in `the GeoServer project `_ diff --git a/docs/user/library/coverage/oracle.rst b/docs/user/library/coverage/oracle.rst index 0f548d9aee3..fb1a94fb6c8 100644 --- a/docs/user/library/coverage/oracle.rst +++ b/docs/user/library/coverage/oracle.rst @@ -1,8 +1,9 @@ Oracle GeoRaster Plugin ----------------------- -This plugin is an extension to the Image Mosaicing Pyramidal JDBC Plugin. Since an Oracle Raster -Object contains tiles and pyramids, configuration is simple. +This plugin is an extension to the Image Mosaicing Pyramidal JDBC +Plugin. Since an Oracle Raster Object contains tiles and pyramids, +configuration is simple. Credits @@ -42,13 +43,13 @@ Since this module requires a coverage name, a table containing a column for the STORAGE (PCTINCREASE 0) ); -2. Now insert a record for a coverage named oek. +2. Now insert a record for a coverage named ``oek``. The raster- and pyramid tiles are stored in a table called RASTER_RDT.:: INSERT INTO RASTER VALUES ('oek', sdo_geor.init('RASTER_RDT')); -3. Import the image. Look here in case of problems Oracle Georaster Import:: +3. Import the image. Look here in case of problems Oracle GeoRaster Import:: DECLARE geor SDO_GEORASTER; @@ -78,13 +79,13 @@ Since this module requires a coverage name, a table containing a column for the Configuration ^^^^^^^^^^^^^ -The Config file:: +The configuration file:: coverageName name="oek"/> - + diff --git a/docs/user/library/coverage/pgraster.rst b/docs/user/library/coverage/pgraster.rst index a46ab445c60..b328d7d8c98 100644 --- a/docs/user/library/coverage/pgraster.rst +++ b/docs/user/library/coverage/pgraster.rst @@ -1,8 +1,9 @@ Postgis Raster Plug in ---------------------- -This plug in is an extension to the Image Mosaicing Pyramidal JDBC Plugin. Since a Postgis raster -object offers spatial functions and predicates, configuration is simple. +This plugin is an extension to the Image Mosaicing Pyramidal JDBC +Plugin. Since a Postgis raster object offers spatial functions and +predicates, configuration is simple. Prerequisites @@ -21,25 +22,25 @@ This plugin expects the following table layout: .. note:: - Of course, it is possible to use sql views instead of tables for + Of course, it is possible to use SQL views instead of tables for creating the best physical table layout for the local deployment .. warning:: - For Postgis JDBC drivers < version 9 it is necessary to set a property in the database: + For Postgis JDBC drivers < version 9 it is necessary to set a property in the database:: - ALTER DATABASE dbname SET bytea_output TO 'escape' + ALTER DATABASE dbname SET bytea_output TO 'escape' -Prepare the tiles and overviews using the gdal tool box http://www.gdal.org. +Prepare the tiles and overviews using the GDAL tool box http://www.gdal.org. A good candidate is http://www.gdal.org/gdal_retile.html. The utility for importing the tiles is described here http://postgis.refractions.net/docs/using_raster.xml.html and is included in Postgis 2.0. -An example setup assumes the existense of 3 tables, **rtable1**, **rtable2** **rtable3**. **rtable1** is populated with the tiles from the base image, +An example setup assumes the existence of 3 tables, **rtable1**, **rtable2** **rtable3**. **rtable1** is populated with the tiles from the base image, **rtable2** and **rtable3** are tables for overviews. The raster column in all tables is named **rast**. The plugin needs exactly one meta data table. Table name -and column names must match with the xml configuration (example follows) . If the table is not present, create it with:: +and column names must match with the XML configuration (example follows) . If the table is not present, create it with:: create table MOSAIC (NAME varchar(254) not null, TileTable varchar(254)not null, @@ -47,7 +48,7 @@ and column names must match with the xml configuration (example follows) . If th primary key (NAME,TileTable)) -Now insert a record for a coverage named **oek**, which is stored in **rtable1**, **rtable2** **rtable3**. **oek** is the geotools name of the coverage:: +Now insert a record for a coverage named **oek**, which is stored in **rtable1**, **rtable2** **rtable3**. **oek** is the GeoTools name of the coverage:: insert into MOSAIC(NAME,TileTable) values ('oek',''rtable1) insert into MOSAIC(NAME,TileTable) values ('oek',''rtable2) @@ -57,7 +58,9 @@ Now insert a record for a coverage named **oek**, which is stored in **rtable1** Configuration ^^^^^^^^^^^^^ -The plugin needs a xml configuration file. Since connect and mapping info can be reused by many coverages, it is better to have the configuration splitted into 3 parts. +The plugin needs a XML configuration file. Since connect and mapping info +can be reused by many coverages, it is better to have the configuration +split into 3 parts. 1. JDBC connect configuration stored as **connect.pgraster.xml.inc** in this example setup. @@ -108,7 +111,7 @@ The plugin needs a xml configuration file. Since connect and mapping info can be - + &mapping; diff --git a/docs/user/library/coverage/pyramid.rst b/docs/user/library/coverage/pyramid.rst index d2a91eccfb1..3362058511b 100644 --- a/docs/user/library/coverage/pyramid.rst +++ b/docs/user/library/coverage/pyramid.rst @@ -24,7 +24,7 @@ Example ^^^^^^^ On disk an image pyramid is going to look a bit like the following (you can use any format for -the tiles from mrsid to tiff):: +the tiles from MRSid to tiff):: directory/ directory/pyramid.properties diff --git a/docs/user/library/cql/cql.rst b/docs/user/library/cql/cql.rst index 4d06cc6508a..8a7d1c742a6 100644 --- a/docs/user/library/cql/cql.rst +++ b/docs/user/library/cql/cql.rst @@ -163,6 +163,7 @@ Examples * Filter based on Existence Check if something exists:: + Filter result = CQL.toFilter( "ATTR1 EXISTS" ); Check if something does not exist:: @@ -187,7 +188,7 @@ Examples Filter result = CQL.toFilter( "CROSSES(ATTR1, LINESTRING(1 2, 10 15))" ); Filter result = CQL.toFilter( "INTERSECTS(ATTR1, GEOMETRYCOLLECTION (POINT (10 10),POINT (30 30),LINESTRING (15 15, 20 20)) )" ); - The following example shows how to make a filter using the RELATE geooperation. In this case, the DE-9IM pattern corresponds to the **contains** spatial relation, It will be true if the first geometry contains the second. + The following example shows how to make a filter using the RELATE operation. In this case, the DE-9IM pattern corresponds to the **contains** spatial relation, It will be true if the first geometry contains the second. .. literalinclude:: /../src/main/java/org/geotools/cql/ECQLExamples.java :language: java diff --git a/docs/user/library/cql/ecql.rst b/docs/user/library/cql/ecql.rst index 5d261b8c482..ee73c8c3874 100644 --- a/docs/user/library/cql/ecql.rst +++ b/docs/user/library/cql/ecql.rst @@ -7,7 +7,7 @@ References * `ECQL Parser Design `__ (design doc with BNF, note, in addition to WKT syntax for geometries GeoTools now supports also Extended WKT, same as PostGIS, see example below) -* `GeoServer CQL Examples `_ (geoserver) +* `GeoServer CQL Examples `_ (GeoServer) .. note:: @@ -45,7 +45,7 @@ Examples * Filter by Comparing Values - The CQL language limited us to referencing a propertyName against + The CQL language limited us to referencing a ``propertyName`` against a more general expression. ECQL allows you to use full expressions everywhere: @@ -133,7 +133,7 @@ Examples Filter filter = ECQL.toFilter( "DWITHIN(buffer(the_geom,5), POINT(1 2), 10, kilometers)"); - The following example shows how to make a filter using the RELATE geooperation. In this case, the DE-9IM pattern corresponds to the **contains** spatial relation, It will be true if the first geometry contains the second. + The following example shows how to make a filter using the RELATE operation. In this case, the DE-9IM pattern corresponds to the **contains** spatial relation, It will be true if the first geometry contains the second. .. literalinclude:: /../src/main/java/org/geotools/cql/ECQLExamples.java :language: java diff --git a/docs/user/library/cql/faq.rst b/docs/user/library/cql/faq.rst index 33128eeb95a..2bcc3a61f22 100644 --- a/docs/user/library/cql/faq.rst +++ b/docs/user/library/cql/faq.rst @@ -15,7 +15,7 @@ Here is the most common use for the CQL class - asking for Features: :end-before: // cql comparison end -The CQL utility class produced is a Filter; you can create Filters by hand (using a FilterFactory) but this is much easier. +The CQL utility class produced is a Filter; you can create Filters by hand (using a ``FilterFactory`` but this is much easier. Q: What version of CQL is implemented? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -29,7 +29,7 @@ of temporal expressions and to leverage its use in the GeoTools library. Q: Can I just try CQL out? ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -If you're developing with GeoTools, you can easily try out the CQL parser by depending on the **gt-cql** +If you're developing with GeoTools, you can easily try out the CQL parser by depending on the ``gt-cql`` jar and running the **CQL** class as a normal Java application. It will present a prompt on the console (standard input) from where you can input CQL strings and diff --git a/docs/user/library/cql/index.rst b/docs/user/library/cql/index.rst index 994b3509e25..66a37867ca1 100644 --- a/docs/user/library/cql/index.rst +++ b/docs/user/library/cql/index.rst @@ -1,7 +1,7 @@ CQL === -The gt-cql module a human readable "Contextual Query Language" for writing filter expressions +The ``gt-cql`` module a human readable "Contextual Query Language" for writing filter expressions for working with geospatial information. CQL was originally known as Common Query Language (so you will find lots of examples that still @@ -41,4 +41,4 @@ range of GeoTools Filter and Expression ideas using simple text strings. :maxdepth: 1 cql - ecql \ No newline at end of file + ecql diff --git a/docs/user/library/cql/internal.rst b/docs/user/library/cql/internal.rst index 5568d751fdb..0ecf48072ec 100644 --- a/docs/user/library/cql/internal.rst +++ b/docs/user/library/cql/internal.rst @@ -5,7 +5,7 @@ This package is dedicated to support the OGC Common Query Language, version 2.0. CQL Interface ^^^^^^^^^^^^^ -This diagram presents the package interface. In parser's protocol methods performs the parsing of CQL and builds the the filter. +This diagram presents the package interface. In parser's protocol methods performs the parsing of CQL and builds the filter. .. image:: /images/cql.PNG @@ -13,7 +13,7 @@ This diagram presents the package interface. In parser's protocol methods perfor CQL Implementation ^^^^^^^^^^^^^^^^^^ -The figure shows the principal class in the parser and build process. CQLParser does a top down analysis of the input string and makes the parsing tree. Each time CQLParser builds a node, it makes a call to CQLCompiler, that implements the semantic actions related and builds the product or subproduct required to make the Filter at the end of the parsing process +The figure shows the principal class in the parser and build process. CQLParser does a top down analysis of the input string and makes the parsing tree. Each time CQLParser builds a node, it makes a call to CQLCompiler, that implements the semantic actions related and builds the product or sub product required to make the Filter at the end of the parsing process .. image:: /images/cqlParser.PNG @@ -165,7 +165,7 @@ Expression:: ::= "TRUE" | "FALSE" | "UNKNOWN" -Georoutine and Relational Geooperations:: +Geo-Routine and Relational Geo-Operations:: ::= @@ -383,7 +383,7 @@ Character String Literal:: Identifier -The following section is intended to give context for identifier and namespaces. It assumes that the default namespace is specified in the query request and does not allow any overrides of the namepace:: +The following section is intended to give context for identifier and namespaces. It assumes that the default namespace is specified in the query request and does not allow any overrides of the namespace:: ::= ::= diff --git a/docs/user/library/data/arcsde.rst b/docs/user/library/data/arcsde.rst index b2e5f9c6723..484f3778639 100644 --- a/docs/user/library/data/arcsde.rst +++ b/docs/user/library/data/arcsde.rst @@ -6,7 +6,7 @@ The ArcSDE plugin allows the GeoTools developer to work with the `ArcSDE `_ * `Geometry-less` Feature Types: "Non spatial" registered ArcSDE tables can be accessed as GeoTools FeatureTypes @@ -30,84 +30,96 @@ Configuration Parameters To connect to an ArcSDE instance you must have the following parameters: -+-----------------+-------------------------------------------------------------------+ -| Parameter | Description | -+=================+===================================================================+ -| "dbtype" | Required: must be "arcsde" | -+-----------------+-------------------------------------------------------------------+ -|"server" | Required: The machine which the ArcSDE instance is running on. | -+-----------------+-------------------------------------------------------------------+ -|"port" | Required: The port the ArcSDE instance is running on. | -| | The default is 5151, or if you're using Direct Connect, check the | -| | :ref:`direct-connect` | -| | section for further information on how to format this parameter. | -+-----------------+-------------------------------------------------------------------+ -|"instance" | Optional: The ArcSDE instance name (generally "sde", or whatever | -| | you called the database). | -+-----------------+-------------------------------------------------------------------+ -|"user" | Required: The name of the user to connect with. | -+-----------------+-------------------------------------------------------------------+ -|"password" | Required: The password of the user you are connecting with. | -+-----------------+-------------------------------------------------------------------+ ++-------------------+-------------------------------------------------------------------+ +| Parameter | Description | ++===================+===================================================================+ +| ``dbtype`` | Required: must be ``arcsde`` | ++-------------------+-------------------------------------------------------------------+ +| ``server`` | Required: The machine which the ArcSDE instance is running on. | ++-------------------+-------------------------------------------------------------------+ +| ``port`` | Required: The port the ArcSDE instance is running on. | +| | The default is 5151, or if you're using Direct Connect, check the | +| | :ref:`direct-connect` | +| | section for further information on how to format this parameter. | ++-------------------+-------------------------------------------------------------------+ +| ``instance`` | Optional: The ArcSDE instance name (generally ``sde``, or whatever| +| | you called the database). | ++-------------------+-------------------------------------------------------------------+ +| ``user`` | Required: The name of the user to connect with. | ++-------------------+-------------------------------------------------------------------+ +| ``password`` | Required: The password of the user you are connecting with. | ++-------------------+-------------------------------------------------------------------+ Access ^^^^^^ There's nothing special from the GeoTools API point of view in accessing an ArcSDE server. Just use the regular GeoTools DataStore creation mechanism with the correct parameters:: - Map map = new HashMap(); - map.put( "dbtype", "arcsde" ); - map.put( "server", "my.arcsdeserver.com" ); - map.put( "port", "5151" ); - map.put( "instance", "sde" ); - map.put( "user", "sde" ); - map.put( "password", "secret" ); - - DataStore dataStore = DataStoreFinder.getDataStore( Map map ); - String typeName = dataStore.getTypeNames()[0]; - - FeatureSource source = dataStore( typeName ); - - Filter filter = CQL.toFilter("BBOX(SHAPE, -180,-90,0,0)"); - FeatureCollection collection = source.getFeatures( filter ); - FeatureIterator iterator = collection.iterator(); - try { - while( iterator.hasNext() ){ - Feature feature = (Feature) iterator.next(); - ... - } - } - finally { - collection.close( iterator ); - } + Map map = new HashMap(); + map.put( "dbtype", "arcsde" ); + map.put( "server", "my.arcsdeserver.com" ); + map.put( "port", "5151" ); + map.put( "instance", "sde" ); + map.put( "user", "sde" ); + map.put( "password", "secret" ); + + DataStore dataStore = DataStoreFinder.getDataStore( Map map ); + String typeName = dataStore.getTypeNames()[0]; + + FeatureSource source = dataStore( typeName ); + Filter filter = CQL.toFilter("BBOX(SHAPE, -180,-90,0,0)"); + FeatureCollection collection = source.getFeatures( filter ); + FeatureIterator iterator = collection.iterator(); + try { + while( iterator.hasNext() ){ + Feature feature = (Feature) iterator.next(); + ... + } + } + finally { + collection.close( iterator ); + } Advanced ^^^^^^^^ -There are also a number of optional parameters to configure the ArcSDE connection 'pool'. GeoTools makes use of a number of connections, but does a decent job of managing them, so that new connections need not be made for each request. The big reason for this is that some ArcSDE licenses only allow a limited number of connections, so these values can be adjusted to minimize the number of simultaneous connections. GeoTools will share the active connections instead of making new ones. Right now it requires at least two connections, as we were having some nasty bugs with ArcSDE connections going stale (only with certain instances, and only with spatial queries, which made debugging a big hassle). With some funded development work this could easily be improved, ArcSDE could definitely benefit from some more effort. If you have more connections available we do recommend upping the pool.maxConnections parameter. The meaning of these optional parameters is as follows: - -+----------------------------------+-----------------------------------------------------------------+ -| Parameter | Description | -+=================================+==================================================================+ -|"pool.minConnections" | The number of connections the pool makes on start up. If needed | -| | these will be incremented. | -+---------------------------------+------------------------------------------------------------------+ -|"pool.maxConnections" | The maximum number of connections that a pool is allowed to | -| | make. This should be as high as possible, but there may be | -| | license limitations. | -+---------------------------------+------------------------------------------------------------------+ -|"pool.timeOut" | The amount of time that a connection request should wait for an | -| | unused connection before failing. | -+---------------------------------+------------------------------------------------------------------+ -|"namespace" | A String literal representing the namespace URL FeatureTypes | -| | created by this DataStore will be assigned to. E.g.: | -| | ``http://my.company.com/testNamespace`` | -+---------------------------------+------------------------------------------------------------------+ -|"database.version" | The ArcSDE database version to use. | -+---------------------------------+------------------------------------------------------------------+ -|"datastore.allowNonSpatialTables"| ``true|false`` If enabled, registered non-spatial tables | -| | are also available. | -+---------------------------------+------------------------------------------------------------------+ +There are also a number of optional parameters to configure the ArcSDE +connection 'pool'. GeoTools makes use of a number of connections, but +does a decent job of managing them, so that new connections need not +be made for each request. The big reason for this is that some ArcSDE +licenses only allow a limited number of connections, so these values can +be adjusted to minimize the number of simultaneous connections. GeoTools +will share the active connections instead of making new ones. Right +now it requires at least two connections, as we were having some nasty +bugs with ArcSDE connections going stale (only with certain instances, +and only with spatial queries, which made debugging a big hassle). With +some funded development work this could easily be improved, ArcSDE could +definitely benefit from some more effort. If you have more connections +available we do recommend upping the ``pool.maxConnections`` parameter. The +meaning of these optional parameters is as follows: + ++-------------------------------------+------------------------------------------------------------------+ +| Parameter | Description | ++=====================================+==================================================================+ +| ``pool.minConnections`` | The number of connections the pool makes on start up. If needed | +| | these will be incremented. | ++-------------------------------------+------------------------------------------------------------------+ +| ``pool.maxConnections`` | The maximum number of connections that a pool is allowed to | +| | make. This should be as high as possible, but there may be | +| | license limitations. | ++-------------------------------------+------------------------------------------------------------------+ +| ``pool.timeOut`` | The amount of time that a connection request should wait for an | +| | unused connection before failing. | ++-------------------------------------+------------------------------------------------------------------+ +| ``namespace`` | A String literal representing the namespace URL FeatureTypes | +| | created by this DataStore will be assigned to. E.g.: | +| | ``http://my.company.com/testNamespace`` | ++-------------------------------------+------------------------------------------------------------------+ +| ``database.version`` | The ArcSDE database version to use. | ++-------------------------------------+------------------------------------------------------------------+ +| ``datastore.allowNonSpatialTables`` | ``true|false`` If enabled, registered non-spatial tables | +| | are also available. | ++-------------------------------------+------------------------------------------------------------------+ .. _direct-connect: @@ -122,8 +134,8 @@ The GeoTools ArcSDE configuration parameters are the same as in the `Configurati * server: In ESRI Direct Connect Mode a value must be given or the Direct Connect Driver will throw an error, so just put a 'none' there - any String will work! * port: In ESRI Direct Connect Mode the port has a String representation: `sde:oracle10g`, `sde:oracle11g:/:test`, etc. For further information check `ArcSDE connection syntax `_ at the official ArcSDE documentation from ESRI. * instance: In ESRI Direct Connect Mode a value must be given or the Direct Connect Driver will throw an error, so just put a 'none' there - any String will work! - * user: The username to authenticate with the geo database. - * password: The password associated with the above username for authentication with the geo database. + * user: The username to authenticate with the database. + * password: The password associated with the above username for authentication with the database. .. note:: Be sure to assemble the password like: password@ for Oracle @@ -149,7 +161,7 @@ versions (8.3 and 9.0/9.1) has been dropped since a long time due to lack of lic Dependencies '''''''''''' -If you're building a project that needs the GeoTools ArcSDE plugin you're hopefuly using Apache Maven so you that you only declare a dependency against the GeoTools ArcSDE plugin +If you're building a project that needs the GeoTools ArcSDE plugin you're hopefully using Apache Maven so you that you only declare a dependency against the GeoTools ArcSDE plugin and let Maven take care of the transitive dependencies (i.e. libraries the ArcSDE plugin depends on but your project doesn't directly). If that is not the case, the following are the full dependencies of the GeoTools ArcSDE plugin, plus the ones listed in the ref:`esri-jars` section:: @@ -237,15 +249,22 @@ If that is not the case, the following are the full dependencies of the GeoTools Additionally, you'll need the following two jar files: -* jsde_sdk.jar -* jpe_sdk.jar +* ``jsde_sdk.jar`` +* ``jpe_sdk.jar`` We cannot distribute them with GeoTools. Please make sure the required jars are available on the CLASSPATH (if not the ArcSDE plugin will report itself as unavailable). -They should be available once you installed the "ArcSDE Java SDK". For example, located in *arcsde install dir**/arcsdesdk/sdeexe92/lib/. -Make sure you use the same version of the ``jsde_sdk.jar`` and ``jpe_sdk.jar`` libraries than your ArcSDE instance. Or at least that's what ESRI recommends, though -in some cases we found using a higher version of those jars against a lower version of the ArcSDE instance does not hurt at all, or can even work or perform better. -But definitely don't use a lower version of the jars against a higher version of ArcSDE. - -.. note:: As for version 10.0, ArcSDE is part of the ESRI ArcGIS Server stack, and you may need to request a separate media DVD to ESRI for the ArcSDE Java SDK as it seems it doesn't come with the standard DVD set but you can get it by just asking for it. +They should be available once you installed the "ArcSDE Java SDK". For +example, located in *arcsde install dir* ``/arcsdesdk/sdeexe92/lib/``. +Make sure you use the same version of the ``jsde_sdk.jar`` and +``jpe_sdk.jar`` libraries than your ArcSDE instance. Or at least that's +what ESRI recommends, though in some cases we found using a higher version +of those jars against a lower version of the ArcSDE instance does not +hurt at all, or can even work or perform better. But definitely don't +use a lower version of the jars against a higher version of ArcSDE. + +.. note:: As for version 10.0, ArcSDE is part of the ESRI ArcGIS Server + stack, and you may need to request a separate media DVD to ESRI for the + ArcSDE Java SDK as it seems it doesn't come with the standard DVD set + but you can get it by just asking for it. diff --git a/docs/user/library/data/datastore.rst b/docs/user/library/data/datastore.rst index 59cca84abdf..67c89df07c4 100644 --- a/docs/user/library/data/datastore.rst +++ b/docs/user/library/data/datastore.rst @@ -44,7 +44,7 @@ differently. * Create To create a new shapefile on disk we are going to have to go one level deeper - and ask FileDataStoreFinder for a factory matching the "shp" extension.:: + and ask FileDataStoreFinder for a factory matching the ``shp`` extension.:: FileDataStoreFactorySpi factory = FileDataStoreFinder.getDataStoreFactory("shp"); @@ -124,7 +124,7 @@ If you are working with GeoServer or uDig you have access to some great faciliti // Making the DataStore DataStore dataStore = service.resolve( DataStore.class, new NullProgressListener() ); -The idea works similar to a "file handle", you can make a IService "handle" that represents your DataStore (and you can ask the handle several fun questions like "what is your name") before you actually create the beast. +The idea works similar to a "file handle", you can make a ``IService`` "handle" that represents your DataStore (and you can ask the handle several fun questions like "what is your name") before you actually create the beast. This separation is really important in an application expecting to talk about thousands of sources of data at a time. Just because your application wants to know about a source of data does not always mean you need a DataStore yet. diff --git a/docs/user/library/data/export.rst b/docs/user/library/data/export.rst index 0994fd3b44e..3851fc67491 100644 --- a/docs/user/library/data/export.rst +++ b/docs/user/library/data/export.rst @@ -24,7 +24,7 @@ it is under construction. :start-after: // exportToShapefile start :end-before: // exportToShapefile end -* We also have an alternative example (thanks gaby) using FeatureWriter. +* We also have an alternative example (thanks Gaby) using FeatureWriter. FeatureSource and FeatureCollection are high level API, to get down and dirty you can use the low-level FeatureReader / FeatureWriter API. @@ -54,8 +54,9 @@ A couple of hints: :start-after: // fixWFSTypeName start :end-before: // fixWFSTypeName end -* The WFS-T protocol does not allow us to implement createSchema so creating a new featureType - will need to be done according to the procedure for your WFS prior to calling addFeature +* The WFS-T protocol does not allow us to implement ``createSchema`` so creating a new ``featureType`` + will need to be done according to the procedure for your WFS prior to calling + ``addFeature``. As an example GeoServer supports the use of a REST API for this purpose. @@ -65,6 +66,6 @@ PostGIS To copy information into PostGIS: * You can export from PostGIS as expected using the examples above -* PostGIS also supports createSchema allowing you to create a new table to hold the content -* You may wish to adjust the featureType information, especially the lengths of strings - prior to calling createSchema +* PostGIS also supports ``createSchema`` allowing you to create a new table to hold the content +* You may wish to adjust the ``featureType`` information, especially the lengths of strings + prior to calling ``createSchema`` diff --git a/docs/user/library/data/faq.rst b/docs/user/library/data/faq.rst index ab62a5ce0d5..c79b157f8a3 100644 --- a/docs/user/library/data/faq.rst +++ b/docs/user/library/data/faq.rst @@ -4,9 +4,10 @@ Data FAQ Q: How do I get a FeatureStore? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -FeatureStore is an extension of FeatureSource that is only available if your information can be modified. +``FeatureStore`` is an extension of ``FeatureSource`` that is only available if your information can be modified. -With this in mind you can use an instanceof check, and then cast to a FeatureStore:: +With this in mind you can use an ``instanceof`` check, and then cast to a +``FeatureStore``:: SimpleFeatureSource source = dataStore.getFeatureSource( typeName ); if( source instanceof SimpleFeatureStore ){ diff --git a/docs/user/library/data/featuresource.rst b/docs/user/library/data/featuresource.rst index f9d96259d20..8018114825e 100644 --- a/docs/user/library/data/featuresource.rst +++ b/docs/user/library/data/featuresource.rst @@ -166,24 +166,24 @@ Adding features can be done in the following manner.: Hints: -* If addFeatures is really slow you probably forgot to use a Transaction! +* If ``addFeatures`` is really slow you probably forgot to use a ``Transaction``! -* Got FeatureCollection? +* Got ``FeatureCollection``? - The addFeatures method really wants a feature collection, if you have something other than a FeatureCollection there are - a couple of DataUtilityMethods around to help. + The ``addFeatures`` method really wants a feature collection, if you have something other than a ``FeatureCollection`` there are + a couple of ``DataUtilityMethods`` around to help:: - * store.addFeatures( DataUtilities.collection( feature ) ); - * store.addFeatures( DataUtilities.collection( array ) ); - * store.addFeatures( DataUtilities.collection( list ) ); - * store.addFeatures( DataUtilities.collection( set ) ); + store.addFeatures( DataUtilities.collection( feature ) ); + store.addFeatures( DataUtilities.collection( array ) ); + store.addFeatures( DataUtilities.collection( list ) ); + store.addFeatures( DataUtilities.collection( set ) ); And by a couple I mean they are all named *collection* it is just they are willing to adapt from a range of input. -* Handling of FeatureID +* Handling of ``FeatureID`` Each feature has an identifier that is intended to be unique in agreement with the WFS specification. - For most implementations the FeatureID is assigned when the feature is added + For most implementations the ``FeatureID`` is assigned when the feature is added (and even more interestingly when it is committed!): .. literalinclude:: /../src/main/java/org/geotools/data/SimpleFeatureStoreExamples.java @@ -191,15 +191,15 @@ Hints: :start-after: // addFeatureIdExample start :end-before: // addFeatureIdExample end - FeatureID are assigned during the commit process. While we make an attempt to determine an + ``FeatureID`` are assigned during the commit process. While we make an attempt to determine an appropriate ID prior to commit we ask that you wait until commit() is finished before writing down the identifiers of the added content. - The FeatureID instances returned by addFeatures are updated to reflect the final value + The ``FeatureID`` instances returned by ``addFeatures`` are updated to reflect the final value provided during commit. If you need to perform this step yourself you can listen for a BatchFeatureEvent as shown below. -* FeatureEvents are sent out when adding: +* ``FeatureEvents`` are sent out when adding: .. literalinclude:: /../src/main/java/org/geotools/data/SimpleFeatureStoreExamples.java :language: java @@ -208,12 +208,12 @@ Hints: The BatchFeatureEvent sent out during commit contains the final set of identifiers -* Handling of FeatureID Yourself +* Handling of ``FeatureID`` Yourself - Recently a few DataStore implementations (JDBCNG and Property) added support for a "Hint" allowing - you to define your own FeatureID:: + Recently a few ``DataStore`` implementations (JDBCNG and Property) added support for a "Hint" allowing + you to define your own ``FeatureID``:: - if( featureStore.getQueryCapabilities().isUseExisingFIDSupported() ){ + if( featureStore.getQueryCapabilities().isUseExizingFIDSupported() ){ // featureStore allows us to create our own featureIDs SimpleFeatureBuilder b = new SimpleFeatureBuilder(featureStore.getSchema()); DefaultFeatureCollection collection = new DefaultFeatureCollection(null,featureStore.getSchema()); @@ -249,7 +249,7 @@ This does of course leave an obvious question: * Q What was just removed? - If you would like to report to the user what features were removed you will need to select the FeatureIds out before + If you would like to report to the user what features were removed you will need to select the ``FeatureIds`` out before they are deleted. .. literalinclude:: /../src/main/java/org/geotools/data/SimpleFeatureStoreExamples.java @@ -278,12 +278,12 @@ You can also perform batch changes to the all the data matching a specific filte transaction.rollback(); } -The above code example finds the feature with ID "fred" and changes his "age" to 24. +The above code example finds the feature with ID ``fred`` and changes his ``age`` to 24. SimpleFeatureLocking ^^^^^^^^^^^^^^^^^^^^ -FeatureLocking follows the same model as web feature service locking; a time based lock is requested. The lock is valid +``FeatureLocking`` follows the same model as web feature service locking; a time based lock is requested. The lock is valid until released, or until the duration expires. @@ -299,9 +299,10 @@ Acquiring a lock is straight forward:: System.out.println("Features lock with authorisation: "+lock.getAuthorization() ); -To unlock the features again we need to use the authorisation provided by lock.getAuthorization() above. -Usually these authorisations are stored as part of your application (as part of a session), -and used to configure the GeoTools Transaction before use of SimpleFeatureStore.:: +To unlock the features again we need to use the authorization provided by ``lock.getAuthorization()`` above. +Usually these authorizations are stored as part of your application (as part of a session), +and used to configure the GeoTools Transaction before use of +``SimpleFeatureStore``.:: Transaction t = new DefaultTransaction(); diff --git a/docs/user/library/data/geopackage.rst b/docs/user/library/data/geopackage.rst index 8b4e6c9b2b5..a45b0c1a92c 100644 --- a/docs/user/library/data/geopackage.rst +++ b/docs/user/library/data/geopackage.rst @@ -7,7 +7,7 @@ GeoPackage is an open, standards-based, platform-independent, portable, self-des The module supports both vector data, as GeoPackage features, and raster data, as GeoPackage tiles. Access to a GeoPackage can be performed either low level, using the GeoPackage class, or high level, using the GeoPackage JDBC data store -for vector data, and the GeoPackageReader for raster data. +for vector data, and the ``GeoPackageReader`` for raster data. References: @@ -31,9 +31,9 @@ DataStore Connection Parameters ============== ============================================ Parameter Description ============== ============================================ -"dbtype" Must be the string "geopkg" -"database" The database to connect to -"user" User name (optional) +``dbtype`` Must be the string ``geopkg`` +``database`` The database to connect to +``user`` User name (optional) ============== ============================================ Access diff --git a/docs/user/library/data/index.rst b/docs/user/library/data/index.rst index 2e56a7aa7a1..391275f2f60 100644 --- a/docs/user/library/data/index.rst +++ b/docs/user/library/data/index.rst @@ -10,13 +10,13 @@ the toolkit to work. .. image:: /images/gt-main.png -The gt-main module is the foundation for implementing additional :doc:`DataStore <../main/datastore>` +The ``gt-main`` module is the foundation for implementing additional :doc:`DataStore <../main/datastore>` formats: -* Abstract classes for :doc:`DataStore <../main/datastore>` implementors to start from such +* Abstract classes for :doc:`DataStore <../main/datastore>` implementers to start from such as **ContentDataStore** and **DirectoryDataStore** -The gt-main module requires plug ins for different formats to be supplied. +The ``gt-main`` module requires plug ins for different formats to be supplied. **Maven**:: diff --git a/docs/user/library/data/internal.rst b/docs/user/library/data/internal.rst index bcadd0fa8eb..6ca0b2b69e0 100644 --- a/docs/user/library/data/internal.rst +++ b/docs/user/library/data/internal.rst @@ -1,79 +1,79 @@ Internals --------- -The internals of gt-main provide assistance to those writing new format support for the DataStore API with a wealth of abstract classes to extend, and utility classes performing common functions. +The internals of ``gt-main`` provide assistance to those writing new format support for the DataStore API with a wealth of abstract classes to extend, and utility classes performing common functions. ContentDataStore ^^^^^^^^^^^^^^^^ -ContentDataStore represents a ground up rewrite of "much loved" AbstractDataStore. Since the form of that love was reflect in lots of workarounds, and extra methods, and complicated class interactions this is generally viewed as a good thing. +``ContentDataStore`` represents a ground up rewrite of "much loved" ``AbstractDataStore``. Since the form of that love was reflect in lots of workarounds, and extra methods, and complicated class interactions this is generally viewed as a good thing. .. image:: /images/content.PNG -It offers a clear design with a small number of classes to implement. These classes are referenced by ContentDataStore as it goes about +It offers a clear design with a small number of classes to implement. These classes are referenced by ``ContentDataStore`` as it goes about doing its job, as a result you are not responsible for many of the usual DataStore classes. There is a tutorial showing how to read a simple comma separated value file: * :doc:`/tutorial/datastore/index` (tutorial) -Central to this design is the ContentEntry and ContentState classes. These classes are provided to you as you are implementing -for general note keeping. You can override the instance of ContentState that is created if you need to track additional details cache information specific to your implementation. +Central to this design is the ``ContentEntry`` and ``ContentState`` classes. These classes are provided to you as you are implementing +for general note keeping. You can override the instance of ``ContentState`` that is created if you need to track additional details cache information specific to your implementation. -* ContentEntry stores all the notes needed for a featureSource to function. +* ``ContentEntry`` stores all the notes needed for a ``featureSource`` to function. - * getName() - * getTypeName() + ``getName()`` + ``getTypeName()`` - These two methods identify a published FeatureType + These two methods identify a published ``FeatureType`` - * getState( Transaction ) + * ``getState( Transaction )`` - Access to the ContentState for ongoing Transactions. - Two FeatureStores using the same Transaction will end up using the same ContentState. - * dispose() - * getDataStore() + Access to the ``ContentState`` for ongoing ``Transactions``. + Two ``FeatureStores`` using the same Transaction will end up using the same ``ContentState``. + * ``dispose()`` + * ``getDataStore()`` -* ContentState maintains all the information for an on going Transaction. +* ``ContentState`` maintains all the information for an on going Transaction. - * getEntry() - * getTransaction() - * setTransaction(Transaction) + * ``getEntry()`` + * ``getTransaction()`` + * ``setTransaction(Transaction)`` You can cache your generated schema and summary values here: - * getFeatureType() - * setFeatureType(SimpleFeatureType) - * getCount() - * setCount(int) - * getBounds() - * setBounds(ReferencedEnvelope) + * ``getFeatureType()`` + * ``setFeatureType(SimpleFeatureType)`` + * ``getCount()`` + * ``setCount(int)`` + * ``getBounds()`` + * ``setBounds(ReferencedEnvelope)`` - Listener information is gathered here where your FeatureStore can delegate to it. + Listener information is gathered here where your ``FeatureStore`` can delegate to it. You can call these methods as modifications are made to your data. - * addListener(FeatureListener) - * removeListener(FeatureListener) - * getBatchFeatureEvent() - * hasListener() - * fireFeatureUpdated(FeatureSource, Feature, ReferencedEnvelope) - * fireFeatureAdded(FeatureSource, Feature) - * fireFeatureRemoved(FeatureSource, Feature) - * fireFeatureEvent(FeatureEvent) - * fireBatchFeatureEvent(boolean) + * ``addListener(FeatureListener)`` + * ``removeListener(FeatureListener)`` + * ``getBatchFeatureEvent()`` + * ``hasListener()`` + * ``fireFeatureUpdated(FeatureSource, Feature, ReferencedEnvelope)`` + * ``fireFeatureAdded(FeatureSource, Feature)`` + * ``fireFeatureRemoved(FeatureSource, Feature)`` + * ``fireFeatureEvent(FeatureEvent)`` + * ``fireBatchFeatureEvent(boolean)`` Care and feeding: - * flush() - * close() - * copy() - used when copying the Transaction.AUTO_COMMIT ContentState at the start of a Transaction + * ``flush()`` + * ``close()`` + * ``copy()`` - used when copying the ``Transaction.AUTO_COMMI`` ``ContentState`` at the start of a ``Transaction`` DirectoryDataStore ^^^^^^^^^^^^^^^^^^ -DirectoryDataStore is used to allow file based datastores (such as shapefile) to smoothly represent a directory of files in one fell swoop. +``DirectoryDataStore`` is used to allow file based ``DataStores`` (such as shapefile) to smoothly represent a directory of files in one fell swoop. -Here is an example for "csv" files:: +Here is an example for "CSV" files:: /** Extend a CSVDataStoreFactory for a Directory of files */ public class CSVDirectoryFactory extends CSVDataStoreFactory { diff --git a/docs/user/library/data/memory.rst b/docs/user/library/data/memory.rst index 162d5b2c6b0..aaea4236a92 100644 --- a/docs/user/library/data/memory.rst +++ b/docs/user/library/data/memory.rst @@ -1,11 +1,11 @@ -MemoryDataStore ---------------- +``MemoryDataStore`` +-------------------- -We do have one MemoryDataStore suitable for storing temporary information in memory prior to saving it out to disk. +We do have one ``MemoryDataStore`` suitable for storing temporary information in memory prior to saving it out to disk. Please be advised that it is set up to accurately mirror information being located on disk and is not performant in any way. That said it works; and is pretty easy to stuff your data into. -This implementation is actually offered by the **gt-main** module, it is being documented here for consistency. +This implementation is actually offered by the **``gt-main``** module, it is being documented here for consistency. References: @@ -15,9 +15,9 @@ References: Create ^^^^^^ -MemoryDataStore is not fast - it is for testing. Why is it not fast do you ask? Because we use it to be strict and model what working with an external service is like (as such it is going to copy your data again and again and again). +``MemoryDataStore`` is not fast - it is for testing. Why is it not fast do you ask? Because we use it to be strict and model what working with an external service is like (as such it is going to copy your data again and again and again). -Unlike most DataStores we will be creating this one by hand, rather than using a factory.:: +Unlike most ``DataStores`` we will be creating this one by hand, rather than using a factory.:: MemoryDataStore memory = new MemoryDataStore(); @@ -37,12 +37,12 @@ Unlike most DataStores we will be creating this one by hand, rather than using a * Q: Given me something faster The :doc:`gt-main DataUtilities<../main/data>` offers several high performance alternatives to - MemoryDataStore. + ``MemoryDataStore``. Examples ^^^^^^^^ -* Using a Memory DataStore to alter content. +* Using a ``MemoryDataStore`` to alter content. Thanks to Mau Macros for the following example: diff --git a/docs/user/library/data/mongodb.rst b/docs/user/library/data/mongodb.rst index 9f35786e2d4..c137a673040 100644 --- a/docs/user/library/data/mongodb.rst +++ b/docs/user/library/data/mongodb.rst @@ -1,4 +1,4 @@ -Mongodb Plugin +MongoDB Plugin -------------- MongoDB is a popular documentation database. This plugin provides read-write @@ -14,8 +14,9 @@ access to appropriately indexed collections. To publish a collection: -* A compliant collection must have one or more spatial indexes of type 2dsphere. - Any collection without an indexed field of type 2dsphere will be ignored. +* A compliant collection must have one or more spatial indexes of type + ``2dsphere``. + Any collection without an indexed field of type ``2dsphere`` will be ignored. * When examining compliant collections, the schema store will be queried for an existing schema by using the collection name as the schema name. If a schema @@ -27,16 +28,16 @@ To publish a collection: longitude/latitude. Therefore, the geometry attribute descriptor in a schema must specify EPSG:4326 as CRS (always true for inferred schemas). -* A new collection can be created using createSchema method. This should not be +* A new collection can be created using ``createSchema`` method. This should not be used to manually define a schema for an existing collection. Functionality ------------- -The MongoDataStore supports the use of MongoDB as a data store with the +The ``MongoDataStore`` supports the use of MongoDB as a data store with the following connection parameters: -* data_store: specifies the MongoDB instance and database to connect to. +* ``data_store``: specifies the MongoDB instance and database to connect to. This field requires a MongoDB client URI as specified by the MongoDB Manual. A typical URI will be of the form: :kbd:`mongodb://example.com:27017/database` . @@ -47,17 +48,17 @@ following connection parameters: credentials can be supplied with the MongoDB client URI, in the form: :kbd:`mongodb://username:password@example.com:27017/database` . -* schema_store: Designates the storage for inferred and manually defined +* ``schema_store``: Designates the storage for inferred and manually defined schemas. - This field can accept either a mongodb or file URI. The directory will be + This field can accept either a MongoDB or file URI. The directory will be created if it does not exist, in which case write permissions will be necessary. The database and collection names are optional. If missing, the database name - will default to geotools and the collection name to schemas. The database and + will default to ``geotools`` and the collection name to ``schemas``. The database and collection must be writable using the credentials provided with the URI. Schemas are stored as MongoDB documents or files adhering to the JSON schema format with - the schema "Type Name" (typeName) as the key. + the schema "Type Name" (``typeName``) as the key. * max_objs_schema: specifies the maximun integer number of JSON objects on the collection to be used in the schema generation process. @@ -72,12 +73,12 @@ JSON Schema Keep in mind: -* The valid GeoJSON geometry encodings are Point, LineString, - Polygon, MultiPoint, MultiLineString, MultiPolygon. GeoJSON multigeometry - variants are only supported for MongDB version 2.5 and newer. +* The valid GeoJSON geometry encodings are ``Point``, ``LineString``, + ``Polygon``, ``MultiPoint``, ``MultiLineString``, ``MultiPolygon``. GeoJSON multigeometry + variants are only supported for MongoDB version 2.5 and newer. -* The following Java equivalents of BSON types are valid: String, Double, Long, - Integer, Boolean, Date. +* The following Java equivalents of BSON types are valid: ``String``, ``Double``, ``Long``, + ``Integer``, ``Boolean``, ``Date``. For the following GeoJSON feature:: @@ -137,10 +138,10 @@ is described using the following schema:: File URI schema stores: -* For the directory-based schema store, edit the JSON document with the typeName +* For the directory-based schema store, edit the JSON document with the ``typeName`` requiring modification. - Schemas are written using createSchema() without indenting, but you can indent the + Schemas are written using ``createSchema()`` without indenting, but you can indent the resulting file for readability if desired. MongoDB URI schema stores: @@ -150,12 +151,12 @@ MongoDB URI schema stores: JSON schema format. The JSON files contained in the file schema store are in a format that can be - inserted into a MongoDB schema store (as long as the typeName in the file is + inserted into a MongoDB schema store (as long as the ``typeName`` in the file is unique to the document collection ). Multiple schemas, or views, can be created for a single MongoDB document - collection by creating a new, unique, typeName and specifying the collection - under the root-level userData object. + collection by creating a new, unique, ``typeName`` and specifying the collection + under the root-level ``userData`` object. Implementation Notes -------------------- @@ -165,20 +166,22 @@ Implementation Notes * Multigeometry support requires MongoDB versions 2.5 and newer * Self-intersecting polygons is a common data problem preventing - MongoDBDataStore from functioning. Please note that self-intersection + ``MongoDBDataStore`` from functioning. Please note that self-intersection may arise due to the transformation to WGS84 coordinates (which is a necessary preliminary step for importing data into MongoDB), even - if they did not exist in the original dataset. + if they did not exist in the original data set. -* All 2dsphere indexes and spatial operations assume the WGS84 datum. All +* All ``2dsphere`` indexes and spatial operations assume the WGS84 datum. All indexed GeoJSON data stored in a MongoDB document collection is assumed to be referenced with the WGS84 coordinate reference system. -* Native $or operator execution is automatically enabled when MongoDB detected version >= 2.6.0; + +* Native ``$or`` operator execution is automatically enabled when MongoDB detected version >= 2.6.0; if you run a lower version, native $or operator execution is automatically disabled. -* Within, Intersects and BBOX filters are implemented with $geoWithin and - $geoIntersects operations. These operations are limited when effected by +* ``Within``, ``Intersects`` and ``BBOX`` filters are implemented with + ``$geoWithin`` and + ``$geoIntersects`` operations. These operations are limited when effected by geometries spanning a hemisphere (and will use the smaller geometry). Usage Notes diff --git a/docs/user/library/data/ogr.rst b/docs/user/library/data/ogr.rst index 8d0dab0c372..67979af503f 100644 --- a/docs/user/library/data/ogr.rst +++ b/docs/user/library/data/ogr.rst @@ -15,7 +15,7 @@ There are two implementations of the OGR plugin. The first uses OGR's standard Your installation of GDAL/OGR needs to be compiled with Java support to use this module. -The other OGR plugin uses Bridj to create Java bindings to OGR. This version does not require +The other OGR plugin uses ``Bridj`` to create Java bindings to OGR. This version does not require GDAL/OGR to be compiled with Java support. **Maven**:: @@ -26,11 +26,11 @@ GDAL/OGR to be compiled with Java support. ${geotools.version} -The OGR DataStore does require the GDAL/OGR native library. Once installed you need to add the location to your PATH on Windows, DYLD_LIBRARY_PATH on Mac, and LD_LIBRARY_PATH on Linux. If you use gt-ogr-bridj and the dll/dylib/so file is not named gdal you will need to set the GDAL_LIBRARY_NAME. Often it is something like gdal10 depending on the version of GDAL you installed. You will also have to set the java.library.path to the GDAL's location when running your program. +The OGR DataStore does require the GDAL/OGR native library. Once installed you need to add the location to your ``PATH`` on Windows, ``DYLD_LIBRARY_PATH`` on Mac, and ``LD_LIBRARY_PATH`` on Linux. If you use ``gt-ogr-bridj`` and the ``dll``/``dylib``/``so`` file is not named ``gdal`` you will need to set the ``GDAL_LIBRARY_NAME``. Often it is something like ``gdal10`` depending on the version of GDAL you installed. You will also have to set the ``java.library.path`` to the GDAL location when running your program. -You can then access the module by creating a DataStoreFactory. +You can then access the module by creating a ``DataStoreFactory``. -If you are using Bridj:: +If you are using ``Bridj``:: OGRDataStoreFactory factory = new BridjOGRDataStoreFactory(); @@ -47,9 +47,9 @@ You can list available drivers:: To connect to an OGR layer there are two parameters: -* DriverName = The name of the OGR Driver (http://www.gdal.org/ogr_formats.html). +* ``DriverName`` = The name of the OGR Driver (http://www.gdal.org/ogr_formats.html). -* DataSourceName = The name of the file or data source connection. This value depends on what driver you are using. +* ``DataSourceName`` = The name of the file or data source connection. This value depends on what driver you are using. Here is how you would read a shapefile:: diff --git a/docs/user/library/data/pregeneralized.rst b/docs/user/library/data/pregeneralized.rst index 5c91bf8fc36..43f1924bd09 100644 --- a/docs/user/library/data/pregeneralized.rst +++ b/docs/user/library/data/pregeneralized.rst @@ -1,7 +1,7 @@ Pregeneralized Plugin --------------------- -This plugin offers the the possibility to use pregeneralized features to reduce CPU and memory +This plugin offers the possibility to use pregeneralized features to reduce CPU and memory usage at runtime. The effect is used to improve the response time for client code. This is an advanced plugin that is great for eking the greatest performance out of the GeoTools @@ -25,31 +25,31 @@ Consider it something like an image pyramid for raster data operating at differe Connection Parameters ^^^^^^^^^^^^^^^^^^^^^ -+---------------------------------------+-----------------------------------------------------+ -| Parameter | Description | -+=======================================+=====================================================+ -|"RepositoryClassName" | Class name for the Repository implementation, | -| | must have a default Constructor | -+---------------------------------------+-----------------------------------------------------+ -|"GeneralizationInfosProviderClassName" | Class name for a GeneralizationInfosProvider | -| | must have a default Constructor | -+---------------------------------------+-----------------------------------------------------+ -|"GeneralizationInfosProviderParam" | Optional Parameter for getGeneralizationInfos(obj) | -+---------------------------------------+-----------------------------------------------------+ -|"namespace" | Optional, an URI for an optional name space | -+---------------------------------------+-----------------------------------------------------+ ++------------------------------------------+--------------------------------------------------------+ +| Parameter | Description | ++==========================================+========================================================+ +| ``RepositoryClassName`` | Class name for the Repository implementation, | +| | must have a default Constructor | ++------------------------------------------+--------------------------------------------------------+ +| ``GeneralizationInfosProviderClassName`` | Class name for a ``GeneralizationInfosProvider`` | +| | must have a default Constructor | ++------------------------------------------+--------------------------------------------------------+ +| ``GeneralizationInfosProviderParam`` | Optional Parameter for ``getGeneralizationInfos(obj)`` | ++------------------------------------------+--------------------------------------------------------+ +| ``namespace`` | Optional, an URI for an optional name space | ++------------------------------------------+--------------------------------------------------------+ Pregeneralized ^^^^^^^^^^^^^^ Before we start we need couple of things: -* Repository - used to look up featureSource implementations. See :doc:`gt-main repository <../main/repository>` page. -* GeneralizationInfos - configuration for PreGeneralizedDataStore describing generalisation method used. +* Repository - used to look up ``featureSource`` implementations. See :doc:`gt-main repository <../main/repository>` page. +* ``GeneralizationInfos`` - configuration for ``PreGeneralizedDataStore`` describing generalization method used. -To create a **PreGeneralizedDataStore**: +To create a ``reGeneralizedDataStore`` -* As usual we recommend use of **DataStoreFinder** (as this plugin provides **PreGeneralizedDataStoreFactory** for it to use).:: +* As usual we recommend use of ``DataStoreFinder`` (as this plugin provides ``PreGeneralizedDataStoreFactory`` for it to use).:: Map paramMap = new HashMap(); DataStore ds = null; @@ -65,7 +65,7 @@ To create a **PreGeneralizedDataStore**: FeatureSource fs = ds.getFeatureSource("GenStreams") To benefit from less memory usage and less CPU consumption the usage of - Hints.GEOMETRY_DISTANCE is required. It is possible to pass hints to a + ``Hints.GEOMETRY_DISTANCE`` is required. It is possible to pass hints to a query object, an example for reading all features with geometries fitting for a generalization of 22 meters:: @@ -80,7 +80,7 @@ To create a **PreGeneralizedDataStore**: // business as usual, but with generalized geometries! // -* Creating by hand using RepositoryDSFinder:: +* Creating by hand using ``RepositoryDSFinder``:: Repository repo = new RepositoryDSFinder(); GeneralizationInfosProvider provider = new GeneralizationInfosProviderImpl(); @@ -93,7 +93,7 @@ To create a **PreGeneralizedDataStore**: DataStore ds = new PreGeneralizedDataStore(infos,repo) FeatureSource fs = ds.getFeatureSource("GenStreams") -* Creating by hand using DefaultRepository:: +* Creating by hand using ``DefaultRepository``:: Repository repo = new DefaultRepository(); // @@ -117,7 +117,7 @@ This section has sample XML configuration files with corresponding physical layo XML ''' -Part of this java package is a GeneralizationInfosProviderImpl which offers the possibility to configure a GeneralizationInfos object in XML syntax. +Part of this Java package is a ``GeneralizationInfosProviderImpl`` which offers the possibility to configure a ``GeneralizationInfos`` object in XML syntax. Code example:: @@ -172,17 +172,17 @@ Physical Layout Definition: The **Base Feature** is the original feature which is the starting point -A geometry generalized to m meters will be written as g(m) , e. g. g(5) is a +A geometry generalized to m meters will be written as ``g(m)``, e.g. ``g(5)`` is a geometry generalized to a minimum distance of 5 meters. The original geometry will -be written as g(1) +be written as ``dq(1)``. A feature has the following components -1. FID (Feature Identifier) +1. ``FID`` (Feature Identifier) 2. a set of data attributes 3. a set of geometry attributes (mostly only one, depending on the data store) -For the following example we will use the **streams.shp** from the gt-sample-data jar (which contains sample data for test cases). +For the following example we will use the ``streams.shp`` from the ``gt-sample-data`` jar (which contains sample data for test cases). * :download:`streams.shp ` * :download:`streams.dbf ` @@ -193,11 +193,11 @@ This shapefile has the following feature type structure: * streams - +-----+--------+-----------+------------+ - | FID | CAT_ID | CAT_DESCR | the_geom | - +=====+========+===========+============+ - | int | int | int | linestring | - +-----+--------+-----------+------------+ + +---------+------------+---------------+----------------+ + | ``FID`` | ``CAT_ID`` | ``CAT_DESCR`` | ``the_geom`` | + +=========+============+===============+================+ + | ``int`` | ``int`` | ``int`` | ``linestring`` | + +---------+------------+---------------+----------------+ We have two alternatives for how to represent generalized feature: @@ -207,114 +207,116 @@ We have two alternatives for how to represent generalized feature: * streams - +-----------+--------+-----------+------------+ - | FID | CAT_ID | CAT_DESCR | the_geom | - +===========+========+===========+============+ - | streams.1 | 1 | 4711 | g1(1) | - +-----------+--------+-----------+------------+ - | streams.2 | 2 | 4712 | g2(1) | - +-----------+--------+-----------+------------+ - | ... | ... | ... | .. | - +-----------+--------+-----------+------------+ + +---------------+------------+---------------+----------------+ + | ``FID`` | ``CAT_ID`` | ``CAT_DESCR`` | ``the_geom`` | + +===============+============+===============+================+ + | ``streams.1`` | ``1`` | ``4711`` | ``g1(1)`` | + +---------------+------------+---------------+----------------+ + | ``streams.2`` | ``2`` | ``4712`` | ``g2(1)`` | + +---------------+------------+---------------+----------------+ + | ... | ... | ... | .. | + +---------------+------------+---------------+----------------+ * streams_5 - +-----------+--------+-----------+------------+ - | FID | CAT_ID | CAT_DESCR | the_geom | - +===========+========+===========+============+ - | streams.1 | 1 | 4711 | g1(5) | - +-----------+--------+-----------+------------+ - | streams.2 | 2 | 4712 | g2(5) | - +-----------+--------+-----------+------------+ - | ... | ... | ... | .. | - +-----------+--------+-----------+------------+ + +---------------+------------+---------------+----------------+ + | ``FID`` | ``CAT_ID`` | ``CAT_DESCR`` | ``the_geom`` | + +===============+============+===============+================+ + | ``streams.1`` | ``1`` | ``4711`` | ``g1(5)`` | + +---------------+------------+---------------+----------------+ + | ``streams.2`` | ``2`` | ``4712`` | ``g2(5)`` | + +---------------+------------+---------------+----------------+ + | ... | ... | ... | .. | + +---------------+------------+---------------+----------------+ * streams_10 - +-----------+--------+-----------+------------+ - | FID | CAT_ID | CAT_DESCR | the_geom | - +===========+========+===========+============+ - | streams.1 | 1 | 4711 | g1(10) | - +-----------+--------+-----------+------------+ - | streams.2 | 2 | 4712 | g2(10) | - +-----------+--------+-----------+------------+ - | ... | ... | ... | .. | - +-----------+--------+-----------+------------+ + +---------------+------------+---------------+----------------+ + | ``FID`` | ``CAT_ID`` | ``CAT_DESCR`` | ``the_geom`` | + +===============+============+===============+================+ + | ``streams.1`` | ``1`` | ``4711`` | ``g1(10)`` | + +---------------+------------+---------------+----------------+ + | ``streams.2`` | ``2`` | ``4712`` | ``g2(10)`` | + +---------------+------------+---------------+----------------+ + | ... | ... | ... | .. | + +---------------+------------+---------------+----------------+ * streams_20 - +-----------+--------+-----------+------------+ - | FID | CAT_ID | CAT_DESCR | the_geom | - +===========+========+===========+============+ - | streams.1 | 1 | 4711 | g1(20) | - +-----------+--------+-----------+------------+ - | streams.2 | 2 | 4712 | g2(20) | - +-----------+--------+-----------+------------+ - | ... | ... | ... | .. | - +-----------+--------+-----------+------------+ + +---------------+------------+---------------+----------------+ + | ``FID`` | ``CAT_ID`` | ``CAT_DESCR`` | ``the_geom`` | + +===============+============+===============+================+ + | ``streams.1`` | ``1`` | ``4711`` | ``g1(20)`` | + +---------------+------------+---------------+----------------+ + | ``streams.2`` | ``2`` | ``4712`` | ``g2(20)`` | + +---------------+------------+---------------+----------------+ + | ... | ... | ... | .. | + +---------------+------------+---------------+----------------+ + * streams_50 - +-----------+--------+-----------+------------+ - | FID | CAT_ID | CAT_DESCR | the_geom | - +===========+========+===========+============+ - | streams.1 | 1 | 4711 | g1(50) | - +-----------+--------+-----------+------------+ - | streams.2 | 2 | 4712 | g2(50) | - +-----------+--------+-----------+------------+ - | ... | ... | ... | .. | - +-----------+--------+-----------+------------+ - - The only difference between these 5 feature sets are the geometries, - which are generalized by 5,10,20 and 50 meters respectively. - - As you can see this approach results in a fair amount of duplication. - - * GenStreams + +---------------+------------+---------------+----------------+ + | ``FID`` | ``CAT_ID`` | ``CAT_DESCR`` | ``the_geom`` | + +===============+============+===============+================+ + | ``streams.1`` | ``1`` | ``4711`` | ``g1(50)`` | + +---------------+------------+---------------+----------------+ + | ``streams.2`` | ``2`` | ``4712`` | ``g2(50)`` | + +---------------+------------+---------------+----------------+ + | ... | ... | ... | .. | + +---------------+------------+---------------+----------------+ + - A new Feature feature type is hiding all other features and using them - dependent on the GEOMETRY_DISTANCE hint. + The only difference between these 5 feature sets are the geometries, + which are generalized by 5,10,20 and 50 meters respectively. - +-----+--------+-----------+------------+ - | FID | CAT_ID | CAT_DESCR | the_geom | - +=====+========+===========+============+ - | int | int | int | linestring | - +-----+--------+-----------+------------+ - - The disadvantage is the duplication of all attribute values for each - generalization. If the features are stored as shape files, there is no - other alternative because shape files allow only one geometry. - - Storing the features in a database offers the possibility to use SQL views - to avoiding this redundancy. + As you can see this approach results in a fair amount of duplication. + + * ``GenStreams`` + + A new Feature feature type is hiding all other features and using them + dependent on the GEOMETRY_DISTANCE hint. + + +---------+------------+---------------+----------------+ + | ``FID`` | ``CAT_ID`` | ``CAT_DESCR`` | ``the_geom`` | + +=========+============+===============+================+ + | ``int`` | ``int`` | ``int`` | ``linestring`` | + +---------+------------+---------------+----------------+ + + The disadvantage is the duplication of all attribute values for each + generalization. If the features are stored as shape files, there is no + other alternative because shape files allow only one geometry. + + Storing the features in a database offers the possibility to use SQL views + to avoiding this redundancy. -* Horizontal layout - - The generalized geometries were added as additional attributes. - - * streams + * Horizontal layout + + The generalized geometries were added as additional attributes. - +-----------+--------+-----------+--------+----------+-----------+-----------+----------+ - | FID | CAT_ID | CAT_DESCR |the_geom|the_geom_5|the_geom_10|the_geom_20|the_geom50| - +===========+========+===========+========+==========+===========+===========+==========+ - | streams.1 | 1 | 4711 | g1(1) | g1(5) | g1(10) | g1(20) | g1(5) | - +-----------+--------+-----------+--------+----------+-----------+-----------+----------+ - | streams.2 | 2 | 4712 | g2(1) | g2(5) | g2(10) | g2(20) | g2(5) | - +-----------+--------+-----------+--------+----------+-----------+-----------+----------+ - | ... | ... | ... | .. | ... |... | ... | ... | - +-----------+--------+-----------+--------+----------+-----------+-----------+----------+ - - * GenStreams + * streams + + +---------------+------------+---------------+--------------+----------------+-----------------+-----------------+----------------+ + | ``FID`` | ``CAT_ID`` | ``CAT_DESCR`` | ``the_geom`` | ``the_geom_5`` | ``the_geom_10`` | ``the_geom_20`` | ``the_geom50`` | + +===============+============+===============+==============+================+=================+=================+================+ + | ``streams.1`` | ``1`` | ``4711`` | ``g1(1)`` | ``g1(5)`` | ``g1(10)`` | ``g1(20)`` | ``g1(5)`` | + +---------------+------------+---------------+--------------+----------------+-----------------+-----------------+----------------+ + | ``streams.2`` | ``2`` | ``4712`` | ``g2(1)`` | ``g2(5)`` | ``g2(10)`` | ``g2(20)`` | ``g2(5)`` | + +---------------+------------+---------------+--------------+----------------+-----------------+-----------------+----------------+ + | ... | ... | ... | ... | ... | ... | ... | ... | + +---------------+------------+---------------+--------------+----------------+-----------------+-----------------+----------------+ + + * ``GenStreams`` Again, there is a new feature - +-----+--------+-----------+------------+ - | FID | CAT_ID | CAT_DESCR | the_geom | - +=====+========+===========+============+ - | int | int | int | linestring | - +-----+--------+-----------+------------+ + +---------+------------+---------------+----------------+ + | ``FID`` | ``CAT_ID`` | ``CAT_DESCR`` | ``the_geom`` | + +=========+============+===============+================+ + | ``int`` | ``int`` | ``int`` | ``linestring`` | + +---------+------------+---------------+----------------+ The generalized geometry attributes are hidden and are not part of the - GenStreams feature type. + ``GenStreams`` feature type. * Mixed layout @@ -322,63 +324,63 @@ We have two alternatives for how to represent generalized feature: * streams - +-----------+--------+-----------+------------+ - | FID | CAT_ID | CAT_DESCR | the_geom | - +===========+========+===========+============+ - | streams.1 | 1 | 4711 | g1(1) | - +-----------+--------+-----------+------------+ - | streams.2 | 2 | 4712 | g2(1) | - +-----------+--------+-----------+------------+ - | ... | ... | ... | .. | - +-----------+--------+-----------+------------+ + +---------------+------------+---------------+----------------+ + | ``FID`` | ``CAT_ID`` | ``CAT_DESCR`` | ``the_geom`` | + +===============+============+===============+================+ + | ``streams.1`` | ``1`` | ``4711`` | ``g1(1)`` | + +---------------+------------+---------------+----------------+ + | ``streams.2`` | ``2`` | ``4712`` | ``g2(1)`` | + +---------------+------------+---------------+----------------+ + | ... | ... | ... | .. | + +---------------+------------+---------------+----------------+ * streams_5_10 - +-----------+--------+-----------+------------+------------+ - | FID | CAT_ID | CAT_DESCR | the_geom_5 | the_geom10 | - +===========+========+===========+============+============+ - | streams.1 | 1 | 4711 | g1(5) | g1(10) | - +-----------+--------+-----------+------------+------------+ - | streams.2 | 2 | 4712 | g2(5) | g2(10) | - +-----------+--------+-----------+------------+------------+ - | ... | ... | ... | .. | ... | - +-----------+--------+-----------+------------+------------+ + +---------------+------------+---------------+----------------+-----------------+ + | ``FID`` | ``CAT_ID`` | ``CAT_DESCR`` | ``the_geom_5`` | ``the_geom_10`` | + +===============+============+===============+================+=================+ + | ``streams.1`` | ``1`` | ``4711`` | ``g1(5)`` | ``g1(10)`` | + +---------------+------------+---------------+----------------+-----------------+ + | ``streams.2`` | ``2`` | ``4712`` | ``g2(5)`` | ``g2(10)`` | + +---------------+------------+---------------+----------------+-----------------+ + | ... | ... | ... | .. | .. | + +---------------+------------+---------------+----------------+-----------------+ * streams_20_50 - +-----------+--------+-----------+------------+-------------+ - | FID | CAT_ID | CAT_DESCR | the_geom_20| the_geom_50 | - +===========+========+===========+============+=============+ - | streams.1 | 1 | 4711 | g1(10) | g1(50) | - +-----------+--------+-----------+------------+-------------+ - | streams.2 | 2 | 4712 | g2(10) | g2(50) | - +-----------+--------+-----------+------------+-------------+ - | ... | ... | ... | .. | ... | - +-----------+--------+-----------+------------+-------------+ - - * GenStreams + +---------------+------------+---------------+-----------------+-----------------+ + | ``FID`` | ``CAT_ID`` | ``CAT_DESCR`` | ``the_geom_20`` | ``the_geom_50`` | + +===============+============+===============+=================+=================+ + | ``streams.1`` | ``1`` | ``4711`` | ``g1(20)`` | ``g1(50)`` | + +---------------+------------+---------------+-----------------+-----------------+ + | ``streams.2`` | ``2`` | ``4712`` | ``g2(20)`` | ``g2(50)`` | + +---------------+------------+---------------+-----------------+-----------------+ + | ... | ... | ... | ... | ... | + +---------------+------------+---------------+-----------------+-----------------+ + + * ``GenStreams`` - +-----+--------+-----------+------------+ - | FID | CAT_ID | CAT_DESCR | the_geom | - +=====+========+===========+============+ - | int | int | int | linestring | - +-----+--------+-----------+------------+ + +---------+------------+---------------+----------------+ + | ``FID`` | ``CAT_ID`` | ``CAT_DESCR`` | ``the_geom`` | + +=========+============+===============+================+ + | ``int`` | ``int`` | ``int`` | ``linestring`` | + +---------+------------+---------------+----------------+ - Independent of the used physical layout, the feature type of GenStreams + Independent of the physical layout used, the feature type of ``GenStreams`` is always the same. All other feature types are not visible and are - called backend features. + called back end features. Toolbox ^^^^^^^ Included in this packages is a command line utility. Locate the jar file, the name is -"gt-feature-pregeneralized-.jar Assuming the version is "2.5-SNAPSHOT", call with:: +``gt-feature-pregeneralized-.jar`` Assuming the version is ``2.5-SNAPSHOT``, call with:: java -jar gt-feature-pregeneralized-2.5-SNAPSHOT.jar -* Validating the xml config file +* Validating the XML configuration file - You can validate your xml config file with:: + You can validate your XML configuration file with:: java -jar gt-feature-pregeneralized-2.5-SNAPSHOT.jar validate myconfig.xml @@ -390,15 +392,15 @@ Included in this packages is a command line utility. Locate the jar file, the na In the above example the parameters are: - * streams.shp + * ``streams.shp`` The source shape file - * targetDir + * ``targetDir`` The directory where to store the generalized shape files - * 15.0,30 + * ``15.0,30`` A comma separated list of distances (integer or doubles, decimal separator is "."). - This example would generate a sub directory "15.0" and a sub directory - "30" in the target directory. The sub + This example would generate a sub-directory ``15.0`` and a sub directory + ``30`` in the target directory. Background ^^^^^^^^^^ @@ -407,7 +409,7 @@ Background Spatial features have a least one geometry, which mostly contains a large number of points. As an example, the border of Austria (which is a small country) is a polygon constructed - from 380000 points. + from 380,000 points. Drawing this border on a screen with a resolution of 1280x1024 will draw each pixel many,many times. The same holds true for printing on a sheet of paper. @@ -419,44 +421,44 @@ Background The idea is to have a data store / feature source / feature reader implementation which acts as wrapper for the original features and their generalized geometries. Additionally there is a new - Hint GEOMETRY_DISTANCE which has a value for the minimum distance between two points required. + ``Hint`` ``GEOMETRY_DISTANCE`` which has a value for the minimum distance between two points required. - This Hint can be passed within the Query object. + This ``Hint`` can be passed within the ``Query`` object. - The wrappers itself behave like the original objects, except returning geometries dependent on the + The wrapper itself behaves like the original object, except returning geometries dependent on the new hint. If no hint is given, the original geometries are returned. -* Relationship between GEOMETRY_DISTANCE and generalized geometries +* Relationship between ``GEOMETRY_DISTANCE`` and generalized geometries Assume the original geometries have an accuracy of 1 meter and we have generalizations for all geometries with 5m, 10m, 20m and 50m. - =========================== ===================================== - Requested Distance (dist) Returned geometry - =========================== ===================================== - dist < 5 original geometry - 5 <= dist < 10 geometry generalized to 5 m - 10 <= dist < 20 geometry generalized to 10 m - 20 <= dist < 50 geometry generalized to 20 m - 50 <= dist geometry generalized to 50 m - =========================== ===================================== + =============================== ===================================== + Requested Distance (``dist``) Returned geometry + =============================== ===================================== + ``dist`` < 5 original geometry + 5 <= ``dist`` < 10 geometry generalized to 5 m + 10 <= ``dist`` < 20 geometry generalized to 10 m + 20 <= ``dist`` < 50 geometry generalized to 20 m + 50 <= ``dist`` geometry generalized to 50 m + =============================== ===================================== * Conclusion The focus of this module is to support the transparent handling of generalized geometries. - There is no restriction how the GeneralizationInfos object is build and how the needed data + There is no restriction how the ``GeneralizationInfos`` object is build and how the needed data stores are found. The two interfaces - * org.geotools.data.Repository - * org.geotools.data.gen.info.GeneralizationInfosProvider + * ``org.geotools.data.Repository`` + * ``org.geotools.data.gen.info.GeneralizationInfosProvider`` - Allow special implementations to be plugged in. As an example, a GeneralizationInfosProvider + Allow special implementations to be plugged in. As an example, a ``GeneralizationInfosProvider`` implementation can build the configuration data from a jdbc database, getting as parameter a JNDI name. - Once again, modification of pregeneralized features is NOT possible. + Once again, modification of pregeneralized features is **NOT** possible. DataStructure ^^^^^^^^^^^^^ @@ -468,38 +470,38 @@ Internally the following data structure is set up. GeneralizationInfos ''''''''''''''''''' -Each PreGeneralizedDataStore has exactly one object of type GeneralizationInfos. +Each ``PreGeneralizedDataStore`` has exactly one object of type ``GeneralizationInfos``. -**GeneralizationInfos** holds a collection of **GeneralizationInfo** objects. The -size of this collection is equal to the number of PreGeneralizedFeatureSource objects +``GeneralizationInfos`` holds a collection of ``GeneralizationInfo`` objects. The +size of this collection is equal to the number of ``PreGeneralizedFeatureSource`` objects contained in the data store. -* infoMap - mapping from names of generalized features to the orresponding GeneralizationInfo objects -* dataSourceName - Optional, default data source location for all GeneralizationInfo objects -* dataSourceNameSpace - Optional, name space for the default data source location +* ``infoMap`` - mapping from names of generalized features to the corresponding ``GeneralizationInfo`` objects +* ``dataSourceName`` - Optional, default data source location for all ``GeneralizationInfo`` objects +* ``dataSourceNameSpace`` - Optional, name space for the default data source location GeneralizationInfo ''''''''''''''''''' -A GeneralizationInfo holds the configuration information for one feature type and his generalized geometries. +A ``GeneralizationInfo`` holds the configuration information for one feature type and his generalized geometries. -* featureName - Name of the generalized feature ("GenStreams") -* baseFeatureName - Name of the base feature ("streams") -* geomPropertyName - Name of the geometry attribute in the base feature ("the_geom") -* generalizations - Collection of org.geotools.data.gen.Generalization objects -* dataSourceName - Location of the datasource for the base Feature (URL of shape file) - If no location is given, use location from GeneralizationInfos parent object. -* dataSourceNameSpace - Optional, name space for the dataSourceName +* ``featureName`` - Name of the generalized feature (``GenStreams``) +* ``baseFeatureName`` - Name of the base feature (``streams``) +* ``geomPropertyName`` - Name of the geometry attribute in the base feature (``the_geom``) +* ``generalizations`` - Collection of ``org.geotools.data.gen.Generalization`` objects +* ``dataSourceName`` - Location of the data source for the base ``Feature`` (URL of shape file) + If no location is given, use location from ``GeneralizationInfos`` parent object. +* ``dataSourceNameSpace`` - Optional, name space for the ``dataSourceName`` Generalization '''''''''''''' -A Generalization object belongs to a GeneralizationInfo object and holds information for geometries +A ``Generalization`` object belongs to a ``GeneralizationInfo`` object and holds information for geometries generalized to a given distance. -* distance - The generalization distance -* featureName - The the name of the feature containing these geometries ("streams_5_10") -* geomPropertyName - The name of the geometry property ("the_geom_5") -* dataSourceName - Optional, if not specified, dataSoureName from the GeneralizationInfo parent object is used. -* dataSourceNameSpace - Optional, name space for the dataSourceName +* ``distance`` - The generalization distance +* ``featureName`` - The name of the feature containing these geometries (``streams_5_10``) +* ``geomPropertyName`` - The name of the geometry property (``the_geom_5``) +* ``dataSourceName`` - Optional, if not specified, ``dataSoureName`` from the ``GeneralizationInfo`` parent object is used. +* ``dataSourceNameSpace`` - Optional, name space for the ``dataSourceName`` Repository ^^^^^^^^^^ @@ -507,24 +509,24 @@ Repository Prior to creating a pregeneralized data store an object implementing the interface Repository is needed. This class is document in :doc:`gt-main repository <../main/repository>` page. -For PregeneralizedDataStore this interface has one important method +For ``PregeneralizedDataStore`` this interface has one important method -* public DataStore dataStore(Name name) +* ``public DataStore dataStore(Name name)`` A Name object has a local name and a namespace (which could be null). -The local name corresponds to the dataSoureName property in the GeneralizationInfos, -GeneralizationInfo and Generalization objects. The same holds true for the namespace parameter -and the dataSourceNameSpace property. +The local name corresponds to the ``dataSoureName`` property in the ``GeneralizationInfos``, +``GeneralizationInfo`` and ``Generalization`` objects. The same holds true for the namespace parameter +and the ``dataSourceNameSpace`` property. -The content of the dataSourceName could be a registered name for a datastore (of course) +The content of the ``dataSourceName`` could be a registered name for a datastore (of course) or an URL to a shape file,an URL to a property file containing connect parameters for a database or anything else. It depends on the implementation of the Repository interface. -Included in this package is an implementation org.getotools.data.gen.DSFinderRepository, -which interprets a dataSoureName ending with ".shp" or ".SHP" as location of a shape file -and anything else as a property file. This implementation will use the geotools -DataStoreFinder.getDataStore(Map params) method to find the needed data store. +Included in this package is an implementation ``org.getotools.data.gen.DSFinderRepository``, +which interprets a ``dataSoureName`` ending with ``.shp`` or ``.SHP`` as location of a shape file +and anything else as a property file. This implementation will use the GeoTools +``DataStoreFinder.getDataStore(Map params)`` method to find the needed data store. -Another existing Implementation is org.geotools.data.DefaultRepository which is useful -for creating the data stores in the application and registering them with the corresponding names. \ No newline at end of file +Another existing Implementation is ``org.geotools.data.DefaultRepository`` which is useful +for creating the data stores in the application and registering them with the corresponding names. diff --git a/docs/user/library/data/shape.rst b/docs/user/library/data/shape.rst index 678b55dfe0f..18559456f8a 100644 --- a/docs/user/library/data/shape.rst +++ b/docs/user/library/data/shape.rst @@ -22,40 +22,42 @@ Connection Parameters The following connection parameters are available: -+-------------------------+----------------------------------------------------+ -| Param | Description | -+=========================+====================================================+ -| "url" | A URL of the file ending in "shp" | -+-------------------------+----------------------------------------------------+ -| "namespace" | Optional: URI to use for the FeatureType | -+-------------------------+----------------------------------------------------+ -| "create spatial index" | Optional: Use Boolean.TRUE to create an index | -+-------------------------+----------------------------------------------------+ -| "charset" | Optional: Charset used to decode strings in the | -| | DBF file | -+-------------------------+----------------------------------------------------+ -| "timezone" | Optional: Timezone used to parse dates in the | -| | DBF file | -+-------------------------+----------------------------------------------------+ -| "memory mapped buffer" | Optional: memory map the files (not recommended | -| | for large files under windows, defaults to false) | -+------------------------------------------------------------------------------+ -| "cache memory maps" | Optional: when memory mapping, cache and reuse | -| | memory maps (defaults to true) | -+------------------------------------------------------------------------------+ -| "create spatial index" | Optional: if false, won't try to create a spatial | -| | index if missing (defaults to true) | -+------------------------------------------------------------------------------+ -| "enable spatial index" | Optional: if false, the spatial index won't be used| -| | even if available (and won't be created if missing | -+-------------------------+----------------------------------------------------+ ++--------------------------+---------------------------------------------------+ +| Parameter | Description | ++==========================+===================================================+ +| ``url`` | A URL of the file ending in ``shp`` | ++--------------------------+---------------------------------------------------+ +| ``namespace`` | Optional: URI to use for the ``FeatureType`` | ++--------------------------+---------------------------------------------------+ +| ``create spatial index`` | Optional: Use ``Boolean.TRUE`` to create an index | ++--------------------------+---------------------------------------------------+ +| ``charset`` | Optional: ``Charset`` used to decode strings in | +| | the DBF file | ++--------------------------+---------------------------------------------------+ +| ``timezone`` | Optional: Timezone used to parse dates in the | +| | DBF file | ++--------------------------+---------------------------------------------------+ +| ``memory mapped buffer`` | Optional: memory map the files (not recommended | +| | for large files under windows, defaults to false) | ++--------------------------+---------------------------------------------------+ +| ``cache memory maps`` | Optional: when memory mapping, cache and reuse | +| | memory maps (defaults to true) | ++--------------------------+---------------------------------------------------+ +| ``create spatial index`` | Optional: if false, won't try to create a spatial | +| | index if missing (defaults to true) | ++--------------------------+---------------------------------------------------+ +| ``enable spatial index`` | Optional: if false, the spatial index won't be | +| | used even if available (and won't be created if | +| | missing. | ++--------------------------+---------------------------------------------------+ This information is also in the `javadocs `_ . -Internally gt-shape provides a two implementations at this time; one for simple access and another that supports the use of an index. The factory will -be able to sort out which one is appropriate when using DataStoreFinder or FileDataStoreFinder. +Internally ``gt-shape`` provides a two implementations at this time; one for simple access and another that supports the use of an index. The factory will +be able to sort out which one is appropriate when using ``DataStoreFinder`` or +``FileDataStoreFinder``. Shapefile ^^^^^^^^^ @@ -64,28 +66,28 @@ A Shapefile is a common file format which contains numerous features of the same The classic three files: -* filename.shp: shapes -* filename.shx: shapes to attributes index -* filename.dbf: attributes +* ``filename.shp``: shapes +* ``filename.shx``: shapes to attributes index +* ``filename.dbf``: attributes Basic metadata: -* filename.prj: projection +* ``filename.prj``: projection Open source extensions: -* filename.qix: quadtree spatial index -* filename.fix: feature id index -* filename.sld: style-layer-descriptor style xml object +* ``filename.qix``: quadtree spatial index +* ``filename.fix``: feature id index +* ``filename.sld``: Styled Layer Descriptor style XML object ESRI extensions: -* filename.sbn: attribute index -* filename.sbx: spatial index -* filename.lyr: arcmap-only style object -* filename.avl: arcview style object -* filename.shp.xml: fgdc metadata +* ``filename.sbn``: attribute index +* ``filename.sbx``: spatial index +* ``filename.lyr``: ArcMap-only style object +* ``filename.avl``: ArcView style object +* ``filename.shp.xml``: FGDC metadata -This style of file format (from the dawn of time) is referred to as "sidecar" files, at a minimum filename.shp and its sidecar file filename.dbf are needed. +This style of file format (from the dawn of time) is referred to as "sidecar" files, at a minimum file ``filename.shp`` and its sidecar file ``filename.dbf`` are needed. Access '''''' @@ -108,15 +110,15 @@ Here is a quick example: :start-after: // start create :end-before: // end create -The featureType created above was just done quickly, in your application you may wish to use a DefaultFeatureTypeBuilder. +The ``featureType`` created above was just done quickly, in your application you may wish to use a ``DefaultFeatureTypeBuilder``. Supports: * attribute names must be 15 characters or you will get a warning: -* a single geometry column named "the_geom" (stored in the SHP file) - * LineString, MultiLineString - Files occasionally contain invalid lines with one point - * Polygon, MultiPolygon - * Point, MultiPoint* +* a single geometry column named ``the_geom`` (stored in the ``SHP`` file) + * ``LineString``, ``MultiLineString`` + * ``Polygon``, ``MultiPolygon`` + * ``Point``, ``MultiPoint`` * "simple" attributes (stored in the DBF file) @@ -124,17 +126,17 @@ Supports: * Integer * Double * Boolean - * Date - TimeStamp interpretation that is just the date + * Date - ``TimeStamp`` interpretation that is just the date Limitations: -* only work with MultiLineStrings, MultiPolygon or MultiPoint. GIS data often travels +* only work with ``MultiLineStrings``, ``MultiPolygon`` or ``MultiPoint``. GIS data often travels in herds - so being restricted to the plural form is not a great limitation. -* only work with fixed length strings (you will find the FeatureType +* only work with fixed length strings (you will find the ``FeatureType`` has a restriction to help you check this, and warnings will be produced if your content ends up trimmed). -* Only supports a single GeometryAttribute -* Shapefile does not support plain Geometry (i.e. mixed LineString, Point and Polygon all in the same file). +* Only supports a single ``GeometryAttribute`` +* Shapefile does not support plain Geometry (i.e. mixed ``LineString``, Point and Polygon all in the same file). * The shapefile maximum size is limited to 2GB (its sidecar DBF file often to 2GB, some system being able to read 4GB or more) * Dates do not support the storage of time by default. If you must store time @@ -174,12 +176,12 @@ You can "force" the projection using the following code:: CoordinateReferenceSystem crs = CRS.decode("EPSG:4326"); shape.forceSchemaCRS( crs ); -This is only a problem if you did not specify the CoordinateReferenceSystem as part of your FeatureType's GeometryAttribute, or if a prj file has not been provided. +This is only a problem if you did not specify the ``CoordinateReferenceSystem`` as part of your ``FeatureType``'s ``GeometryAttribute``, or if a ``prj`` file has not been provided. Character Sets '''''''''''''' -If you are working with Arabic, Chinese or Korean character sets you will need to make use of the "charset" connection parameter when setting up your shapefile. The codes used here are the same as documented/defined for the Java Charset class. Indeed you can provide a Charset or if you provide a String it will be converted to a Charset. +If you are working with Arabic, Chinese or Korean character sets you will need to make use of the ``charset`` connection parameter when setting up your shapefile. The codes used here are the same as documented/defined for the Java ``Charset`` class. Indeed you can provide a ``Charset`` or if you provide a String it will be converted to a ``Charset``. Thanks to the University of Seoul for providing and testing this functionality. @@ -192,14 +194,14 @@ The store will build dates using the default timezone. If you need to work again Reading PRJ ^^^^^^^^^^^ -You can use the CRS utility class to read the PRJ file if required. The contents of the file are in "well known text":: +You can use the CRS utility class to read the ``PRJ`` file if required. The contents of the file are in "well known text":: CoordinateReferenceSystem crs = CRS.parseWKT(wkt); Reading DBF ^^^^^^^^^^^ -A shapefile is actually comprised of a core "shp" file and a number of "sidecar" files. One of the sidecar files is a "dbf" file used to record attributes. This is the original DBF file format provided by one of the original grandfather databases "DBase". +A shapefile is actually comprised of a core ``shp`` file and a number of "sidecar" files. One of the sidecar files is a ``dbf`` file used to record attributes. This is the original DBF file format provided by one of the original grandfather databases "DBase III". .. literalinclude:: /../src/main/java/org/geotools/data/ShapefileExample.java :language: java diff --git a/docs/user/library/data/solr.rst b/docs/user/library/data/solr.rst index ad5381fca27..9a84c4a80ef 100644 --- a/docs/user/library/data/solr.rst +++ b/docs/user/library/data/solr.rst @@ -17,18 +17,18 @@ Connection Parameters The following connection parameters are available: +-------------------------+----------------------------------------------------+ -| Param | Description | +| Parameter | Description | +=========================+====================================================+ -| "solr_url" | Url to a SOLR server CORE | +| ``solr_url`` | URL to a SOLR server CORE | +-------------------------+----------------------------------------------------+ -| "layer_mapper" | Controls how documents are mapped to layers | +| ``layer_mapper`` | Controls how documents are mapped to layers | +-------------------------+----------------------------------------------------+ -| "layer_name_field" | Field used in SOLR that holds the layer names | +| ``layer_name_field`` | Field used in SOLR that holds the layer names | +-------------------------+----------------------------------------------------+ -| "namespace" | Namespace prefixs | +| ``namespace`` | Namespace prefix | +-------------------------+----------------------------------------------------+ -Notes: "layer_mapper" and "layer_name_field" are deprecated, a single layer is exposed now by default, use +Notes: ``layer_mapper`` and ``layer_name_field`` are deprecated, a single layer is exposed now by default, use the ``SolrLayerConfiguration`` class to configure more layers Example use: @@ -37,4 +37,4 @@ Example use: Map map = new HashMap(); map.put("solr_url", new URL("http://localhost:8080/solr")); - map.put(SolrDataStoreFactory.NAMESPACE.key, "namespace"); \ No newline at end of file + map.put(SolrDataStoreFactory.NAMESPACE.key, "namespace"); diff --git a/docs/user/library/data/wfs-ng.rst b/docs/user/library/data/wfs-ng.rst index 4da419c70ac..702ae68edd0 100644 --- a/docs/user/library/data/wfs-ng.rst +++ b/docs/user/library/data/wfs-ng.rst @@ -18,88 +18,89 @@ Connection Parameters The following connection parameters are defined for WFS. -+--------------------------------------------+------------------------------------------------------------------+ -| Param | Description | -+============================================+==================================================================+ -| "WFSDataStoreFactory:GET_CAPABILITIES_URL" | Link to capabilities document. | -| | The implementation supports both WFS 1.0 (read/write) and | -| | WFS 1.1 (read-only). | -+--------------------------------------------+------------------------------------------------------------------+ -| "WFSDataStoreFactory:PROTOCOL" | Optional: True for Post, False for GET, null for auto | -+--------------------------------------------+------------------------------------------------------------------+ -| "WFSDataStoreFactory:USERNAME" | Optional | -+--------------------------------------------+------------------------------------------------------------------+ -| "WFSDataStoreFactory:PASSWORD" | Optional | -+--------------------------------------------+------------------------------------------------------------------+ -| "WFSDataStoreFactory:ENCODING" | Optional with a default of UTF-8 | -+--------------------------------------------+------------------------------------------------------------------+ -| "WFSDataStoreFactory:TIMEOUT" | Optional with a 3000ms default | -+--------------------------------------------+------------------------------------------------------------------+ -| "WFSDataStoreFactory:BUFFER_SIZE" | Optional number of features to read in one gulp, defaults of 10 | -+--------------------------------------------+------------------------------------------------------------------+ -| "WFSDataStoreFactory:TRY_GZIP" | Optional with a default of true, try compression if available | -+--------------------------------------------+------------------------------------------------------------------+ -| "WFSDataStoreFactory:LENIENT" | Optional default of true. | -| | WFS implementations are terrible for actually obeying their | -| | DescribeFeatureType schema, setting this to true will try a few | -| | tricks to support implementations that are mostly correct: | -| | | -| | * Accepting the data in any order | -| | * Not getting too upset if the case of the attributes is wrong | -+--------------------------------------------+------------------------------------------------------------------+ -| "WFSDataStoreFactory:MAXFEATURES" | Limit on the number of features | -+--------------------------------------------+------------------------------------------------------------------+ -| "WFSDataStoreFactory:WFS_STRATEGY" | Optional used to engage specific work arounds for known servers. | -| | | -| | * "arcgis" | -| | * "cuberx" | -| | * "geoserver" | -| | * "ionic" | -| | * "mapserver" | -| | * "nonstrict" | -| | * "strict" | -| | * null - automatic based GET_CAPABILITIES url | -| | | -| | You may need use this override if you are using mapserver | -| | with a custom URL not recognised by auto detection. | -| | WFS1.1 supports autodetection based on full capabilities doc for | -| | greater accuracy. | -+--------------------------------------------+------------------------------------------------------------------+ -| "WFSDataStoreFactory:FILTER_COMPLIANCE" | Optional used override how GetFeature operations encodes filters | -| | | -| | * 0 (low compliance) full range of geotools filters represented | -| | * 1 (medium compliance) Id filters mixed with bbox only | -| | * 2 (strict compliance) Id filters cannot be combined at all | -| | | -| | In general compliance levels stress the handling of Id filters | -| | which are not allowed with other filters (AND / OR / NOT). | -| | You may relax this constraint when working with some WFS | -| | implementations such as GeoServer. | -+--------------------------------------------+------------------------------------------------------------------+ -| "WFSDataStoreFactory:USEDEFAULTSRS" | Optional used override how GetFeature operations send srs to wfs | -| | server | -| | | -| | * false use othersrs if query matches one of them | -| | * true always use defaultsrs and reproject locally to query crs | -| | | -| | Choose if you prefer to always use DefaultSRS declared in | -| | capabilities and reproject using GeoTools if necessary, or | -| | use also OtherSRS if available. | -| | The false value is currently supported in 1.1.0 protocol only. | -+--------------------------------------------+------------------------------------------------------------------+ - -Historical Note: We apologise for the long connection parameter keys, WFS was one of the first DataStores written and we were unsure at the ++----------------------------------------------+------------------------------------------------------------------+ +| Parameter | Description | ++==============================================+==================================================================+ +| ``WFSDataStoreFactory:GET_CAPABILITIES_URL`` | Link to capabilities document. | +| | The implementation supports both WFS 1.0 (read/write) and | +| | WFS 1.1 (read-only). | ++----------------------------------------------+------------------------------------------------------------------+ +| ``WFSDataStoreFactory:PROTOCOL`` | Optional: True for Post, False for GET, null for auto | ++----------------------------------------------+------------------------------------------------------------------+ +| ``WFSDataStoreFactory:USERNAME`` | Optional | ++----------------------------------------------+------------------------------------------------------------------+ +| ``WFSDataStoreFactory:PASSWORD`` | Optional | ++----------------------------------------------+------------------------------------------------------------------+ +| ``WFSDataStoreFactory:ENCODING`` | Optional with a default of UTF-8 | ++----------------------------------------------+------------------------------------------------------------------+ +| ``WFSDataStoreFactory:TIMEOUT`` | Optional with a 3000ms default | ++----------------------------------------------+------------------------------------------------------------------+ +| ``WFSDataStoreFactory:BUFFER_SIZE`` | Optional number of features to read in one gulp, defaults of 10 | ++----------------------------------------------+------------------------------------------------------------------+ +| ``WFSDataStoreFactory:TRY_GZIP`` | Optional with a default of true, try compression if available | ++----------------------------------------------+------------------------------------------------------------------+ +| ``WFSDataStoreFactory:LENIENT`` | Optional default of true. | +| | WFS implementations are terrible for actually obeying their | +| | ``DescribeFeatureType`` schema, setting this to true will try a | +| | few tricks to support implementations that are mostly correct: | +| | | +| | * Accepting the data in any order | +| | * Not getting too upset if the case of the attributes is wrong | ++----------------------------------------------+------------------------------------------------------------------+ +| ``WFSDataStoreFactory:MAXFEATURES`` | Limit on the number of features | ++----------------------------------------------+------------------------------------------------------------------+ +| ``WFSDataStoreFactory:WFS_STRATEGY`` | Optional used to engage specific workarounds for known servers. | +| | | +| | * ``arcgis`` | +| | * ``cuberx`` | +| | * ``geoserver`` | +| | * ``ionic`` | +| | * ``mapserver`` | +| | * ``nonstrict`` | +| | * ``strict`` | +| | * ``null`` - automatic based GET_CAPABILITIES URL | +| | | +| | You may need use this override if you are using MapServer | +| | with a custom URL not recognized by auto detection. | +| | WFS 1.1 supports auto detection based on full capabilities doc | +| | for greater accuracy. | ++----------------------------------------------+------------------------------------------------------------------+ +| ``WFSDataStoreFactory:FILTER_COMPLIANCE`` | Optional used override how ``GetFeature`` operations encodes | +| | filters | +| | * 0 (low compliance) full range of GeoTools filters represented | +| | * 1 (medium compliance) Id filters mixed with ``bbox`` only | +| | * 2 (strict compliance) Id filters cannot be combined at all | +| | | +| | In general compliance levels stress the handling of Id filters | +| | which are not allowed with other filters (AND / OR / NOT). | +| | You may relax this constraint when working with some WFS | +| | implementations such as GeoServer. | ++----------------------------------------------+------------------------------------------------------------------+ +| ``WFSDataStoreFactory:USEDEFAULTSRS`` | Optional used override how ``GetFeature`` operations send CRS | +| | to WFS server | +| | | +| | * false use ``OtherSRS`` if query matches one of them | +| | * true always use ``DefaultSRS`` and reproject locally to | +| | query CRS | +| | | +| | Choose if you prefer to always use ``DefaultSRS`` declared in | +| | capabilities and reproject using GeoTools if necessary, or | +| | use also ``OtherSRS`` if available. | +| | The false value is currently supported in 1.1.0 protocol only. | ++----------------------------------------------+------------------------------------------------------------------+ + +Historical Note: We apologize for the long connection parameter keys, WFS was one of the first ``DataStores`` written and we were unsure at the time if they keys for each datastore would need to be unique or not. On the plus side you can see our devotion to stability. Hints: -* The WFSDataStoreFactory provides keys as static constants if you need to look up the key, - definition or expected data type programatically +* The ``WFSDataStoreFactory`` provides keys as static constants if you need to look up the key, + definition or expected data type programmatically * The capabilities URL you provide is important: * Q: Does it include "VERSION=1.0.0"? - If so you are using well tested code parsing GML2, and if available WFS-T will be supported. - * Q: does it include "VERSION=1.1.0" ? If so you are using newer code parsing GML3, and only WFS is implemented at this time. + If so you are using well tested code parsing GML-2, and if available WFS-T will be supported. + * Q: does it include "VERSION=1.1.0" ? If so you are using newer code parsing GML-3, and only WFS is implemented at this time. * You really should spend some time adjusting these parameters for your data source and application; in particular the performance is greatly effected by changing the BUFFER_SIZE. @@ -115,7 +116,7 @@ Support for **Web Feature Server Example (WFS)** offers access to the raw featur * You are advised that when using read/write access you will need to use a transaction - see the section of WFS-T for more details. -The following is a quick example; only the connection parameter code is specific to the WFSDataStore. +The following is a quick example; only the connection parameter code is specific to the ``WFSDataStore``. You can connect to a Web Feature Server via the DataStore API; the connection parameters are as follows:: diff --git a/docs/user/library/index.rst b/docs/user/library/index.rst index 0e1dde4d01c..6dd42f1d130 100644 --- a/docs/user/library/index.rst +++ b/docs/user/library/index.rst @@ -2,7 +2,7 @@ Library ******* -The GeoTools library is organised into a series of jars. These jars form a software stack, +The GeoTools library is organized into a series of jars. These jars form a software stack, each building on the services of the others. Individual jars such as "data" are extended with plugins in order to support additional capabilities. For data these plugins include support for common spatial formats such as shapefiles. @@ -20,4 +20,4 @@ support for common spatial formats such as shapefiles. jdbc/index cql/index xml/index - render/index \ No newline at end of file + render/index diff --git a/docs/user/library/jdbc/datastore.rst b/docs/user/library/jdbc/datastore.rst index 934d9474fa9..585ef11c395 100644 --- a/docs/user/library/jdbc/datastore.rst +++ b/docs/user/library/jdbc/datastore.rst @@ -1,9 +1,9 @@ JDBCDataStore ------------- -The gt-jdbc module is odd in that it provides a single implementation of a DataStore (JDBCDataStore actually) and you are forced to use the DataStoreFinder mechanism in order to access the different formats. +The ``gt-jdbc`` module is odd in that it provides a single implementation of a ``DataStore`` ( ``JDBCDataStore`` actually) and you are forced to use the ``DataStoreFinder`` mechanism in order to access the different formats. -In this case each format is implementing a custom SQLDialect as discussed in the :doc:`gt-jdbc internals ` page. +In this case each format is implementing a custom ``SQLDialect`` as discussed in the :doc:`gt-jdbc internals ` page. Creating a JDBCDataStore ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -15,12 +15,12 @@ The process of creating a JDBC data store follows the regular steps of creating :start-after: // postgisExample start :end-before: // postgisExample end -An important parameter is the **dbtype** parameter which specifies the type of database to connect to. +An important parameter is the ``dbtype`` parameter which specifies the type of database to connect to. Using JNDI '''''''''' -The above example illustrates the case where a direct connection to a database is specified. A JNDI connection can also be specified using the JDBCJNDIDataStoreFactory class.:: +The above example illustrates the case where a direct connection to a database is specified. A JNDI connection can also be specified using the ``JDBCJNDIDataStoreFactory`` class.:: Map map = new HashMap(); map.put( "dbtype", "postgis"); @@ -47,30 +47,30 @@ If you want to get extra performance and you're sure the connections will never Connection Parameters ^^^^^^^^^^^^^^^^^^^^^ -All the gt-jdbc formats have the option of using the following set of connection parameters. You will +All the ``gt-jdbc`` formats have the option of using the following set of connection parameters. You will need to consult the documentation for the plugin you are using; the following is provided to help with consistency. -Crucial to this is the agreement that they use a unique "dbtype" for each format. +Crucial to this is the agreement that they use a unique ``dbtype`` for each format. +--------------------------------+----------------------------------------------------+ | Parameter | Description | +================================+====================================================+ -| "dbtype" | A URL of the file ending in "shp" | +| ``dbtype`` | A unique database type identifier | +--------------------------------+----------------------------------------------------+ -| "host" | Server to connect to | +| ``host`` | Server to connect to | +--------------------------------+----------------------------------------------------+ -| "port" | Port to connect to. | +| ``port`` | Port to connect to. | +--------------------------------+----------------------------------------------------+ -| "database" | database instance | +| ``database`` | Database name | +--------------------------------+----------------------------------------------------+ -| "schema" | database schema | +| ``schema`` | Database schema | +--------------------------------+----------------------------------------------------+ -| "user | username if required | +| ``user`` | Username if required | +--------------------------------+----------------------------------------------------+ -| "passwd" | password if required | +| ``passwd`` | Password if required | +--------------------------------+----------------------------------------------------+ -| "namespace" | namespace prefix to use for content | +| ``namespace`` | Namespace prefix to use for content | +--------------------------------+----------------------------------------------------+ **Advanced** @@ -78,55 +78,55 @@ Crucial to this is the agreement that they use a unique "dbtype" for each format +--------------------------------+----------------------------------------------------+ | Parameter | Description | +================================+====================================================+ -| "Data Source" | Optional: DataSource instance to use. | +| ``Data Source`` | Optional: DataSource instance to use. | +--------------------------------+----------------------------------------------------+ **Connection Pooling** -+--------------------------------+----------------------------------------------------+ -| Parameter | Description | -+================================+====================================================+ -| "max connections" | Maximum number of connection the pool will hold at | -| | any time, default is 10 | -+--------------------------------+----------------------------------------------------+ -| "min connections" | Minimum number of connection the pool will hold at | -| | any time, default is 1 | -+--------------------------------+----------------------------------------------------+ -| "connection timeout" | Maximum number of second the pool will wait when | -| | trying to obtain a connection, default is 20 | -| | seconds | -+--------------------------------+----------------------------------------------------+ -| "validate connections" | Flag controlling if the pool should validate | -| | connections when a new connection is obtained | -+--------------------------------+----------------------------------------------------+ -| "Max open prepared statements" | Maximum number of prepared statements kept open | -| | and cached for each connection in the pool. | -| | Set to 0 to have unbounded caching, -1 to disable | -+--------------------------------+----------------------------------------------------+ -| "Test while idle" | Periodically test if the connections are still | -| | valid also while idle in the pool | -+--------------------------------+----------------------------------------------------+ -| "Time between evictor runs" | Number of seconds between idle object evictor runs.| -| | The default value is 300 seconds. | -+--------------------------------+----------------------------------------------------+ -| "Min evictable time" | Number of seconds a connection needs to stay idle | -| | before the evictor starts to consider closing it | -+--------------------------------+----------------------------------------------------+ -| "Evictor tests per run" | Number of connections checked by the idle | -| | connection evictor for each of its runs. | -| | The default value is 3 connections. | -+--------------------------------+----------------------------------------------------+ ++----------------------------------+----------------------------------------------------+ +| Parameter | Description | ++==================================+====================================================+ +| ``max connections`` | Maximum number of connection the pool will hold at | +| | any time, default is 10 | ++----------------------------------+----------------------------------------------------+ +| ``min connections`` | Minimum number of connection the pool will hold at | +| | any time, default is 1 | ++----------------------------------+----------------------------------------------------+ +| ``connection timeout`` | Maximum number of second the pool will wait when | +| | trying to obtain a connection, default is 20 | +| | seconds | ++----------------------------------+----------------------------------------------------+ +| ``validate connections`` | Flag controlling if the pool should validate | +| | connections when a new connection is obtained | ++----------------------------------+----------------------------------------------------+ +| ``Max open prepared statements`` | Maximum number of prepared statements kept open | +| | and cached for each connection in the pool. | +| | Set to 0 to have unbounded caching, -1 to disable | ++----------------------------------+----------------------------------------------------+ +| ``Test while idle`` | Periodically test if the connections are still | +| | valid also while idle in the pool | ++----------------------------------+----------------------------------------------------+ +| ``Time between evictor runs`` | Number of seconds between idle object evictor runs.| +| | The default value is 300 seconds. | ++----------------------------------+----------------------------------------------------+ +| ``Min evictable time`` | Number of seconds a connection needs to stay idle | +| | before the evictor starts to consider closing it | ++----------------------------------+----------------------------------------------------+ +| ``Evictor tests per run`` | Number of connections checked by the idle | +| | connection evictor for each of its runs. | +| | The default value is 3 connections. | ++----------------------------------+----------------------------------------------------+ **Tweaking and Performance** +--------------------------------+----------------------------------------------------+ | Parameter | Description | +================================+====================================================+ -| "fetch size" | Number of records to read | +| ``fetch size`` | Number of records to read | +--------------------------------+----------------------------------------------------+ -| "Primary key metadata table" | The optional table containing primary key | +| ``Primary key metadata table`` | The optional table containing primary key | | | structure and sequence associations. Either | | | expressed as 'schema.name' or just 'name' | +--------------------------------+----------------------------------------------------+ -| "Expose primary keys" | "Expose primary key columns as attributes | +| ``Expose primary keys`` | Expose primary key columns as attributes | +--------------------------------+----------------------------------------------------+ diff --git a/docs/user/library/jdbc/db2.rst b/docs/user/library/jdbc/db2.rst index 82a65f8484a..3bd1f082dfb 100644 --- a/docs/user/library/jdbc/db2.rst +++ b/docs/user/library/jdbc/db2.rst @@ -11,7 +11,7 @@ A couple of really good things have happened for DB2 support recently. We have o **Maven** -Note that the groupId is **org.geotools.jdbc** for this and other JDBC plugin modules. +Note that the ``groupId`` is ``org.geotools.jdbc`` for this and other JDBC plugin modules. :: @@ -24,23 +24,23 @@ Note that the groupId is **org.geotools.jdbc** for this and other JDBC plugin mo Connection Parameters ^^^^^^^^^^^^^^^^^^^^^ -+-------------+------------------------------------------+ -| Parameter | Description | -+=============+==========================================+ -| "dbtype" | Must be the string "db2" | -+-------------+------------------------------------------+ -| "host" | Machine name or IP address to connect to | -+-------------+------------------------------------------+ -| "port" | Port number to connect to, default 50000 | -+-------------+------------------------------------------+ -| "tabschema" | The database schema to access | -+-------------+------------------------------------------+ -| "database" | The database to connect to | -+-------------+------------------------------------------+ -| "user" | User name | -+-------------+------------------------------------------+ -| "passwd" | Password | -+-------------+------------------------------------------+ ++---------------+------------------------------------------+ +| Parameter | Description | ++===============+==========================================+ +| ``dbtype`` | Must be the string ``db2`` | ++---------------+------------------------------------------+ +| ``host`` | Machine name or IP address to connect to | ++---------------+------------------------------------------+ +| ``port`` | Port number to connect to, default 50000 | ++---------------+------------------------------------------+ +| ``tabschema`` | The database schema to access | ++---------------+------------------------------------------+ +| ``database`` | The database to connect to | ++---------------+------------------------------------------+ +| ``user`` | User name | ++---------------+------------------------------------------+ +| ``passwd`` | Password | ++---------------+------------------------------------------+ Creating ^^^^^^^^ @@ -64,24 +64,24 @@ Advanced Connection Parameters Additional connection parameters are available to configure connection pool use, or to feed in your own DataSource. -For more information check the java docs for: +For more information check the Java docs for: -* DB2NGJNDIDataStoreFactory -* DB2NGDataStoreFactory +* ``DB2NGJNDIDataStoreFactory`` +* ``DB2NGDataStoreFactory`` -Advanced Geotools Parameters +Advanced GeoTools Parameters ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -+-------------------+------------------------------------------+ -| Parameter | Description | -+===================+==========================================+ -| "loose bbox" | Flag controlling loose bbox comparisons, | -| | default is true | -+-------------------+------------------------------------------+ -| "use selectivity" | Flag to raise the priority of spatial | -| | indices for the db2 optimizer, | -| | default is false | -+-------------------+------------------------------------------+ ++---------------------+------------------------------------------+ +| Parameter | Description | ++=====================+==========================================+ +| ``loose bbox`` | Flag controlling loose ``bbox`` | +| | comparisons, default is true | ++---------------------+------------------------------------------+ +| ``use selectivity`` | Flag to raise the priority of spatial | +| | indices for the ``db2`` optimizer, | +| | default is false | ++---------------------+------------------------------------------+ Example use:: @@ -121,15 +121,15 @@ Since DB2 Spatial Extender V10 it is possible to store the extent of a geometry Paging Support ^^^^^^^^^^^^^^ -Paging support is necessary to retrieve only a subset of a query result. (e. g. rows numbered 100 - 200). Many databases support the SQL keywords -LIMIT and OFFSET, Oracle uses a pseudo column called ROWNUM. This plugin uses a strategy depending on the DB2 compatibility mode. +Paging support is necessary to retrieve only a subset of a query result. (e.g. rows numbered 100 - 200). Many databases support the SQL keywords +LIMIT and OFFSET, Oracle uses a pseudo column called ``ROWNUM``. This plugin uses a strategy depending on the DB2 compatibility mode. -* In MYSQL compatibility mode, LIMIT and OFFSET is used +* In MYSQL compatibility mode, ``LIMIT`` and ``OFFSET`` is used -* In Oracle compatibility mode, ROWNUM is used +* In Oracle compatibility mode, ``ROWNUM`` is used -* Fetch needed rows and ignore the unneeded rows (e. g fetch rows 1 - 200 and ignore rows from 1-100). - This may result in very bad performance. Using a scrollable cursor would not help since BLOBs (vector data) are +* Fetch needed rows and ignore the unneeded rows (e.g. fetch rows 1 - 200 and ignore rows from 1-100). + This may result in very bad performance. Using a scrollable cursor would not help since ``BLOBs`` (vector data) are not supported for such cursors in DB2. The strategy used can be found in the log file. If no paging support is enabled, the log file contains a warning:: @@ -152,4 +152,4 @@ or:: Using Oracle ROWNUM for paging support - \ No newline at end of file + diff --git a/docs/user/library/jdbc/faq.rst b/docs/user/library/jdbc/faq.rst index 7fa7fafbb77..772f658dbd7 100644 --- a/docs/user/library/jdbc/faq.rst +++ b/docs/user/library/jdbc/faq.rst @@ -4,7 +4,7 @@ JDBC FAQ Q: How to access a database from Java Enterprise Edition? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Depending on your application container (and organisational polices) you may be restricted to only using database connection pools under control of your administrator. +Depending on your application container (and organizational polices) you may be restricted to only using database connection pools under control of your administrator. Your administrator will register the database connection pool with the application server and configure your application with the Java Naming and Directory Interface (JNDI) reference. @@ -17,4 +17,4 @@ To use GeoTools with a JNDI name:: DataStore store = DataStoreFinder.getDataStore(map); -The specific "dbtype" marks the plugin you will use to communicate with the database. \ No newline at end of file +The specific ``dbtype`` marks the plugin you will use to communicate with the database. diff --git a/docs/user/library/jdbc/h2.rst b/docs/user/library/jdbc/h2.rst index 26d15a672f7..ea71af77346 100644 --- a/docs/user/library/jdbc/h2.rst +++ b/docs/user/library/jdbc/h2.rst @@ -8,7 +8,7 @@ a true spatial database as it does not have any form of spatial indexing. **Maven** -Note that the groupId is **org.geotools.jdbc** for this and other JDBC plugin modules. +Note that the ``groupId`` is ``org.geotools.jdbc`` for this and other JDBC plugin modules. :: @@ -21,15 +21,15 @@ Note that the groupId is **org.geotools.jdbc** for this and other JDBC plugin mo Connection Parameters ^^^^^^^^^^^^^^^^^^^^^ -+-------------+----------------------------------------------+ -| Parameter | Description | -+=============+==============================================+ -| "dbtype" | Must be the string "h2" | -+-------------+----------------------------------------------+ -| "database" | The database to connect to | -+-------------+----------------------------------------------+ -| "user" | User name | -+-------------+----------------------------------------------+ ++---------------+----------------------------------------------+ +| Parameter | Description | ++===============+==============================================+ +| ``dbtype`` | Must be the string ``h2`` | ++---------------+----------------------------------------------+ +| ``database`` | The database to connect to | ++---------------+----------------------------------------------+ +| ``user`` | User name | ++---------------+----------------------------------------------+ Creating ^^^^^^^^ @@ -41,7 +41,7 @@ Here is a quick example: :start-after: // h2Example start :end-before: // h2Example end -The above will reference a database file named "geotools" located in the current working directory. +The above will reference a database file named ``geotools`` located in the current working directory. A full path may also be specified: .. literalinclude:: /../src/main/java/org/geotools/jdbc/JDBCExamples.java @@ -49,8 +49,8 @@ A full path may also be specified: :start-after: // h2AbsPathExample start :end-before: // h2AbsPathExample end -The above examples create a connection to H2 in "embedded" mode. One limitation to this approach is -that it only allows for a single java process to access the database at any one time. H2 also offers +The above examples create a connection to H2 in *embedded* mode. One limitation to this approach is +that it only allows for a single Java process to access the database at any one time. H2 also offers a `server mode `_ in which access to the underlying database is made via traditional client-server TCP connection, and removes the embedded single process restriction: diff --git a/docs/user/library/jdbc/hana.rst b/docs/user/library/jdbc/hana.rst index 24ae8ca8d13..cd2c151fc0b 100644 --- a/docs/user/library/jdbc/hana.rst +++ b/docs/user/library/jdbc/hana.rst @@ -14,7 +14,7 @@ You need HANA's JDBC driver ``ngdbc.jar`` to connect to HANA. Its license does n **Maven** -Note that the groupId is **org.geotools.jdbc** for this and other JDBC plugin modules. +Note that the ``groupId`` is ``org.geotools.jdbc`` for this and other JDBC plugin modules. :: @@ -30,15 +30,15 @@ Connection Parameters ============== ============================================ Parameter Description ============== ============================================ -"dbtype" Must be the string "hana" -"host" Machine name or IP address to connect to -"port" Port to connect to. If set and different from 0, parameters "instance" and "database" are ignored. If not set or 0, the "instance" parameter must be set. -"instance" Instance of the database. Ignored if a port is set. -"database" Database to connect to. Leave empty in case of single-container databases. Set to ``SYSTEMDB`` to connect to the system database of a multi-container database. Ignored if a port is set. -"schema" The database schema to access -"user" User name -"passwd" Password -"use ssl" Use SSL to connect +``dbtype`` Must be the string ``hana`` +``host`` Machine name or IP address to connect to +``port`` Port to connect to. If set and different from 0, parameters "instance" and "database" are ignored. If not set or 0, the "instance" parameter must be set. +``instance`` Instance of the database +``database`` Database to connect to. Leave empty in case of single-container databases. Set to ``SYSTEMDB`` to connect to the system database of a multi-container database. +``schema`` The database schema to access +``user`` User name +``passwd`` Password +``use ssl`` Use SSL to connect ============== ============================================ Creating @@ -57,16 +57,16 @@ Here is an example of connecting:: DataStore datastore = DataStoreFinder.getDataStore(params); -Advanced Geotools Parameters +Advanced GeoTools Parameters ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -+--------------------+-------------------------------------------+ -| Parameter | Description | -+====================+===========================================+ -| "encode functions" | Flag controlling if a set of filter | -| | functions are translated directly in SQL. | -| | Default is false. | -+--------------------+-------------------------------------------+ ++----------------------+-------------------------------------------+ +| Parameter | Description | ++======================+===========================================+ +| ``encode functions`` | Flag controlling if a set of filter | +| | functions are translated directly in SQL. | +| | Default is false. | ++----------------------+-------------------------------------------+ Importing spatial reference systems ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/docs/user/library/jdbc/ingres.rst b/docs/user/library/jdbc/ingres.rst index 93eb92bd4e1..f2dd19d9f4a 100644 --- a/docs/user/library/jdbc/ingres.rst +++ b/docs/user/library/jdbc/ingres.rst @@ -1,12 +1,12 @@ Ingres Plugin ------------- -Unsupported plugin currently under construction; ask on the geotools user list if you +Unsupported plugin currently under construction; ask on the GeoTools user list if you would like to help out. **Maven** -Note that the groupId is **org.geotools.jdbc** for this and other JDBC plugin modules. +Note that the ``groupId`` is ``org.geotools.jdbc`` for this and other JDBC plugin modules. :: diff --git a/docs/user/library/jdbc/internal.rst b/docs/user/library/jdbc/internal.rst index a87ba95355b..528d9124246 100644 --- a/docs/user/library/jdbc/internal.rst +++ b/docs/user/library/jdbc/internal.rst @@ -1,7 +1,7 @@ Internals --------- -The internals of gt-jdbc layout the code for JDBCDataStore and abstract classes that are extended for each new format. +The internals of ``gt-jdbc`` layout the code for ``JDBCDataStore`` and abstract classes that are extended for each new format. Related: @@ -10,34 +10,34 @@ Related: JDBCDataStore ^^^^^^^^^^^^^ -The JDBCDataStore class is an extension of ContentDataStore defined by gt-main. +The ``JDBCDataStore`` class is an extension of ``ContentDataStore`` defined by ``gt-main``. .. image:: /images/content2.PNG -ContentDataStore is extended with a concrete JDBCDataStore that: +``ContentDataStore`` is extended with a concrete ``JDBCDataStore`` that: -* delegates out to a SQLDialect that is implemented for each format +* delegates out to a ``SQLDialect`` that is implemented for each format * makes use of custom extensions for: - * JDBCState - * JDBCFeatureSource supported by a feature reader that makes use of + * ``JDBCState`` + * ``JDBCFeatureSource`` supported by a feature reader that makes use of a light-weight feature implementation - * JDBCFeatureStore supported by two feature writer implementations + * ``JDBCFeatureStore`` supported by two feature writer implementations .. image:: /images/jdbcDataStore.PNG -You will find a careful attention to details and steps taken to minimise any duplication of code. The FeatureStore implementation maintains an internal delegate JDBCFeatureSource in order to smoothly handle getFeature() requests without duplicating code. +You will find a careful attention to details and steps taken to minimize any duplication of code. The ``FeatureStore`` implementation maintains an internal delegate ``JDBCFeatureSource`` in order to smoothly handle ``getFeature()`` requests without duplicating code. SQLDialect ^^^^^^^^^^ -If you would like to implement support for an additional format please ask on the developers list. The clearest starting place is to review the *gt-jdbc-h2* code which serves as the reference implementation. +If you would like to implement support for an additional format please ask on the developers list. The clearest starting place is to review the *``gt-jdbc-h2``* code which serves as the reference implementation. To have your format accepted by GeoTools you will also need to extend the -conformance test cases as shown in the *gt-jdbc-h2* module. +conformance test cases as shown in the *``gt-jdbc-h2``* module. -Here is a brief illustration of SQLDialect as implemented by the gt-jdbc-h2 plugin. +Here is a brief illustration of ``SQLDialect`` as implemented by the ``gt-jdbc-h2`` plugin. .. image:: /images/jdbcDataStoreH2.PNG diff --git a/docs/user/library/jdbc/mysql.rst b/docs/user/library/jdbc/mysql.rst index f01f80e601a..338196b6e62 100644 --- a/docs/user/library/jdbc/mysql.rst +++ b/docs/user/library/jdbc/mysql.rst @@ -13,37 +13,37 @@ Supports direct access to a MySQL database. ${geotools.version} -Note that the groupId is **org.geotools.jdbc** for this and other JDBC plugin modules. +Note that the ``groupId`` is ``org.geotools.jdbc`` for this and other JDBC plugin modules. Connection Parameters ^^^^^^^^^^^^^^^^^^^^^ **Basic connection parameters** -+-------------+----------------------------------------------+ -| Parameter | Description | -+=============+==============================================+ -| "dbtype" | Must be the string "mysql" | -+-------------+----------------------------------------------+ -| "host" | Machine name or IP address to connect to | -+-------------+----------------------------------------------+ -| "port" | Port number to connect to, default 3309 | -+-------------+----------------------------------------------+ -| "database" | The database to connect to | -+-------------+----------------------------------------------+ -| "user" | User name | -+-------------+----------------------------------------------+ -| "passwd" | Password | -+-------------+----------------------------------------------+ ++---------------+----------------------------------------------+ +| Parameter | Description | ++===============+==============================================+ +| ``dbtype`` | Must be the string ``mysql`` | ++---------------+----------------------------------------------+ +| ``host`` | Machine name or IP address to connect to | ++---------------+----------------------------------------------+ +| ``port`` | Port number to connect to, default 3309 | ++---------------+----------------------------------------------+ +| ``database`` | The database to connect to | ++---------------+----------------------------------------------+ +| ``user`` | User name | ++---------------+----------------------------------------------+ +| ``passwd`` | Password | ++---------------+----------------------------------------------+ **Advanced Connection Parameters** -+------------------+----------------------------------------------+ -| Parameter | Description | -+==================+==============================================+ -| "storage engine" | Storage engine to use for created tables, | -| | default is "MyISAM". | -+------------------+----------------------------------------------+ ++--------------------+----------------------------------------------+ +| Parameter | Description | ++====================+==============================================+ +| ``storage engine`` | Storage engine to use for created tables, | +| | default is ``MyISAM``. | ++--------------------+----------------------------------------------+ See additional notes below on storage engine. @@ -65,7 +65,7 @@ Here is a quick example:: Storage Engine ^^^^^^^^^^^^^^ -The MySQL Datastore is capable of creating new tables via DataStore#createSchema(). The storage engine connection parameter controls what storange engine is used for the new table. The default is "MyISAM" which is the only engine that supports spatial indexing. However depending on the use of the able other engines may be appropriate. For instance "InnoDB" is fully transaction safe so is more suitable to tables that will be undergoing many concurrent edits. +The MySQL Datastore is capable of creating new tables via ``DataStore.createSchema()``. The storage engine connection parameter controls what storage engine is used for the new table. The default is ``MyISAM`` which is the only engine that supports spatial indexing. However depending on the use of the able other engines may be appropriate. For instance ``InnoDB`` is fully transaction safe so is more suitable to tables that will be undergoing many concurrent edits. Example:: diff --git a/docs/user/library/jdbc/oracle.rst b/docs/user/library/jdbc/oracle.rst index f1bfd4be122..b278b65169c 100644 --- a/docs/user/library/jdbc/oracle.rst +++ b/docs/user/library/jdbc/oracle.rst @@ -13,7 +13,7 @@ Supports direct access to an Oracle database. ${geotools.version} -Note that the groupId is **org.geotools.jdbc** for this and other JDBC plugin modules. +Note that the ``groupId`` is ``org.geotools.jdbc`` for this and other JDBC plugin modules. Connection Parameters ^^^^^^^^^^^^^^^^^^^^^ @@ -21,13 +21,13 @@ Connection Parameters ============== ============================= Parameter Description ============== ============================= -"dbtype" Must be the string "oracle" -"host" Machine name or IP address to connect to -"port" Port number to connect to, default 1521 -"schema" The database schema to access -"database" The database to connect to -"user" User name -"passwd" Password +``dbtype`` Must be the string ``oracle`` +``host`` Machine name or IP address to connect to +``port`` Port number to connect to, default 1521 +``schema`` The database schema to access +``database`` The database to connect to +``user`` User name +``passwd`` Password ============== ============================= Creation @@ -49,26 +49,26 @@ Connect using DataStore finder:: Advanced ^^^^^^^^ -+---------------------+------------------------------------------------+ -| Parameter | Description | -+=====================+================================================+ -| "loose bbox" | Flag controlling loose bbox comparisons, | -| | default is true | -+---------------------+------------------------------------------------+ -| "Estimated extends" | Use the spatial index information to quickly | -| | get an estimate of the data bounds | -+---------------------+------------------------------------------------+ -| "Geometry metadata | An alternative table where geometry | -| table" | metadata information can be looked up | -+---------------------+------------------------------------------------+ -| "Metadata bbox" | Flag controlling the use of | -| | MDSYS.USER_SDO_GEOM_METADATA or | -| | MDSYS.ALL_SDO_GEOM_METADATA table for bounding | -| | box calculations, this brings a better | -| | performance if the views access is fast and | -| | the bounds are configured right in the tables | -| | default is false | -+---------------------+------------------------------------------------+ ++-----------------------+------------------------------------------------+ +| Parameter | Description | ++=======================+================================================+ +| ``loose bbox`` | Flag controlling loose ``bbox`` comparisons, | +| | default is true | ++-----------------------+------------------------------------------------+ +| ``Estimated extends`` | Use the spatial index information to quickly | +| | get an estimate of the data bounds | ++-----------------------+------------------------------------------------+ +| ``Geometry metadata`` | An alternative table where geometry | +| ``table`` | metadata information can be looked up | ++-----------------------+------------------------------------------------+ +| ``Metadata bbox`` | Flag controlling the use of | +| | MDSYS.USER_SDO_GEOM_METADATA or | +| | MDSYS.ALL_SDO_GEOM_METADATA table for bounding | +| | box calculations, this brings a better | +| | performance if the views access is fast and | +| | the bounds are configured right in the tables | +| | default is false | ++-----------------------+------------------------------------------------+ Example use:: @@ -86,7 +86,7 @@ user owns (for the ``MDSYS.USER_SDO*`` views) or can otherwise access (for the ` There are a few hiccups in this process: * if the connection pool user cannot access the tables (because impersonation is being used) - the MDSYS views will be empty, making it impossible to determine either the geometry type and the native SRID + the ``MDSYS`` views will be empty, making it impossible to determine either the geometry type and the native SRID * the geometry type can be specified only while building the spatial indexes, as a index constraint, however such information is often not included when creating the indexes * the views are populated dynamically based on the current user, if the database has thousands of tables and users @@ -108,7 +108,7 @@ The table has the following structure (the table name is free, just indicate the CHECK(TYPE IN ('POINT','LINE', 'POLYGON', 'COLLECTION', 'MULTIPOINT', 'MULTILINE', 'MULTIPOLYGON', 'GEOMETRY') )); When the table is present the store will first search it for information about each geometry column -to be classified, and fall back on the MDSYS views only if such table does not contain any information. +to be classified, and fall back on the ``MDSYS`` views only if such table does not contain any information. Setup ^^^^^ @@ -120,6 +120,6 @@ Setup * JDBC vs JDBC-NG - The oracle support has been rewritten for GeoTools 2.6. This rewrite is - called "jdbc-ng" and is easier to maintain. By in large the same + The Oracle support has been rewritten for GeoTools 2.6. This rewrite is + called ``jdbc-ng`` and is easier to maintain. By in large the same connection parameters can be used. diff --git a/docs/user/library/jdbc/postgis.rst b/docs/user/library/jdbc/postgis.rst index d298dc76f41..6c1c7584ca2 100644 --- a/docs/user/library/jdbc/postgis.rst +++ b/docs/user/library/jdbc/postgis.rst @@ -19,7 +19,7 @@ Related ${geotools.version} -Note that the groupId is **org.geotools.jdbc** for this and other JDBC plugin modules. +Note that the ``groupId`` is ``org.geotools.jdbc`` for this and other JDBC plugin modules. Connection Parameters ^^^^^^^^^^^^^^^^^^^^^ @@ -27,13 +27,13 @@ Connection Parameters ============== ============================================ Parameter Description ============== ============================================ -"dbtype" Must be the string "postgis" -"host" Machine name or IP address to connect to -"port" Port number to connect to, default 5432 -"schema" The database schema to access -"database" The database to connect to -"user" User name -"passwd" Password +``dbtype`` Must be the string ``postgis`` +``host`` Machine name or IP address to connect to +``port`` Port number to connect to, default 5432 +``schema`` The database schema to access +``database`` The database to connect to +``user`` User name +``passwd`` Password ============== ============================================ Creation @@ -49,15 +49,15 @@ Connect using DataStore finder: Advanced ^^^^^^^^ -+----------------------+------------------------------------------------+ -| Parameter | Description | -+======================+================================================+ -| "loose bbox" | Flag controlling loose bbox comparisons, | -| | default is true | -+----------------------+------------------------------------------------+ -| "preparedStatements" | Flag controlling whether prepared statements | -| | are used, default is false | -+----------------------+------------------------------------------------+ ++------------------------+------------------------------------------------+ +| Parameter | Description | ++========================+================================================+ +| ``loose bbox`` | Flag controlling loose ``bbox`` comparisons, | +| | default is true | ++------------------------+------------------------------------------------+ +| ``preparedStatements`` | Flag controlling whether prepared statements | +| | are used, default is false | ++------------------------+------------------------------------------------+ Example use:: @@ -67,7 +67,7 @@ Example use:: Configuration Flags ^^^^^^^^^^^^^^^^^^^ -An optimization on spatial queries can be applied, to avoid a bug with PostGIS query planner with big geometries and small bboxes, setting a system property. +An optimization on spatial queries can be applied, to avoid a bug with PostGIS query planner with big geometries and small bounding boxes, setting a system property. This optimization can be enabled using a system-wide default from the command line:: diff --git a/docs/user/library/jdbc/spatialite.rst b/docs/user/library/jdbc/spatialite.rst index b9d6dbf8849..700f90d57a8 100644 --- a/docs/user/library/jdbc/spatialite.rst +++ b/docs/user/library/jdbc/spatialite.rst @@ -27,7 +27,7 @@ References: ${geotools.version} -Note that the groupId is **org.geotools.jdbc** for this and other JDBC plugin modules. +Note that the ``groupId`` is ``org.geotools.jdbc`` for this and other JDBC plugin modules. Connection Parameters ^^^^^^^^^^^^^^^^^^^^^ @@ -35,9 +35,9 @@ Connection Parameters ============== ============================================ Parameter Description ============== ============================================ -"dbtype" Must be the string "spatialite" -"database" The database to connect to -"user" User name (optional) +``dbtype`` Must be the string ``spatialite`` +``database`` The database to connect to +``user`` User name (optional) ============== ============================================ Access diff --git a/docs/user/library/jdbc/sqlserver.rst b/docs/user/library/jdbc/sqlserver.rst index 8be1596f30e..b3673f091a8 100644 --- a/docs/user/library/jdbc/sqlserver.rst +++ b/docs/user/library/jdbc/sqlserver.rst @@ -18,7 +18,7 @@ References: ${geotools.version} -Note that the groupId is **org.geotools.jdbc** for this and other JDBC plugin modules. +Note that the ``groupId`` is ``org.geotools.jdbc`` for this and other JDBC plugin modules. Connection Parameters ^^^^^^^^^^^^^^^^^^^^^ @@ -26,14 +26,14 @@ Connection Parameters ============== ============================================ Parameter Description ============== ============================================ -"dbtype" Must be the string "sqlserver" if using the Microsoft Driver, otherwise use "jtds-sqlserver" -"host" Machine name or IP address to connect to -"port" Port number to connect to -"instance" Instance of Database to use (instead of port when multiple DB services are running) -"schema" The database schema to access -"database" The database to connect to -"user" User name -"passwd" Password +``dbtype`` Must be the string ``sqlserver`` if using the Microsoft Driver, otherwise use ``jtds-sqlserver`` +``host`` Machine name or IP address to connect to +``port`` Port number to connect to +``instance`` Instance of Database to use (instead of port when multiple DB services are running) +``schema`` The database schema to access +``database`` The database to connect to +``user`` User name +``passwd`` Password ============== ============================================ Access diff --git a/docs/user/library/jdbc/teradata.rst b/docs/user/library/jdbc/teradata.rst index b5bf3c09698..e87166d75e5 100644 --- a/docs/user/library/jdbc/teradata.rst +++ b/docs/user/library/jdbc/teradata.rst @@ -17,7 +17,7 @@ Supports direct access to a Teradata database. ${geotools.version} -Note that the groupId is **org.geotools.jdbc** for this and other JDBC plugin modules. +Note that the ``groupId`` is ``org.geotools.jdbc`` for this and other JDBC plugin modules. Connection Parameters ^^^^^^^^^^^^^^^^^^^^^ @@ -25,12 +25,12 @@ Connection Parameters ============== ============================================ Parameter Description ============== ============================================ -"dbtype" Must be the string "teradata" -"host" Machine name or IP address to connect to -"port" Port number to connect to, default is 1025 -"database" The database to connect to, usually same as "user" -"user" User name -"passwd" Password +``dbtype`` Must be the string ``teradata`` +``host`` Machine name or IP address to connect to +``port`` Port number to connect to, default is 1025 +``database`` The database to connect to, usually same as ``user`` +``user`` User name +``passwd`` Password ============== ============================================ Access diff --git a/docs/user/library/jts/dim9.rst b/docs/user/library/jts/dim9.rst index 71c42912d1b..f93a1530cc5 100644 --- a/docs/user/library/jts/dim9.rst +++ b/docs/user/library/jts/dim9.rst @@ -3,7 +3,7 @@ Point Set Theory and the DE-9IM Matrix This page covers some of what the JTS Topology is made up of, and how you can use this information to increase the performance of your queries. -This page has as little math as possible, quickly moving on to a normal String which we can do regular expression on. This page gives you enough information to optimise your own spatial relationship tests. +This page has as little math as possible, quickly moving on to a normal String which we can do regular expression on. This page gives you enough information to optimize your own spatial relationship tests. Related: @@ -40,7 +40,7 @@ A Line l |l0| |dl| |-l| .. |-p| replace:: -p We have an intuitive idea of what a dimension is, for point set theory it is going to act as a -number summarising the shape of a geometry. +number summarizing the shape of a geometry. ========= ======================= ======================================= Shape Dimension Non-empty @@ -243,7 +243,7 @@ Overlaps T*T***T** true x overlaps y The only one that is not really intuitive here is "touches", yes x and y touch in the English sense of the word; but since x and y overlap they are not considered to be only touching. The relationship touches only works when the contact between geometries is limited to the border. -Optimisation +Optimization ^^^^^^^^^^^^ Combining Relationship Tests diff --git a/docs/user/library/jts/equals.rst b/docs/user/library/jts/equals.rst index 4ae6d2e890e..b80397172b4 100644 --- a/docs/user/library/jts/equals.rst +++ b/docs/user/library/jts/equals.rst @@ -9,9 +9,9 @@ between these methods to get the best runtime performance in your application. .. Hint:: If this page looks long and scary, the important bit is to always avoid using - Geometry.equals(\ |nbsp|\ Geometry\ |nbsp|\ g\ |nbsp|\ ) in your code. Use equalsExact or equalsTopo instead. + ``Geometry.equals(Geometry g)`` in your code. Use ``equalsExact`` or ``equalsTopo`` instead. -Geometry.equalsExact( Geometry g ) +``Geometry.equalsExact( Geometry g )`` This method tests for **structural equality** of Geometry objects. In simple terms, this means that they must have the same number of vertices, in the same locations, and in the same order. The latter condition is the tricky one. If two Polygons have matching vertices, but one is @@ -19,13 +19,13 @@ Geometry.equalsExact( Geometry g ) **false**. It's important to know this because vertex order can change when objects are being stored in, and later retrieved from, data stores. -Geometry.equalsExact( Geometry g, double tolerance ) +``Geometry.equalsExact( Geometry g, double tolerance )`` This is just like the previous method but lets you specify a tolerance for the comparison of vertex coordinates. -Geometry.equalsNorm( Geometry g ) +``Geometry.equalsNorm( Geometry g )`` This method frees you from the vertex order problem mentioned above by *normalizing* the - Geometry objects (ie. putting each into a standard or *canonical* form), before comparison. It + Geometry objects (i.e. putting each into a standard or *canonical* form), before comparison. It is equivalent to:: geomA.normalize(); @@ -35,17 +35,17 @@ Geometry.equalsNorm( Geometry g ) Vertex order will is guaranteed to be the same, but the price is additional computation which, for complex Geometry objects, can be expensive. -Geometry.equalsTopo( Geometry g ) +``Geometry.equalsTopo( Geometry g )`` This method tests for **topological equality** which is equivalent to drawing the two Geometry objects and seeing if all of their component edges overlap. It is the most robust kind of comparison but also the most computationally expensive. -Geometry.equals( Object o ) - This method is a synonym for Geometry.equalsExact and lets you use Geometry objects in +``Geometry.equals( Object o )`` + This method is a synonym for ``Geometry.equalsExact`` and lets you use Geometry objects in Java Collections. -Geometry.equals( Geometry g ) - This method is a synonym for Geometry.equalsTopo. It should really come with a health warning +``Geometry.equals( Geometry g )`` + This method is a synonym for ``Geometry.equalsTopo``. It should really come with a health warning because its presence means that you can unknowingly be doing computationally expensive comparisons when quick cheap ones are all you need. For example:: @@ -59,5 +59,5 @@ Geometry.equals( Geometry g ) // this instead: result = geomA.equalsExact( geomB ); - The best thing approach you can take with this method is vow never to use it. + The best thing approach you can take with this method is to vow never to use it. diff --git a/docs/user/library/jts/faq.rst b/docs/user/library/jts/faq.rst index f36aee037b9..6c11b4dc121 100644 --- a/docs/user/library/jts/faq.rst +++ b/docs/user/library/jts/faq.rst @@ -6,13 +6,17 @@ Q: What is the relationship between JTS and GeoTools? We make use of the Java Topology Suite to represent "Simple" Geometry, and the OpenGIS interfaces to represent everything else. We have been forced to define an API module of our own in a few cases, like data access, where something "standard" is not available. -You will be using JTS a lot as it literally is the "shape" of GeoTools. It captures shapes using constructs like Coordinate, Point, Polygon and LineString. +You will be using JTS a lot as it literally is the "shape" of GeoTools. It captures shapes using constructs like ``Coordinate`` ``Point`` ``Polygon`` and ``LineString`` -* Do keep in mind that JTS is pure topology and the Geometry objects are pure shapes with no meaning. For the meaning, placing that shape on the earth, you will need to consult a CoordinateReferenceSystem. -* JTS topologic operations work in a two dimensional Cartesian plane. With this in mind three dimensional shapes can be represented, but not calculated with. -* JTS focuses on *linear* topology, you will need to represent curves as a LineString with many little segments. +* Do keep in mind that JTS is pure topology and the Geometry objects are pure shapes with no meaning. For the meaning, placing that shape on the earth, you will need to consult a ``CoordinateReferenceSystem`` . +* JTS topological operations work in a two dimensional Cartesian plane. With this in mind three dimensional shapes can be represented, but not calculated with. +* JTS focuses on *linear* topology, you will need to represent curves as a ``LineString`` with many little segments. -With those notes it may sound like JTS is limited; it is instead focused on the task at hand - Geographic Information Systems. While 3D and curves may be common in CAD systems we will need a lot of funding and raw science to make it work for GIS. Some of that work is happening in GeoTools with ISO Geometry. +With those notes it may sound like JTS is limited; it is instead focused +on the task at hand - Geographic Information Systems. While 3D and +curves may be common in CAD systems we will need a lot of funding and +raw science to make it work for GIS. Some of that work is happening in +GeoTools with ISO Geometry. Q: What Geometry Specifications? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -23,7 +27,7 @@ JTS is an implementation of the OGC Simple Features for SQL Specification (i.e. Specification Supports Implementation ======================== ============ =============================== Simple Features for SQL 2.5D, linear Java Topology Suite -ISO Geometry 3D, curves OpenGIS ISO Geoemtry interfaces +ISO Geometry 3D, curves OpenGIS ISO Geometry interfaces ======================== ============ =============================== -GeoTools makes a point of working with both implementations, but frankly the ISO Geometry implementations are not ready yet. \ No newline at end of file +GeoTools makes a point of working with both implementations, but frankly the ISO Geometry implementations are not ready yet. diff --git a/docs/user/library/jts/geometry.rst b/docs/user/library/jts/geometry.rst index 3940647e8b7..fea8be4ce87 100644 --- a/docs/user/library/jts/geometry.rst +++ b/docs/user/library/jts/geometry.rst @@ -1,7 +1,7 @@ Geometry -------- -To create a Geometry object we make use of the GeometryFactory provided by JTS. GeometryFactory has a bunch of create methods that take Coordinate instances (and arrays) and wrap them up in the appropriate instance of Geometry. +To create a Geometry object we make use of the ``GeometryFactory`` provided by JTS. ``GeometryFactory`` has a bunch of create methods that take Coordinate instances (and arrays) and wrap them up in the appropriate instance of Geometry. The OGC Simple Features for SQL specification implemented by JTS works with *Point*, *LineString* and *Polygon*. @@ -9,11 +9,11 @@ The OGC Simple Features for SQL specification implemented by JTS works with *Poi Each *Geometry* can be contained in an *Envelope* (acting as a bounding box that contains all the geometry coordinates). -The OGC Simple Feature for SQL specification also provides support for GeometryCollections. GeometryCollections are themselves considered a Geometry. +The OGC Simple Feature for SQL specification also provides support for ``GeometryCollections``. ``GeometryCollections`` are themselves considered a Geometry. .. image:: /images/geometry_collection.png -You can create your own GeometryFactory with a specific PrecisionModel and CoordinateSequenceFactory. +You can create your own ``GeometryFactory`` with a specific ``PrecisionModel`` and ``CoordinateSequenceFactory``. .. image:: /images/geometry_factory.png @@ -25,12 +25,12 @@ GeoTools extends these core Geometry classes to allow support for curves. These .. image:: /images/geometry2.png -The linearization process used to generate coordinates makes use of the control points defining the curve and a tolerance provided by a CurvedGeometryFactory. +The linearization process used to generate coordinates makes use of the control points defining the curve and a tolerance provided by a ``CurvedGeometryFactory``. Creating a Point ^^^^^^^^^^^^^^^^ -This time we are using a JTS GeometryFactory, although you can create one yourself (if you want to fiddle with Precision}} there is a global one available using the FactoryFinder.: +This time we are using a JTS ``GeometryFactory``, although you can create one yourself (if you want to fiddle with Precision}} there is a global one available using the ``FactoryFinder``.: .. literalinclude:: /../src/main/java/org/geotools/geometry/GeometryExamples.java :language: java @@ -44,7 +44,7 @@ This time we are using a JTS GeometryFactory, although you can create one yourse :start-after: // createPointWKT start :end-before: // createPointWKT end -If you need to represent many points (perhaps fence posts forming a fence) you can use use a MultiPoint. +If you need to represent many points (perhaps fence posts forming a fence) you can use use a ``MultiPoint``. Creating a LineString ^^^^^^^^^^^^^^^^^^^^^ @@ -61,14 +61,14 @@ The following makes a line string in the shape of a check mark:: LineString line = geometryFactory.createLineString(coordinates); -Alternative - Reading a LineString from WKT:: +Alternative - Reading a ``LineString`` from WKT:: GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory(); WKTReader reader = new WKTReader( geometryFactory ); LineString line = (LineString) reader.read("LINESTRING(0 2, 2 0, 8 6)"); -If you need to represent a line with gaps in it you can use a MultiLineString. +If you need to represent a line with gaps in it you can use a ``MultiLineString``. Creating a Polygon ^^^^^^^^^^^^^^^^^^ @@ -94,19 +94,19 @@ Alternative - Reading a Polygon from WKT:: WKTReader reader = new WKTReader( geometryFactory ); Polygon polygon = (Polygon) reader.read("POLYGON((20 10, 30 0, 40 10, 30 20, 20 10))"); -You can also create a Polygon will holes in it. And once again use a MultiPolygon to represent a single geometry made up of distinct shapes. +You can also create a Polygon will holes in it. And once again use a ``MultiPolygon`` to represent a single geometry made up of distinct shapes. Creating CircularString ^^^^^^^^^^^^^^^^^^^^^^^ -To create a CircularString (or a CircularRing) use the GeoTools CurvedGeometryFactory. When setting up a CurvedGeometryFactory the provided tolerance will be used during linearization: +To create a ``CircularString`` (or a ``CircularRing``) use the GeoTools ``CurvedGeometryFactory``. When setting up a ``CurvedGeometryFactory`` the provided tolerance will be used during linearization: .. literalinclude:: /../src/main/java/org/geotools/geometry/GeometryExamples.java :language: java :start-after: // createCurve start :end-before: // createCurve end -The circle arc is defined between coordinates 10,14 and 14, 10 passing through point 6,10. The example uses a PackedCoordinateSequence allowing an array of doubles to be used directly. Curve support is limited to 2D coordinates. A CircularLineString is returned in this case, a CircularRing would be produced if two or more curves were provided form a closed ring. +The circle arc is defined between coordinates 10,14 and 14, 10 passing through point 6,10. The example uses a ``PackedCoordinateSequence`` allowing an array of doubles to be used directly. Curve support is limited to 2D coordinates. A ``CircularLineString`` is returned in this case, a ``CircularRing`` would be produced if two or more curves were provided form a closed ring. Reading a circular arc from WKT: @@ -115,7 +115,7 @@ Reading a circular arc from WKT: :start-after: // wktCurve start :end-before: // wktCurve end -A CompoundCurve (or closed CompoundRing) consists mix of CircularString and/or plain LineString components. +A ``CompoundCurve`` (or closed ``CompoundRing``) consists mix of ``CircularString`` and/or plain ``LineString`` components. Custom Curves ^^^^^^^^^^^^^ @@ -136,12 +136,12 @@ Creating a Circle:: return shapeFactory.createCircle(); } -Even though "GeometricShapeFactory" is provided out of the box from JTS; there is nothing fancy +Even though ``GeometricShapeFactory`` is provided out of the box from JTS; there is nothing fancy about the code. It creates a series of coordinates in a circle. Another approach is to create a curve or shape object with one of Java's handy Shape classes and then extract the coordinates from that object to create your geometry. -Arcs without the maths:: +Arcs without the math:: private static Geometry createBezierCurve(Coordinate start, Coordinate end, @@ -178,7 +178,7 @@ Here's an example of some randomly orientated and shaped curves generated in thi .. image:: /images/geometry_curve.gif -Sometimes you need to generate a smooth curve that is guaranteed to pass through a specified set of points. The tried and true approach here is to use a spline function. This generates a set of polynomial (cubic) curves, each of which fits a part of the data and joins smoothly to its neighbouring curves. +Sometimes you need to generate a smooth curve that is guaranteed to pass through a specified set of points. The tried and true approach here is to use a spline function. This generates a set of polynomial (cubic) curves, each of which fits a part of the data and joins smoothly to its neighboring curves. Splines:: @@ -231,62 +231,62 @@ Using Geometry is pretty straight forward, although a little intimidating when s Some summary information is available: -* getArea() - area returned in the same units as the coordinates (be careful of lat/lon data!) -* getCentroid() - the centre of the geometry -* getEnvelope() - returns a geometry which is probably not what you wanted -* getEnvelopeInternal() - this returns a useful Envelope -* getInteriorPoint() - the centre of the geometry (that is actually on the geometry) -* getDimension() +* ``getArea()`` - area returned in the same units as the coordinates (be careful of latitude/longitude data!) +* ``getCentroid()`` - the center of the geometry +* ``getEnvelope()`` - returns a geometry which is probably not what you wanted +* ``getEnvelopeInternal()`` - this returns a useful Envelope +* ``getInteriorPoint()`` - the center of the geometry (that is actually on the geometry) +* ``getDimension()`` Geometry relationships are represented by the following functions returning true or false: -* disjoint(Geometry) - same as "not" intersects -* touches(Geometry) - geometry have to just touch, crossing or overlap will not work -* intersects(Geometry) -* crosses(Geometry) -* within(Geometry) - geometry has to be full inside -* contains(Geometry) -* overlaps(Geometry) - has to actually overlap the edge, being within or touching will not work -* covers(Geometry) -* coveredBy(Geometry) -* relate(Geometry, String) - allows general check of relationship see dim9 page -* relate(Geometry) +* ``disjoint(Geometry)`` - same as "not" intersects +* ``touches(Geometry)`` - geometry have to just touch, crossing or overlap will not work +* ``intersects(Geometry)`` +* ``crosses(Geometry)`` +* ``within(Geometry)`` - geometry has to be full inside +* ``contains(Geometry)`` +* ``overlaps(Geometry)`` - has to actually overlap the edge, being within or touching will not work +* ``covers(Geometry)`` +* ``coveredBy(Geometry)`` +* ``relate(Geometry, String)`` - allows general check of relationship see :doc:`dim9 page` +* ``relate(Geometry)`` To actually determine a shape based on two geometry: -* intersection(Geometry) -* union(Geometry) -* difference(Geometry) -* symDifference(Geometry) +* ``intersection(Geometry)`` +* ``union(Geometry)`` +* ``difference(Geometry)`` +* ``symDifference(Geometry)`` Some of the most helpful functions are: -* distance( Geometry ) -* buffer(double) - used to buffer the edge of a geometry to produce a polygon -* union() - used on a geometry collection to produce a single geometry +* ``distance(Geometry)`` +* ``buffer(double)`` - used to buffer the edge of a geometry to produce a polygon +* ``union()`` - used on a geometry collection to produce a single geometry The three most difficult methods are here (they will be discussed in detail): -* equals( Object ) - normal Java equals which checks that the two objects are the same instance -* equals( Geometry ) - checks if the geometry is the same shape -* equalsExact( Geometry ) - check if the data structure is the same +* ``equals(Object)`` - normal Java equals which checks that the two objects are the same instance +* ``equals(Geometry)`` - checks if the geometry is the same shape +* ``equalsExact(Geometry)`` - check if the data structure is the same There are some book keeping methods to help discovery how the geometry was constructed: -* getGeometryFactory() -* getPreceisionModel() -* toText() - the WKT representation of the Geometry -* getGeoemtryType() - factory method called (i.e. "point", "linestring", etc..) +* ``getGeometryFactory()`` +* ``getPreceisionModel()`` +* ``toText()`` - the WKT representation of the Geometry +* ``getGeoemtryType()`` - factory method called (i.e. ``point``, ``linestring``, etc..) A couple of methods are there to store your developer information: -* getSRID() - stores the "spatial reference id", used as an external key when working with databases -* getUserData() - intended to be used by developers, a best practice is to store a java.util.Map. GeoTools will occasionally use this field to store a "srsName" or full CoordinateReferenceSystem. +* ``getSRID()`` - stores the "spatial reference id", used as an external key when working with databases +* ``getUserData()`` - intended to be used by developers, a best practice is to store a ``java.util.Map``. GeoTools will occasionally use this field to store a ``srsName`` or full ``CoordinateReferenceSystem``. -Geometries Enum -^^^^^^^^^^^^^^^ +Geometries Enumeration +^^^^^^^^^^^^^^^^^^^^^^ -Code that makes use of Geometry ends up doing a fair amount of "instanceof" testing in order to determine what kind of Geometry is being used (to take appropriate action). +Code that makes use of Geometry ends up doing a fair amount of ``instanceof`` testing in order to determine what kind of ``Geometry`` is being used (to take appropriate action). We have an enumeration defined to help out in this case: @@ -298,29 +298,29 @@ We have an enumeration defined to help out in this case: PrecisionModel ^^^^^^^^^^^^^^ -Out of the box JTS works with a default double precision model. Configuring your GeometryFactory with a PrecisionModel allows you to work at a different resolution than this default. +Out of the box JTS works with a default double precision model. Configuring your ``GeometryFactory`` with a ``PrecisionModel`` allows you to work at a different resolution than this default. -PrecisionModel forms the heart of "numerical stability" when working with Geometry. When working with large values the mathematics built into Java are not very accurate. By explicitly capturing the "round-off" process in a PrecisionModel JTS allows to manage these sorts of errors and make an appropriate tradeoff of speed vs accuracy for your work. +``PrecisionModel`` forms the heart of "numerical stability" when working with Geometry. When working with large values the mathematics built into Java are not very accurate. By explicitly capturing the "round-off" process in a ``PrecisionModel`` JTS allows to manage these sorts of errors and make an appropriate trade off of speed vs accuracy for your work. * Round-off often occur, even when working in double precision. Especially if you are working in a coordinate system with big numbers and you're a long way from the origin. -* The other reason to look at PrecisionModel is to ensure it matches +* The other reason to look at ``PrecisionModel`` is to ensure it matches your final use for your data. If you know you are only going to display an answer on the screen, you may be able to get by with reduced precision. - By matching the PrecisionModel with your expected use, certain long + By matching the ``PrecisionModel`` with your expected use, certain long running operations (that need to converge on an answer) can stop when they have reached the level of detail you expect. No sense doing extra work for more significant digits if the result is going to be rounded off at the end of the day. -The following code example takes into account that the location being passed in was only supplied as a floating point value x/y. We handle this by creating this test point with a GeometryFactory that takes a PrecisionModel argument. The test point will be flagged as having a certain limited precision and all JTS operations will take this into account. +The following code example takes into account that the location being passed in was only supplied as a floating point value x/y. We handle this by creating this test point with a ``GeometryFactory`` that takes a ``PrecisionModel`` argument. The test point will be flagged as having a certain limited precision and all JTS operations will take this into account. -There are various ways of specifying a PrecisionModel but here we base it on the number of decimal places to use for coordinate comparisons.:: +There are various ways of specifying a ``PrecisionModel`` but here we base it on the number of decimal places to use for coordinate comparisons.:: private boolean polyContains(Polygon poly, float x, float y, int numDecPlaces) { double scale = Math.pow(10, numDecPlaces); @@ -331,7 +331,7 @@ There are various ways of specifying a PrecisionModel but here we base it on the return poly.contains(testPoint); } -You can also define the PrecisionModel using a couple of constants:: +You can also define the ``PrecisionModel`` using a couple of constants:: pm = new PrecisionModel( PrecisionModel.Type.FIXED ); // fixed decimal point pm = new PrecisionModel( PrecisionModel.Type.FLOATING ); // for Java double @@ -340,16 +340,16 @@ You can also define the PrecisionModel using a couple of constants:: This is an advanced feature that is not often used. -CoordinateSequence -^^^^^^^^^^^^^^^^^^ +``CoordinateSequence`` +^^^^^^^^^^^^^^^^^^^^^^ -You may wish to provide a custom CoordinateSequenceFactory for reasons of efficiency and/or reducing memory use. +You may wish to provide a custom ``CoordinateSequenceFactory`` for reasons of efficiency and/or reducing memory use. -Internally Geometry often works with Coordinate[]. However many of the spatial formats used for JTS will store values as a flat double[] or float[] for efficiency. By implementing a CoordinateSequenceFactory GeoTools can teach JTS how to handle the values directly out of a shapefile for example. +Internally Geometry often works with Coordinate[]. However many of the spatial formats used for JTS will store values as a flat double[] or float[] for efficiency. By implementing a ``CoordinateSequenceFactory`` GeoTools can teach JTS how to handle the values directly out of a shapefile for example. This is an advanced feature that is not often used. JTS ^^^ -Some of the code examples used above reference the *JTS* utility class. This class is provided by **gt-main** module; and contains many helpful methods for working with Geometry. +Some of the code examples used above reference the *JTS* utility class. This class is provided by ``gt-main`` module; and contains many helpful methods for working with Geometry. diff --git a/docs/user/library/jts/operation.rst b/docs/user/library/jts/operation.rst index 846fad7a386..87430566541 100644 --- a/docs/user/library/jts/operation.rst +++ b/docs/user/library/jts/operation.rst @@ -11,16 +11,16 @@ JTS Geometry operations are used to perform a range of spatial calculations; fro * Difference * SymDifference -The JTS Geometry operations closely follow the simple features for sql specification; so if you have any questions on exactly what is going on please review the related specification. +The JTS Geometry operations closely follow the simple features for SQL specification; so if you have any questions on exactly what is going on please review the related specification. Buffer ^^^^^^ -Creates a polygon or multi polygon containing all points within a set distance: +Creates a polygon or multi polygon containing all points within a set distance:: Geometry buffer = geometry.buffer( 2.0 ); // note distance is in same units as geometry -Please keep in mind that the buffer is defined using the same distance units as used for your coordinates and is calculated in 2D only. You may wish to transform your geometry, buffer it, and then transform the result back when working in real world units such as DefaultGeographicCRS.WGS84. +Please keep in mind that the buffer is defined using the same distance units as used for your coordinates and is calculated in 2D only. You may wish to transform your geometry, buffer it, and then transform the result back when working in real world units such as ``DefaultGeographicCRS.WGS84``. Intersection ^^^^^^^^^^^^ diff --git a/docs/user/library/jts/relate.rst b/docs/user/library/jts/relate.rst index 519df9ce836..e0c87b99e19 100644 --- a/docs/user/library/jts/relate.rst +++ b/docs/user/library/jts/relate.rst @@ -38,10 +38,10 @@ This method will fail if called on an invalid geometry. return geometry.equalsExact( (Geometry) geometry2 ); - This method is faster than equals( geometry ) and is closer to what normal Java programs assume for a data + This method is faster than ``equals(geometry)`` and is closer to what normal Java programs assume for a data object equals method implementation. We are checking the internal structure; rather than the meaning. - The equalsExact method is able to function on invalid geometries. + The ``equalsExact`` method is able to function on invalid geometries. * Alternative - Identity Operator @@ -82,7 +82,7 @@ The geometries only touch edges and do not overlap in any way:: Crosses ^^^^^^^^ -The geometries do more than touch, they actually overlap edges: +The geometries do more than touch, they actually overlap edges:: return geometryA.crosses( geometry2 ); @@ -112,8 +112,8 @@ The definition of the overlaps relationship is a little bit different than that Relates ^^^^^^^ -Computes the "DE-9IM Matrix" for two Geometries allowing you to study exactly how they interact with each other.:: +Computes the "DE-9IM Matrix" for two ``Geometries`` allowing you to study exactly how they interact with each other.:: IntersectionMatrix m = a.relate(b); -The IntersectionMatrix allows you to separately test how the interior, exterior and edges of two geometries interact. All the above operations can be viewed as a summary of this IntersectionMatrix. +The ``IntersectionMatrix`` allows you to separately test how the interior, exterior and edges of two geometries interact. All the above operations can be viewed as a summary of this ``IntersectionMatrix``. diff --git a/docs/user/library/jts/snap.rst b/docs/user/library/jts/snap.rst index 7db2b5750fc..5a6884c8496 100644 --- a/docs/user/library/jts/snap.rst +++ b/docs/user/library/jts/snap.rst @@ -22,9 +22,8 @@ To begin, we prompt the user for a shapefile containing line features and connec :start-after: package org.geotools :end-before: // load shapefile end -You might be used to working with shapefiles as a streaming data source, ie. reading features from -disk as required. Here we optimize things by extracting the line geometries from the features and -caching them in a JTS SpatialIndex object. This gives us speed in two ways: we have the lines in +You might be used to working with shapefiles as a streaming data source, i.e. reading features from disk as required. Here we optimize things by extracting the line geometries from the features and +caching them in a JTS ``SpatialIndex`` object. This gives us speed in two ways: we have the lines in memory and can search for them efficiently by location: .. literalinclude:: /../src/main/java/org/geotools/jts/SnapToLine.java @@ -32,10 +31,7 @@ memory and can search for them efficiently by location: :start-after: // load shapefile end :end-before: // cache features end -Notice that we wrapped each feature's line geometry in a JTS **LocationIndexedLine** object which -we will use to find the point on a line closest to a reference point. We could have loaded the lines -directly into the spatial index, but this way we will avoid wrapping each line every time it is -tested against a point. +Notice that we wrapped each feature's line geometry in a JTS ``LocationIndexedLine`` object which we will use to find the point on a line closest to a reference point. We could have loaded the lines directly into the spatial index, but this way we will avoid wrapping each line every time it is tested against a point. Now let's make some pretend point data: @@ -44,8 +40,7 @@ Now let's make some pretend point data: :start-after: // cache features end :end-before: // generate points end -At last we are ready to snap points. We create a search envelope of fixed size around each point and -use this to query the lines in the spatial index. +At last we are ready to snap points. We create a search envelope of fixed size around each point and use this to query the lines in the spatial index. In case your shapefile is large, we'll set a time limit on how long snapping continues: @@ -56,7 +51,9 @@ In case your shapefile is large, we'll set a time limit on how long snapping con You can experiment with this code: * try some actual roads - using real data makes a difference -* try using a QuadTree - it is often much slower (but you can add and remove things from a QuadTree at runtime) -* are you getting whacky results? Check if your geometry.isValid() prior to using it -* try simplifying the lines prior to creating the LocationIndexedLine - it should be much faster -* If you are unsure how to do activities listed above consult the "Secrets of JTS" link provided at the top of the page. +* try using a ``QuadTree`` - it is often much slower (but you can add and remove things from a ``QuadTree`` at runtime) +* are you getting wacky results? Check if your ``geometry.isValid()`` prior to using it +* try simplifying the lines prior to creating the ``LocationIndexedLine`` - it should be much faster +* If you are unsure how to do activities listed above consult the `Secrets of JTS `_ link provided at the top of the page. + + diff --git a/docs/user/library/main/collection.rst b/docs/user/library/main/collection.rst index 13f81707d4a..5f2916da1cd 100644 --- a/docs/user/library/main/collection.rst +++ b/docs/user/library/main/collection.rst @@ -1,22 +1,22 @@ -FeatureCollection ------------------ +``FeatureCollection`` +--------------------- -A **FeatureCollection** is a collection of Features similar to a JDBC **ResultSet**. +A ``FeatureCollection`` is a collection of Features similar to a JDBC ``ResultSet``. Overview ^^^^^^^^ -FeatureCollection is similar to a Java Collection. The crucial difference is the -requirement to close each FeatureIterator after use in order to prevent memory and connection +``FeatureCollection`` is similar to a Java ``Collection``. The crucial difference is the +requirement to close each ``FeatureIterator`` after use in order to prevent memory and connection leaks. -In addition to the above key requirement, FeatureCollection provides methods to review the -FeatureType of the members, ask for the bounds (rather than just the size) and so on. +In addition to the above key requirement, ``FeatureCollection`` provides methods to review the +``FeatureType`` of the members, ask for the bounds (rather than just the size) and so on. With this in mind: -* FeatureCollection is method compatible with java.util.Collection where possible -* **Iterator** need to be closed. +* ``FeatureCollection`` is method compatible with ``java.util.Collection`` where possible +* ``Iterator`` need to be closed. As provided: @@ -25,11 +25,11 @@ With this in mind: :start-after: // exampleIterator start :end-before: // exampleIterator end -* All the content is of the same FeatureType as indicated by indicated by:: +* All the content is of the same ``FeatureType`` as indicated by indicated by:: FeatureType type = featureCollection.getSchema(); -* We cannot support the Java 'for each' loop syntax; as we need to be sure to close our iterator(). +* We cannot support the Java 'for each' loop syntax; as we need to be sure to close our ``iterator()``. * We can support the Java try-with-resource syntax:: @@ -40,7 +40,8 @@ With this in mind: } } -**FeatureCollection** +``FeatureCollection`` +""""""""""""""""""""" The interface provides the following methods:: @@ -72,13 +73,14 @@ The interface provides the following methods:: O[] toArray(O[]) } -**Streaming Results** +Streaming Results +''''''''''''''''' -A FeatureCollection is not an in-memory snapshot of your data (as you might expect), we work with the assumption that GIS data is larger than you can fit into memory. +A ``FeatureCollection`` is not an in-memory snapshot of your data (as you might expect), we work with the assumption that GIS data is larger than you can fit into memory. -Most implementations of FeatureCollection provide a memory footprint close to zero and each time you access the data will be loaded as you use it. +Most implementations of ``FeatureCollection`` provide a memory footprint close to zero and each time you access the data will be loaded as you use it. -Please note that you should not treat a FeatureCollection as a normal in-memory Java collection - these are heavyweight objects and we must ask you to close any iterators you open.:: +Please note that you should not treat a ``FeatureCollection`` as a normal in-memory Java collection - these are heavyweight objects and we must ask you to close any iterators you open.:: FeatureIterator iterator = featureCollection.features(); try { @@ -91,7 +93,7 @@ Please note that you should not treat a FeatureCollection as a normal in-memory iterator.close(); } -We ask that you treat interaction with FeatureCollection as a ResultSet carefully closing each object +We ask that you treat interaction with ``FeatureCollection`` as a ``ResultSet`` carefully closing each object when you are done with it. In Java 7 this becomes easier with the try-with-resource syntax:: @@ -103,10 +105,10 @@ In Java 7 this becomes easier with the try-with-resource syntax:: } } -SimpleFeatureCollection -^^^^^^^^^^^^^^^^^^^^^^^ +``SimpleFeatureCollection`` +''''''''''''''''''''''''''' -Because Java Generics (ie and ) are a little hard to read we introduced SimpleFeatureCollection to cover the common case:: +Because Java Generics (i.e. ```` and ````) are a little hard to read we introduced ``SimpleFeatureCollection`` to cover the common case:: public interface SimpleFeatureCollection extends FeatureCollection { // feature access - close when done! @@ -136,17 +138,17 @@ Because Java Generics (ie and ) are a little hard to read we introduced S } This SimpleFeatureCollection interface is just syntactic sugar to avoid typing in -FeatureCollection all the time. If you need to -safely convert you can use the DataUtilities.simple method:: +``FeatureCollection`` all the time. If you need to +safely convert you can use the ``DataUtilities.simple`` method:: SimpleFeatureCollection simpleCollection = DataUtilities.simple(collection); -Creating a FeatureCollection is usually done for you as a result of a query, although we do have a number of implementations you can work with directly. +Creating a ``FeatureCollection`` is usually done for you as a result of a query, although we do have a number of implementations you can work with directly. From DataStore '''''''''''''' -The most common thing to do is grab a FeatureCollection from a file or service.:: +The most common thing to do is grab a ``FeatureCollection`` from a file or service.:: File file = new File("example.shp"); Map map = new HashMap(); @@ -157,22 +159,22 @@ The most common thing to do is grab a FeatureCollection from a file or service.: SimpleFeatureCollection collection = featureSource.getFeatures(); Please be aware that this is not a copy - the SimpleFeatureCollection above should be -considered to be the same thing as the "example.shp". Changes made to the collection +considered to be the same thing as the ``example.shp``. Changes made to the collection will be written out to the shapefile. * Using a Query to order your Attributes Occasionally you will want to specify the exact order in which your attributes are - presented to you, or even leave some attributes out altogether. + presented to you, or even leave some attributes out altogether.:: Query query = new Query( typeName, filter); query.setPropertyNames( "geom", "name" ); SimpleFeatureCollection sorted = source.getFeatures(query); - Please note that the resulting SimpleFeatureCollection.getSchema() will not match - SimpleFeatureSource.getFeatureType(), since the attributes will now be limited to (and in the order) specified. + Please note that the resulting ``SimpleFeatureCollection.getSchema()`` will not match + ``SimpleFeatureSource.getFeatureType()``, since the attributes will now be limited to (and in the order) specified. -* Using a Query to Sort a SimpleFeatureCollection +* Using a ``Query`` to Sort a ``SimpleFeatureCollection`` Sorting is available:: @@ -189,8 +191,7 @@ will be written out to the shapefile. SimpleFeatureCollection collection = myFeatureSource.getFeatures(); SimpleFeatureCollection memory = DataUtilities.collection( collection ); - However as mentioned above this will be using the default TreeSet based feature collection implementation - and will not be fast. How not fast? Well your shapefile access on disk may be faster (since it has a spatial index). + However as mentioned above this will be using the default ``TreeSet`` based feature collection implementation and will not be fast. How not fast? Well your shapefile access on disk may be faster (since it has a spatial index). DefaultFeatureCollection @@ -198,9 +199,9 @@ DefaultFeatureCollection GeoTools provides a default implementation of feature collection that can be used to gather up your features in memory; prior to writing them out to a DataStore. -This default implementation of SimpleFeatureCollection uses a TreeMap sorted by FeatureId; so it does not offer very fast performance. +This default implementation of ``SimpleFeatureCollection`` uses a ``TreeMap`` sorted by ``FeatureId``; so it does not offer very fast performance. -To create a new DefaultFeatureCollection:: +To create a new ``DefaultFeatureCollection``:: DefaultFeatureCollection featureCollection = new DefaultFeatureCollection(); @@ -208,7 +209,7 @@ You can also create your collection with an "id", which will can be used as a ha DefaultFeatureCollection featureCollection = new DefaultFeatureCollection("internal"); -You can create new features and add them to this FeatureCollection as needed:: +You can create new features and add them to this ``FeatureCollection`` as needed:: SimpleFeatureType TYPE = DataUtilities.createType("location","geom:Point,name:String"); @@ -221,32 +222,32 @@ You can create new features and add them to this FeatureCollection as needed:: To FeatureSource '''''''''''''''' -You often need to "wrap" up your FeatureCollection as a feature source in order to make effective use of it (SimpleFeatureSource supports the ability to query the contents, and can be used in a MapLayer for rendering).:: +You often need to "wrap" up your ``FeatureCollection`` as a feature source in order to make effective use of it (``SimpleFeatureSource`` supports the ability to query the contents, and can be used in a ``MapLayer`` for rendering).:: SimpleFeatureSource source = DataUtilities.source( collection ); Existing Content '''''''''''''''' -The DataUtilities class has methods to create a feature collection from a range of sources: +The ``DataUtilities`` class has methods to create a feature collection from a range of sources: -* DataUtilities.collection(FeatureCollection) -* DataUtilities.collection(FeatureReader) -* DataUtilities.collection(List) -* DataUtilities.collection(SimpleFeature) -* DataUtilities.collection(SimpleFeature[]) -* DataUtilities.collection(SimpleFeatureIterator) +* ``DataUtilities.collection(FeatureCollection)`` +* ``DataUtilities.collection(FeatureReader)`` +* ``DataUtilities.collection(List)`` +* ``DataUtilities.collection(SimpleFeature)`` +* ``DataUtilities.collection(SimpleFeature[])`` +* ``DataUtilities.collection(SimpleFeatureIterator)`` For more information see :doc:`data`. Performance Options ''''''''''''''''''' -For GeoTools 2.7 we are making available a couple new implementations of FeatureCollection. +For GeoTools 2.7 we are making available a couple new implementations of ``FeatureCollection``. These implementations of SimpleFeatureCollection will each offer different performance characteristics: -* TreeSetFeatureCollection: the traditional TreeSet implementation used +* ``TreeSetFeatureCollection``: the traditional ``TreeSet`` implementation used by default. Note this does not perform well with spatial queries as the contents are @@ -256,22 +257,22 @@ These implementations of SimpleFeatureCollection will each offer different perfo content on disk (even down to duplicating the content it gives you in order to prevent any trouble if another thread makes a modification). - DataUtilities.source( featureCollection ) will wrap - TreeSetFeatureCollection in a CollectionFeatureSource. + ``DataUtilities.source(featureCollection)`` will wrap + ``TreeSetFeatureCollection`` in a ``CollectionFeatureSource``. -* ListFeatureCollection: uses a list to hold contents; please be sure +* ``ListFeatureCollection``: uses a list to hold contents; please be sure not to have more then one feature with the same id. The benefit here is being able to wrap a List you already have up as - a FeatureCollection without copying the contents over one at a time. + a ``FeatureCollection`` without copying the contents over one at a time. The result does not perform well as the contents are not indexed in anyway (either by a spatial index, or by feature id). - DataUtilities.source( featureCollection ) will wrap - ListFeatureCollection in a CollectionFeatureSource. + ``DataUtilities.source(featureCollection)`` will wrap + ``ListFeatureCollection`` in a ``CollectionFeatureSource``. - Here is an example using the ListFeatureCollection:: + Here is an example using the ``ListFeatureCollection``:: SimpleFeatureType TYPE = DataUtilities.createType("location","geom:Point,name:String"); WKTReader2 wkt = new WKTReader2(); @@ -287,20 +288,20 @@ These implementations of SimpleFeatureCollection will each offer different perfo SimpleFeatureCollection features = source.getFeatures( filter ); Please keep in mind that the original list is being used by the - ListFeatureCollection; so the contents will not be copied making + ``ListFeatureCollection``; so the contents will not be copied making this a lean solution for getting your features bundled up. The flip - side is that you should use the FeatureCollection methods to modify the + side is that you should use the ``FeatureCollection`` methods to modify the contents after creation (so it can update the bounds). -* SpatialIndexFeatureCollection: uses a spatial index to hold on to - contents for fast visual display in a MapLayer; you cannot add more +* ``SpatialIndexFeatureCollection``: uses a spatial index to hold on to + contents for fast visual display in a ``MapLayer``; you cannot add more content to this feature collection once it is used - DataUtilities.source( featureCollection ) will wrap - SpatialIndexFeatureCollection in a SpatialIndexFeatureSource + ``DataUtilities.source(featureCollection)`` will wrap + ``SpatialIndexFeatureCollection`` in a ``SpatialIndexFeatureSource`` that is able to take advantage of the spatial index. - Here is an example using the SpatialIndexFeatureCollection:: + Here is an example using the ``SpatialIndexFeatureCollection``:: final SimpleFeatureType TYPE = DataUtilities.createType("location","geom:Point,name:String"); WKTReader2 wkt = new WKTReader2(); @@ -313,25 +314,25 @@ These implementations of SimpleFeatureCollection will each offer different perfo SimpleFeatureSource source = DataUtilities.source( collection ); SimpleFeatureCollection features = source.getFeatures( filter ); - The SpatialIndexFeatureCollection is fast, but tricky to use. It will store the - features itself, using a JTS STRtree spatial index. This means the contents of + The ``SpatialIndexFeatureCollection`` is fast, but tricky to use. It will store the + features itself, using a JTS ``STRtree`` spatial index. This means the contents of the feature collection cannot be modified after the index set up, and the index is set up the first time you query the collection (asking for size, bounds, or pretty much anything other then add ). - To get the full benefit you need to use SimpleFeatureSource as shown above; it + To get the full benefit you need to use ``SimpleFeatureSource`` as shown above; it will make use of the spatial index when performing a filter. Contents ^^^^^^^^ -A SimpleFeatureCollection method compatible with Java Collection; this +A ``SimpleFeatureCollection`` method compatible with Java ``Collection``; this means that an Iterator is available for you to to access the contents. However you will need to close your iterator after use; so that any resources (such as database connections) are returned. Direct -'''''' +^^^^^^ The following lists several ways of reading data so you can choose the approach that suites you your needs. You may find the use of **Iterator** comfortable (but a bit troubling with try/catch code needed to close the iterator). @@ -339,7 +340,7 @@ find the use of **Iterator** comfortable (but a bit troubling with try/catch cod extreme **FeatureReader** makes all the error messages visible requiring a lot of try/catch code. Finally we have **FeatureIterator** when working on Java 1.4 code before generics were available. -* Using FeatureIterator +* Using ``FeatureIterator`` Use of iterator is straight forward; with the addition of a try/finally statement to ensure the iterator is closed after use.:: @@ -361,9 +362,9 @@ have **FeatureIterator** when working on Java 1.4 code before generics were avai * Invalid Data Currently GeoTools follows a "fail first" policy; that is if the data does not exactly - meet the requirements of the SimpleFeatureType a RuntimeException will be thrown. + meet the requirements of the ``SimpleFeatureType`` a ``RuntimeException`` will be thrown. - However often you may in want to just "skip" the troubled Feature and carry on; very few datasets are perfect.:: + However often you may in want to just "skip" the troubled Feature and carry on; very few data sets are perfect.:: SimpleFeatureCollection featureCollection = featureSource.getFeatures(filter); FeatureIterator iterator = null; @@ -390,11 +391,11 @@ have **FeatureIterator** when working on Java 1.4 code before generics were avai System.out.println("Read "+count + "features, with "+problems+" failures"); } - Individual DataStores may be able to work with your data as it exists (invalid or not). + Individual ``DataStores`` may be able to work with your data as it exists (invalid or not). -* Use of FeatureVisitor +* Use of ``FeatureVisitor`` - FeatureVisitor lets you traverse a FeatureCollection with less try/catch/finally boilerplate code.:: + ``FeatureVisitor`` lets you traverse a ``FeatureCollection`` with less try/catch/finally boilerplate code.:: CoordinateReferenceSystem crs = features.getMemberType().getCRS(); final BoundingBox bounds = new ReferencedEnvelope( crs ); @@ -407,9 +408,9 @@ have **FeatureIterator** when working on Java 1.4 code before generics were avai You do not have to worry about exceptions, open or closing iterators and as an added bonus this may even be faster (depending on the number of cores you have available). -* Comparison with SimpleFeatureReader +* Comparison with ``SimpleFeatureReader`` - SimpleFeatureReader is a "low level" version of Iterator that is willing to throw IOExceptions, + ``SimpleFeatureReader`` is a "low level" version of Iterator that is willing to throw ``IOExceptions``, it is a little bit more difficult to use but you may find the extra level of detail worth it.:: SimpleFeatureReader reader = null; @@ -436,36 +437,35 @@ have **FeatureIterator** when working on Java 1.4 code before generics were avai } Aggregate Functions -''''''''''''''''''' +^^^^^^^^^^^^^^^^^^^ -One step up from direct access is the use of an "aggregate" function that works on the entire FeatureCollection -to build you a summary. +One step up from direct access is the use of an "aggregate" function that works on the entire ``FeatureCollection`` to build you a summary. Traditionally functions that work on a collection are called "aggregate functions". -In the world of databases and SQL these functions include "min", "max", "average" and "count". GeoTools supports +In the world of databases and SQL these functions include ``min``, ``max``, ``average`` and ``count``. GeoTools supports these basic concepts, and a few additions such as bounding box or unique values. -Internally these functions are implemented as a FeatureVisitor; and are often optimised into raw SQL on supporting DataStores. +Internally these functions are implemented as a ``FeatureVisitor``; and are often optimized into raw SQL on supporting ``DataStores``. Here are the aggregate functions that ship with GeoTools at the time of writing. For the authoritative list check javadocs. ====================== ========================== ============================================ Function Visitor Notes ====================== ========================== ============================================ -Collection_Average AverageVisitor -Collection_Bounds BoundsVisitor Should be the same as getBounds() -Collection_Count CountVisitor Should be the same as size() -Collection_Max MaxVisitor With respect to comparable sort order -Collection_Median MedianVisitor With respect to comparable sort order -Collection_Min MinVisitor With respect to comparable sort order -Collection_Nearest NearestVisitor Nearest value to the provided one -Collection_Sum SumVisitor Restricted to Numeric content -Collection_Unique UniqueVisitor Set of unique values +``Collection_Average`` ``AverageVisitor`` +``Collection_Bounds`` ``BoundsVisitor`` Should be the same as ``getBounds()`` +``Collection_Count`` ``CountVisitor`` Should be the same as ``size()`` +``Collection_Max`` ``MaxVisitor`` With respect to comparable sort order +``Collection_Median`` ``MedianVisitor`` With respect to comparable sort order +``Collection_Min`` ``MinVisitor`` With respect to comparable sort order +``Collection_Nearest`` ``NearestVisitor`` Nearest value to the provided one +``Collection_Sum`` ``SumVisitor`` Restricted to Numeric content +``Collection_Unique`` ``UniqueVisitor`` ``Set`` of unique values ====================== ========================== ============================================ -* Sum of a FeatureCollection +* Sum of a ``FeatureCollection`` - Here is an example of using Collection_Sum on a FeatureCollection:: + Here is an example of using Collection_Sum on a ``FeatureCollection``:: FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(); Function sum = ff.function("Collection_Sum", ff.property("age")); @@ -473,9 +473,9 @@ Collection_Unique UniqueVisitor Set of unique values Object value = sum.evaluate( featureCollection ); assertEquals( 41, value ); -* Max of a FeatureCollection +* Max of a ``FeatureCollection`` - Here is an example of using Collection_Max on a FeatureCollection:: + Here is an example of using Collection_Max on a ``FeatureCollection``:: FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(); Function sum = ff.function("Collection_Max", ff.property("age")); @@ -483,7 +483,7 @@ Collection_Unique UniqueVisitor Set of unique values Object value = sum.evaluate( featureCollection ); assertEquals( 41, value ); - As an alternative you could directly use MaxVisitor:: + As an alternative you could directly use ``MaxVisitor``:: Expression = ff.property("age"); MaxVisitor maxVisitor = new MaxVisitor(expression); @@ -492,32 +492,26 @@ Collection_Unique UniqueVisitor Set of unique values Object max = result.getValue(); - MaxVisitor is pretty good about handling numeric and string types + ``MaxVisitor`` is pretty good about handling numeric and string types (basically anything that is comparable should work). - CalcResult is used to hold the value until you are interested in it; + ``CalcResult`` is used to hold the value until you are interested in it; you can run the same visitor across several collections and look at the maximum for all of them. Group By Visitor -'''''''''''''''' +^^^^^^^^^^^^^^^^ -This visitor allow us to group features by some attributes and apply an aggregation function on each group. This -visitor acts like the SQL group by command with an aggregation function. +This visitor allow us to group features by some attributes and apply an aggregation function on each group. This visitor acts like the SQL group by command with an aggregation function. -This visitor is implemented as a feature visitor that produces a calculation result. Internally the aggregation -function is mapped to a correspondent visitor and for each features group a different instance of that visitor -will be applied. +This visitor is implemented as a feature visitor that produces a calculation result. Internally the aggregation function is mapped to a correspondent visitor and for each features group a different instance of that visitor will be applied. -For SQL data stores that support group by statements and are able to handle the aggregation function this visitor -will be translated to raw SQL optimizing significantly is execution. In particular, the following conditions apply -to JDBC data stores: +For SQL data stores that support group by statements and are able to handle the aggregation function this visitor will be translated to raw SQL optimizing significantly is execution. In particular, the following conditions apply to JDBC data stores: * Aggregations and grouping on property names is support * Simple math expressions of the above are also supported (subtract, add, multiply, divide) * Functions may be supported, or not, depending on the filter capabilities of the data store. At the time - of writing only PostgreSQL supports a small set of functions (e.g., dateDifference, floor, ceil, - string concatenation and the like). + of writing only PostgreSQL supports a small set of functions (e.g., ``dateDifference``, ``floor``, ``ceil``, string concatenation and the like). Here are the currently supported aggregate functions: @@ -525,13 +519,13 @@ Here are the currently supported aggregate functions: ====================== ========================== Function Visitor ====================== ========================== -Average AverageVisitor -Count CountVisitor -Max MaxVisitor -Median MedianVisitor -Min MinVisitor -StdDev StandardDeviationVisitor -Sum SumVisitor +``Average`` ``AverageVisitor`` +``Count`` ``CountVisitor`` +``Max`` ``MaxVisitor`` +``Median`` ``MedianVisitor`` +``Min`` ``MinVisitor`` +``StdDev`` ``StandardDeviationVisitor`` +``Sum`` ``SumVisitor`` ====================== ========================== Follow some examples about how to use the group by visitor to compute some stats about the following example data: @@ -609,7 +603,7 @@ multiple group by visitors need to be created and executed. The expression creates buckets of size 100 and gives each one an integer index, 0 for the first bucket (x >= 0 and x < 100), 1 for the second (x >= 100 and x <200), and so on (each - bucket contains its min value and excludes its max value, this avoids overlaps). + bucket contains its minimum value and excludes its maximum value, this avoids overlaps). A bucket with no results will be skipped. The result is: List(0) -> 3 @@ -620,11 +614,10 @@ multiple group by visitors need to be created and executed. Buckets 3 and 4 are not present as no value in the data set matches them. Classifier Functions -'''''''''''''''''''' +^^^^^^^^^^^^^^^^^^^^ -Another set of aggregate functions are aimed at splitting your FeatureCollection -up into useful groups. These functions produce a **Classifier** for your -FeatureCollection, this concept is similar to a histogram. +Another set of aggregate functions are aimed at splitting your ``FeatureCollection`` up into useful groups. These functions produce a ``Classifier`` for your +``FeatureCollection``, this concept is similar to a histogram. .. image:: /images/classifier.PNG @@ -632,13 +625,13 @@ FeatureCollection, this concept is similar to a histogram. These classifiers are used: * With the function "classifier" to sort features into groups -* With :doc:`gt-brewer <../../extension/brewer/index>` to produce attractive styles for visualisation of your data. +* With :doc:`gt-brewer <../../extension/brewer/index>` to produce attractive styles for visualization of your data. Here are some examples of defining and working with classifiers: 1. Create Classifier - You can produce a Classifier for your FeatureCollection as follows: + You can produce a ``Classifier`` for your ``FeatureCollection`` as follows: .. literalinclude:: /../src/main/java/org/geotools/brewer/BrewerExamples.java :language: java @@ -647,17 +640,17 @@ Here are some examples of defining and working with classifiers: 2. The following classifier functions are available. - * EqualInterval - classifier where each group represents the same sized range - * Jenks - generate the Jenks' Natural Breaks classification - * Quantile - classifier with an even number of items in each group - * StandardDeviation - generated using the standard deviation method - * UniqueInterval - variation of EqualInterval that takes into account unique values + * ``EqualInterval`` - classifier where each group represents the same sized range + * ``Jenks`` - generate the Jenks' Natural Breaks classification + * ``Quantile`` - classifier with an even number of items in each group + * ``StandardDeviation`` - generated using the standard deviation method + * ``UniqueInterval`` - variation of ``EqualInterval`` that takes into account unique values - These functions produce the Java object **Classifier** as an output. + These functions produce the Java object ``Classifier`` as an output. -3. Customising your Classifier +3. Customizing your Classifier - You can think of the Classifier as a series of groups or bins into which you + You can think of the ``Classifier`` as a series of groups or bins into which you will sort Features. Each partition has a title which you can name as you please.: @@ -667,7 +660,7 @@ Here are some examples of defining and working with classifiers: :start-after: // classiferExample2 start :end-before: // classiferExample2 end -4. Using Your Classifier to group Features +4. Using Your ``Classifier`` to group Features You can then use this Classifier to sort features into the appropriate group: @@ -676,27 +669,28 @@ Here are some examples of defining and working with classifiers: :start-after: // classiferExample3 start :end-before: // classiferExample3 end -You can think of a Classifier as a filter function similar to a Java **switch** statement. +You can think of a ``Classifier`` as a filter function similar to a Java ``switch`` statement. Join ^^^^ -GeoTools does not have any native ability to "Join" feature collections; even though this is a very common request. + +GeoTools does not have any native ability to "Join" ``FeatureCollections``; even though this is a very common request. References: -* gt-validation additional examples -* :docL`filter` example using filters +* ``gt-validation`` additional examples +* :doc:`filter` example using filters -* Join FeatureCollection +* Join ``FeatureCollection`` You can go through one collection, and use each feature as a starting point for making a query resulting in a "Join". In the following example we have: - * outer: **while** loop for each polygon - * inner: **FeatureVisitor** looping through each point + * outer: ``while`` loop for each polygon + * inner: ``FeatureVisitor`` looping through each point Thanks to Aaron Parks for sending us this example of using the bounding box of a polygon to quickly isolate interesting features; which can then be checked one by one for "intersects" @@ -709,8 +703,7 @@ References: * Joining two Shapefiles - The following example is adapted from some work Gabriella Turk posted to the geotools-user - email list. + The following example is adapted from some work Gabriella Turek posted to the GeoTools user email list. Download: @@ -723,18 +716,18 @@ References: :start-after: // joinExample start :end-before: // joinExample end - When run on the uDig sample dataset available here: + When run on the uDig sample data set available here: * http://udig.refractions.net/docs/data-v1_1.zip - You can run an intersection test between pubs and municipaliy:: + You can run an intersection test between ``bc_pubs`` and ``bc_municipality``:: Welcome to GeoTools:2.5.SNAPSHOT At most 88 bc_pubs features in a single bc_municipality feature - Here are a couple other examples for innerFilter to think about: + Here are a couple other examples for ``innerFilter`` to think about: - * ff.intersects( ff.property(geomName2), ff.literal( geometry )); // 88 pubs - * ff.dwithin(ff.property(geomName2), ff.literal( geometry ),1.0,"km"); // 60 pubs - * ff.not( ff.disjoint(ff.property(geomName2), ff.literal( geometry )) ); // 135 pubs! - * ff.beyond(ff.property(geomName2), ff.literal( geometry ),1.0,"km"); // 437 pubs + * ``ff.intersects(ff.property(geomName2), ff.literal( geometry )); // 88 pubs`` + * ``ff.dwithin(ff.property(geomName2), ff.literal( geometry ),1.0,"km"); // 60 pubs`` + * ``ff.not( ff.disjoint(ff.property(geomName2), ff.literal( geometry )) ); // 135 pubs!`` + * ``ff.beyond(ff.property(geomName2), ff.literal( geometry ),1.0,"km"); // 437 pubs`` diff --git a/docs/user/library/main/data.rst b/docs/user/library/main/data.rst index d8b82c01ae7..b3e37ec1491 100644 --- a/docs/user/library/main/data.rst +++ b/docs/user/library/main/data.rst @@ -3,7 +3,7 @@ DataUtilities Working with GIS data can be difficult. Working with the number of classes in the GeoTools library can also be a bit intimidating. The **DataUtilities** a facade classes which can help simplify common data wrangling chores. -In almost all cases the methods for this class act as a front end for the classes provided by gt-main. This documentation makes note of the classes used internally so you can learn how the library is put together and can go look for more control if needed. +In almost all cases the methods for this class act as a front end for the classes provided by ``gt-main``. This documentation makes note of the classes used internally so you can learn how the library is put together and can go look for more control if needed. If you do have any commonly used data hacks in your code; please submit a patch request to the issue tracker and we can add more useful methods here. @@ -14,28 +14,28 @@ References: File ^^^^ -* checkFileReadable(File, Logger) -* checkDirectory(File) -* excludeFilters(FilenameFilter, FilenameFilter...) -* includeFilters(FilenameFilter, FilenameFilter...) +* ``checkFileReadable(File, Logger)`` +* ``checkDirectory(File)`` +* ``excludeFilters(FilenameFilter, FilenameFilter...)`` +* ``includeFilters(FilenameFilter, FilenameFilter...)`` - Allows FilenameFilters to be combined. + Allows ``FilenameFilters`` to be combined. FeatureType ^^^^^^^^^^^ -Working with FeatureType can be a bit troubling, as much like Java String it is immutable (cannot be modified once created). +Working with ``FeatureType`` can be a bit troubling, as much like Java ``String`` it is immutable (cannot be modified once created). FeatureType Creation '''''''''''''''''''' -DataUtilities provides the following methods to help you quickly create and modify FeatureType information. +``DataUtilities`` provides the following methods to help you quickly create and modify ``FeatureType`` information. -* DataUtilities.createType( typeName, specification ) -* DataUtilities.createType( namespace, typeName, specification) +* ``DataUtilities.createType( typeName, specification )`` +* ``DataUtilities.createType( namespace, typeName, specification)`` - This is great for quickly whipping up a FeatureType when making test cases. For more - control use SimpleFeatureTypeBuilder as described in gt-opengis. + This is great for quickly whipping up a ``FeatureType`` when making test cases. For more + control use ``SimpleFeatureTypeBuilder`` as described in ``gt-opengis``. If you just want to quickly describe some information:: @@ -54,31 +54,32 @@ DataUtilities provides the following methods to help you quickly create and modi SimpleFeatureType lineType = DataUtilities.createType("http://somewhere.net/","LINE", "centerline:LineString,name:\"\",id:0"); Now we don't want to see you writing code to build up your initial "definition" String, that means you are doing something - general (and dynamic!) and should go figure out SimpleFeatureTypeBuilder and SimpleFeatureBuilder. + general (and dynamic!) and should go figure out ``SimpleFeatureTypeBuilder`` and ``SimpleFeatureBuilder``. -* DataUtilities.spec(SimpleFeatureType) +* ``DataUtilities.spec(SimpleFeatureType)`` - You can use this method to quickly get a text representation of a FeatureType:: + You can use this method to quickly get a text representation of a + ``FeatureType``:: System.out.println("FeatureType: " + DataUtilities.spec(schema)); - The representation is the same one used by createType above. + The representation is the same one used by ``createType`` above. FeatureType Modify '''''''''''''''''' -Because a FeatureType cannot be modified once created; all of the following methods +Because a ``FeatureType`` cannot be modified once created; all of the following methods return a modified copy. -* DataUtilities.createSubType(SimpleFeatureType, String[], CoordinateReferenceSystem) -* DataUtilities.createSubType(SimpleFeatureType, String[], CoordinateReferenceSystem, String, URI) -* DataUtilities.createSubType(SimpleFeatureType, String[]) +* ``DataUtilities.createSubType(SimpleFeatureType, String[], CoordinateReferenceSystem)`` +* ``DataUtilities.createSubType(SimpleFeatureType, String[], CoordinateReferenceSystem, String, URI)`` +* ``DataUtilities.createSubType(SimpleFeatureType, String[])`` - Used to quickly produce a (slightly modified) copy of the provided FeatureType. Used to - recast a FeatureType with a desired CoordinateReferenceSystem or limit a FeatureType + Used to quickly produce a (slightly modified) copy of the provided ``FeatureType``. Used to + recast a ``FeatureType`` with a desired ``CoordinateReferenceSystem`` or limit a ``FeatureType`` to a specific list of attributes. - There are actually a couple subType methods depending on how complicated you want to get.:: + There are actually a couple ``subType`` methods depending on how complicated you want to get.:: FeatureType schema = DataUtilities.createType("EDGE", "edge:Polygon,name:String"); CoordinateReferenceSystem crs = CRS.decode( "EPSG:4326" ); @@ -94,19 +95,19 @@ return a modified copy. FeatureType Summary ''''''''''''''''''' -FeatureType forms an interesting little data structure as shown in the gt-opengis diagrams. +``FeatureType`` forms an interesting little data structure as shown in the ``gt-opengis`` diagrams. The following methods traverse this data structure for you building up a summary to answer specific questions. -* DataUtilities.addMandatoryProperties( schema, propertyNames ) +* ``DataUtilities.addMandatoryProperties( schema, propertyNames )`` - Used to review a FeatureType and add the required properties to an existing list:: + Used to review a ``FeatureType`` and add the required properties to an existing list:: List requiredProperties = addMandatoryProperties( schema, null ); -* compare(schema1, schema2) +* ``compare(schema1, schema2)`` - The retype methods allow us to start with an existing FeatureType and produced a + The ``retype`` methods allow us to start with an existing ``FeatureType`` and produced a simplified or modified copy. This method compares two feature types to sort out if one is a simplification @@ -115,12 +116,12 @@ The following methods traverse this data structure for you building up a summary ====== ========================================================== value compare ====== ========================================================== - +1 if schema1 is a sub type/reorder/renamespace of schema2 - 0 if schema1 and schema2 are the same - -1 if schema1 and schema2 are not related + +1 if ``schema1`` is a sub type/reorder/re-namespace of ``schema2`` + 0 if ``schema1`` and ``schema2`` are the same + -1 if ``schema1`` and ``schema2`` are not related ====== ========================================================== -* isMatch(AttributeDescriptor, AttributeDescriptor) +* ``isMatch(AttributeDescriptor, AttributeDescriptor)`` Used to check if values from the two attribute descriptors have a hope of matching. Both the name and the binding to a Java class are checked. @@ -131,43 +132,43 @@ Feature These methods help you work with the values stored in an individual feature. They can quickly produce a set of default values, or parse a set of provided strings into the correct Java Objects as needed. -* template(SimpleFeatureType) -* template(SimpleFeatureType, String) -* template(SimpleFeatureType, Object[]) -* template(SimpleFeatureType, String, Object[]) +* ``template(SimpleFeatureType)`` +* ``template(SimpleFeatureType, String)`` +* ``template(SimpleFeatureType, Object[])`` +* ``template(SimpleFeatureType, String, Object[])`` These template methods create a new Feature using of sensible default values in the event the user supplied null for a mandatory value. -* defaultValues(SimpleFeatureType) -* defaultValues(SimpleFeatureType, Object[]) -* defaultValue(AttributeDescriptor) -* defaultValue(Class) +* ``defaultValues(SimpleFeatureType)`` +* ``defaultValues(SimpleFeatureType, Object[])`` +* ``defaultValue(AttributeDescriptor)`` +* ``defaultValue(Class)`` These methods provide sensible default values that are a good starting point for data entry (if you are giving your user a chance to enter new a new feature by hand). -* parse(SimpleFeatureType, String, String[]) +* ``parse(SimpleFeatureType, String, String[])`` You can quickly parse out a new feature from input text:: SimpleFeature feature = DataUtilities.parse( schema, fid, text ); -* duplicate(Object) +* ``duplicate(Object)`` Performs a deep copy of the provided attribute value. - It is aware of JTS Geometry, and GeoTools constructs such as SimpleFeature + It is aware of JTS Geometry, and GeoTools constructs such as ``SimpleFeature`` and will take appropriate measures. -* attributesEqual(Object, Object) +* ``attributesEqual(Object, Object)`` You can safely compare if two attribute values are equal (without worrying about Geometry behaving funny):: DataUtilities.attributesEquals( feature1.getAttribute(1), feature2.getAttribute(1) ); -* reType(SimpleFeatureType, SimpleFeature) -* reType(SimpleFeatureType, SimpleFeature, boolean) +* ``reType(SimpleFeatureType, SimpleFeature)`` +* ``reType(SimpleFeatureType, SimpleFeature, boolean)`` These methods allow you to modify a feature to match a new schema: @@ -179,97 +180,98 @@ correct Java Objects as needed. FeatureCollection ^^^^^^^^^^^^^^^^^ -Creating Features has gotten a lot easier with the advent of SimpleFeatureTypeBuilder. +Creating Features has gotten a lot easier with the advent of ``SimpleFeatureTypeBuilder``. -You can still run into situations where adapting feature data is useful when calling methods. The DataUtilities class can help by providing wrappers taking your feature information from Arrays, Collections, FeatureReaders and other +You can still run into situations where adapting feature data is useful when calling methods. The ``DataUtilities`` class can help by providing wrappers taking your feature information from ``Arrays``, ``Collections``, ``FeatureReaders`` and other -In general we try and work with FeatureReader and FeatureIterator (as these support the +In general we try and work with ``FeatureReader`` and ``FeatureIterator`` (as these support the idea of "streaming" information larger than memory). You will find some areas of the code that want to load everything into memory (either as a Collection or Array) often for analysis. **FeatureCollection** -FeatureCollection is used a lot in GeoTools code giving you a chance to use the following methods. +``FeatureCollection`` is used a lot in GeoTools code giving you a chance to use the following methods. -* DataUtilities.collection( FeatureCollection ) - copies into memory! -* DataUtilities.collection( FeatureReader ) - copies into memory! -* DataUtilities.collection( List ) -* DataUtilities.collection( SimpleFeature ) -* DataUtilities.collection( SimpleFeature[] ) -* DataUtilities.collection( SimpleFeatureIterator ) +* ``DataUtilities.collection(FeatureCollection)`` - copies into memory! +* ``DataUtilities.collection(FeatureReader)`` - copies into memory! +* ``DataUtilities.collection( List )`` +* ``DataUtilities.collection( SimpleFeature )`` +* ``DataUtilities.collection( SimpleFeature[] )`` +* ``DataUtilities.collection( SimpleFeatureIterator )`` -DataUtilities has helper methods to turn almost anything into a FeatureCollection, this -is really helpful when working with an API that expects a FeatureCollection.:: +``DataUtilities`` has helper methods to turn almost anything into a ``FeatureCollection``, this +is really helpful when working with an API that expects a ``FeatureCollection``.:: Feature[] array; ... return DataUtilities.collection( array ); -These methods are often used to add a single SimpleFeature to a FeatureStore:: +These methods are often used to add a single ``SimpleFeature`` to a ``FeatureStore``:: featureStore.addFeatures( DataUtilities.collection( newFeature ) ); Do be careful some of these implementations suck everything into memory! With GIS data sizes this will eventually break your application. -* results(SimpleFeature[]) -* results(SimpleFeatureCollection) -* results(FeatureCollection) +* ``results(SimpleFeature[])`` +* ``results(SimpleFeatureCollection)`` +* ``results(FeatureCollection)`` -These methods convert to a FeatureCollection; but with a twist. They will +These methods convert to a ``FeatureCollection``; but with a twist. They will produce an error (rather than an empty collection) if the input is null or empty. -In GeoTools 2.0 FeatureCollection was called **FeatureResults**, these methods are +In GeoTools 2.0 ``FeatureCollection`` was called ``FeatureResults``, these methods are left over from that time. FeatureSource ''''''''''''' -FeatureSource is a very capable class, in the worst case the wrappers provided here may need to load everything into memory to get the job done. +``FeatureSource`` is a very capable class, in the worst case the wrappers provided here may need to load everything into memory to get the job done. -* source(SimpleFeature[]) +* ``source(SimpleFeature[])`` - Will wrap a FeatureSource around the provided array allowing the features to + Will wrap a ``FeatureSource`` around the provided array allowing the features to be queried. -* source(FeatureCollection) +* ``source(FeatureCollection)`` - In a similar fashion a FeatureSource is wrapped around the provided collection. + In a similar fashion a ``FeatureSource`` is wrapped around the provided collection. - There are optimised implementations for: + There are optimized implementations for: - * ListFeatureCollection - * SpatialIndexFeatureCollection - * TreeSetFeatureCollection + * ``ListFeatureCollection`` + * ``SpatialIndexFeatureCollection`` + * ``TreeSetFeatureCollection`` - And as fall back of copying everything into a memory using a CollectionDataStore + And as fall back of copying everything into a memory using a ``CollectionDataStore`` to hold the resulting feature source. -* createView(DataStore, Query) +* ``createView(DataStore, Query)`` Creates a light weight "view" that focuses on combining the provided query with - any requests made to the resulting featureSource. + any requests made to the resulting ``featureSource``. -* dataStore( source ) +* ``dataStore( source )`` - Adapt source as a singleton dataStore + Adapt source as a singleton ``dataStore`` FeatureReader ''''''''''''' -FeatureReader is the best class we have to represent the nature of streaming large +``FeatureReader`` is the best class we have to represent the nature of streaming large quantities of information off disk and through your program. -The following methods allow you to simulate a FeatureReader using information you +The following methods allow you to simulate a ``FeatureReader`` using information you happen to have in memory. -* DataUtilities.reader(Collection) -* DataUtilities.reader(FeatureCollection) -* DataUtilities.reader(SimpleFeature[]) +* ``DataUtilities.reader(Collection)`` +* ``DataUtilities.reader(FeatureCollection)`` +* ``DataUtilities.reader(SimpleFeature[])`` -The FeatureReader interface works in a similar manner to Iterator with -the benefit of IOExceptions in case you are streaming from disk. +The ``FeatureReader`` interface works in a similar manner to +``Iterator`` with +the benefit of ``IOExceptions`` in case you are streaming from disk. -DataUtilities sill lets you adapt your own collection to this format.:: +``DataUtilities`` sill lets you adapt your own collection to this format.:: FeatureCollection collection; @@ -281,14 +283,14 @@ Summary The following methods provide a summary of feature information; often gathering up boilerplate code that you would otherwise need to cut and paste into your application. -* DataUtilities.list(FeatureCollection) +* ``DataUtilities.list(FeatureCollection)`` - Loads the FeatureCollection into a normal java.util.List + Loads the ``FeatureCollection`` into a normal ``java.util.List`` -* DataUtilities.fidSet(FeatureCollection) +* ``DataUtilities.fidSet(FeatureCollection)`` - Goes through the FeatureCollection and produced the set of FeatureIds as a simple - Set. + Goes through the ``FeatureCollection`` and produced the set of ``FeatureIds`` as a simple + ``Set``. These identifiers can be used to retrieve features individually. @@ -296,27 +298,27 @@ boilerplate code that you would otherwise need to cut and paste into your applic you can uniquely identify each row, and then only query for the contents of the features displayed on screen as needed. -* DataUtilities.bounds(FeatureCollection) +* ``DataUtilities.bounds(FeatureCollection)`` - There are methods to quickly get the bounds from a FeatureSource or FeatureCollection, + There are methods to quickly get the bounds from a ``FeatureSource`` or ``FeatureCollection``, but these methods are implementation dependent often making use of header information - or summarising the spatial index in order to get you an answer quickly. + or summarizing the spatial index in order to get you an answer quickly. Use this method to go through each feature one by one and compute a bounds. Cast '''' -In GeoTools 2.7 we introduced the idea of a SimpleFeatureCollection (which is a short hand for FeatureCollection). + In GeoTools 2.7 we introduced the idea of a ``SimpleFeatureCollection`` (which is a short hand for ``FeatureCollection``). While this really helped with learning the library (and the amount of typing required to use it) -we needed to introduce the following methods to help people safely "cast" to a SimpleFeatureCollection when they had a FeatureCollection. +we needed to introduce the following methods to help people safely "cast" to a ``SimpleFeatureCollection`` when they had a ``FeatureCollection``. -* DataUtilities.simple(FeatureCollection) -* DataUtilities.simple(FeatureSource) -* DataUtilities.simple(FeatureStore) -* DataUtilities.simple(FeatureType) -* DataUtilities.simple(FeatureLocking) +* ``DataUtilities.simple(FeatureCollection)`` +* ``DataUtilities.simple(FeatureSource)`` +* ``DataUtilities.simple(FeatureStore)`` +* ``DataUtilities.simple(FeatureType)`` +* ``DataUtilities.simple(FeatureLocking)`` While the above methods do perform an instance of check; they are also willing to apply a wrapper to get the job done if needed. @@ -330,49 +332,49 @@ In practice these methods are quick and easy to use: Query ^^^^^ -A common task with gt-main is preparing a Query against a FeatureSource. DataUtilities has a number of methods to help. +A common task with ``gt-main`` is preparing a ``Query`` against a ``FeatureSource``. ``DataUtilities`` has a number of methods to help. -* DataUtilities.mixQueries(Query, Query, String) +* ``DataUtilities.mixQueries(Query, Query, String)`` Safely combines two queries in a sensible manner. The provided string is used for the name of the new query. -* DataUtilities.simplifyFilter(Query) +* ``DataUtilities.simplifyFilter(Query)`` Simplifies the filter contained in a query, eliminating non-functional clauses. -* DataUtilities.resolvePropertyNames(Query, SimpleFeatureType) -* DataUtilities.resolvePropertyNames(Filter, SimpleFeatureType) +* ``DataUtilities.resolvePropertyNames(Query, SimpleFeatureType)`` +* ``DataUtilities.resolvePropertyNames(Filter, SimpleFeatureType)`` These two methods rewrite full property names to simple attribute names. - For example, property names such as "gml:name" are rewritten as simply "name". + For example, property names such as ``gml:name`` are rewritten as simply ``name``. -* DataUtilities.addMandatoryProperties(SimpleFeatureType, List) +* ``DataUtilities.addMandatoryProperties(SimpleFeatureType, List)`` SortBy '''''' -* DataUtilities.sortComparator(SortBy) +* ``DataUtilities.sortComparator(SortBy)`` - Creates a Comparator that can be used to sort features as indicated by the Query - SortBy provided. + Creates a ``Comparator`` that can be used to sort features as indicated by the ``Query`` + ``SortBy`` provided. Filter and Expression ''''''''''''''''''''' -Part of the fun of preparing a Query is ensuring you ask for the correct values to +Part of the fun of preparing a ``Query`` is ensuring you ask for the correct values to perform the task you have in mind. -We have a number of methods to list required attributes for a Filter or Expression: +We have a number of methods to list required attributes for a ``Filter`` or ``Expression``: -* DataUtilities.atttributeNames( Filter ) -* DataUtilities.atttributeNames( Filter, FeatureType ) -* DataUtilities.attributenNames( Expression ) -* DataUtilities.attributenNames( Expression, FeatureType ) +* ``DataUtilities.atttributeNames( Filter )`` +* ``DataUtilities.atttributeNames( Filter, FeatureType )`` +* ``DataUtilities.attributenNames( Expression )`` +* ``DataUtilities.attributenNames( Expression, FeatureType )`` - The optional FeatureType is used as a reference point and can resolve any ambiguities - between the simple xpath expressions, and the names used in the FeatureType. + The optional ``FeatureType`` is used as a reference point and can resolve any ambiguities + between the simple XPath expressions, and the names used in the ``FeatureType``. - Here is an example of using this information to request a FeatureCollection that + Here is an example of using this information to request a ``FeatureCollection`` that has the required attributes to evaluate the provided expression for every feature.:: String attributes[] = DataUtilities.attributeNames( expression ); @@ -380,20 +382,20 @@ We have a number of methods to list required attributes for a Filter or Expressi SimpleFeatureCollection results = featureSource.features( query ); -* DataUtilities.propertyNames( Filter ) -* DataUtilities.propertyNames( Filter, FeatureType ) -* DataUtilities.propertyNames( Expression ) -* DataUtilities.propertyNames( Expression, FeatureType ) +* ``DataUtilities.propertyNames( Filter )`` +* ``DataUtilities.propertyNames( Filter, FeatureType )`` +* ``DataUtilities.propertyNames( Expression )`` +* ``DataUtilities.propertyNames( Expression, FeatureType )`` - A similar batch of methods using FilterAttributeExtractor to retrieve a - Set. + A similar batch of methods using ``FilterAttributeExtractor`` to retrieve a + ``Set``. - Using a PropertyName is slightly more useful when considering complex XPath + Using a ``PropertyName`` is slightly more useful when considering complex XPath expressions that use namespaces. **FilterAttributeExtractor** -Internally the above methods use FilterAttributeExtractor. You can use this class for +Internally the above methods use ``FilterAttributeExtractor``. You can use this class for greater control.:: FilterAttributeExtractor extract = new FilterAttributeExtractor(null); diff --git a/docs/user/library/main/datastore.rst b/docs/user/library/main/datastore.rst index a9583d0d805..6c75893e121 100644 --- a/docs/user/library/main/datastore.rst +++ b/docs/user/library/main/datastore.rst @@ -21,39 +21,40 @@ References: DataAccess ^^^^^^^^^^ -**DataAccess** represents a storage location or service for spatial data. +``DataAccess`` represents a storage location or service for spatial data. .. image:: /images/datastoreapi.png -The DataAccess defined as: +The ``DataAccess`` defined as: -* T: FeatureType - class used to describe content. +* ``T``: ``FeatureType`` - class used to describe content. - Currently FeatureType and SimpleFeatureType are available) + Currently ``FeatureType`` and ``SimpleFeatureType`` are available) -* F: Feature - class used to represent content. +* ``F``: ``Feature`` - class used to represent content. - Currently Feature and SimpleFeature are available. + Currently ``Feature`` and ``SimpleFeature`` are available. -* DataStore is a short hand for DataAccess with a few extra methods allowing +* ``DataStore`` is a short hand for + ``DataAccess`` with a few extra methods allowing the contents to be accessed using a type name defined as a simple String -You can use the DataAccess interface to get a list of the contents, retrieve a little bit of information about the contents (such as their name, bounds and description). To actually retrieve the data contents you will ask the DataAccess interface for a FeatureSource based on the content Name (using the Name) of the features that you want. We will discuss FeatureSource in the next section. +You can use the ``DataAccess`` interface to get a list of the contents, retrieve a little bit of information about the contents (such as their name, bounds and description). To actually retrieve the data contents you will ask the ``DataAccess`` interface for a ``FeatureSource`` based on the content Name (using the Name) of the features that you want. We will discuss ``FeatureSource`` in the next section. Here are two examples of these ideas in action: -* ShapeFileDataStore represents the file on disk, FeatureSource represents the contents of the file -* PostGISDataStore represents the database, while a FeatureSource represents a table in the database +* ``ShapeFileDataStore`` represents the file on disk, ``FeatureSource`` represents the contents of the file +* ``PostGISDataStore`` represents the database, while a ``FeatureSource`` represents a table in the database -The key differences is between a the file and the contents of the file. If you find it easier you can think of it as the difference between: +The key differences is between the file and the contents of the file. If you find it easier you can think of it as the difference between: -* DataStore: the information contained in the file header (name, bounds, description) that describe the entire contents -* FeatureSource: the information contained in the file itself (lots of little features) +* ``DataStore``: the information contained in the file header (name, bounds, description) that describe the entire contents +* ``FeatureSource``: the information contained in the file itself (lots of little features) -Here is a quick review of the DataAccess methods: +Here is a quick review of the ``DataAccess`` methods: -* DataAccess.getInfo() +* ``DataAccess.getInfo()`` Access a quick description of the service or file publishing information.: @@ -62,37 +63,37 @@ Here is a quick review of the DataAccess methods: :start-after: // exampleInfo start :end-before: // exampleInfo end - Some DataStores, like Web Feature Server, may provide additional information - in the object they return from getInfo(). + Some ``DataStores``, like Web Feature Server, may provide additional information + in the object they return from ``getInfo()``. -* DataAccess.createSchema(FeatureType) +* ``DataAccess.createSchema(FeatureType)`` Used to define the contents of a shapefile, or add a new table to database. - Not supported by all DataStores. + Not supported by all ``DataStores``. .. literalinclude:: /../src/main/java/org/geotools/api/DataStoreExamples.java :language: java :start-after: // exampleCreateSchema start :end-before: // exampleCreateSchema end -* DataAccess.updateSchema(Name, FeatureType) +* ``DataAccess.updateSchema(Name, FeatureType)`` Used to modify the contents of a shapefile, or alter an existing table. - Not supported by all dataStores. + Not supported by all ``dataStores``. -* DataAccess.removeSchema(Name) +* ``DataAccess.removeSchema(Name)`` - Used to remove an existing table. Not supported by all dataStores. + Used to remove an existing table. Not supported by all ``dataStores``. .. literalinclude:: /../src/main/java/org/geotools/api/DataStoreExamples.java :language: java :start-after: // exampleRemoveSchema start :end-before: // exampleRemoveSchema end -* DataAccess.getNames() -* DataAccess.getSchema(Name) -* DataAccess.getFeatureSource(Name): FeatureSource -* DataAccess.dispose() +* ``DataAccess.getNames()`` +* ``DataAccess.getSchema(Name)`` +* ``DataAccess.getFeatureSource(Name): FeatureSource`` +* ``DataAccess.dispose()`` Used to clean up any internal connections or memory used by the DataStore. Should be called prior to your application exiting.:: @@ -105,52 +106,52 @@ Here is a quick review of the DataAccess methods: DataStore ''''''''' -The **DataStore** interface is a DataAccess subclass that provides to explicitly work with content providers that only know how to deal with SimpleFeature and SimpleFeatureType. +The ``DataStore`` interface is a ``DataAccess`` subclass that provides to explicitly work with content providers that only know how to deal with ``SimpleFeature`` and ``SimpleFeatureType``. -* DataStore.updateSchema(String, SimpleFeatureType) -* DataStore.removeSchema(String) -* DataStore.getTypeNames() +* ``DataStore.updateSchema(String, SimpleFeatureType)`` +* ``DataStore.removeSchema(String)`` +* ``DataStore.getTypeNames()`` - Access an String[] of Name.getLocalName() + Access an ``String[]`` of ``Name.getLocalName()`` -* DataStore.getSchema(String) +* ``DataStore.getSchema(String)`` - Access to SimpleFeatureType based on name. + Access to ``SimpleFeatureType`` based on name. -* DataStore.getFeatureSource(String) -* DataStore.getFeatureSource(Name) +* ``DataStore.getFeatureSource(String)`` +* ``DataStore.getFeatureSource(Name)`` - You can access SimpleFeatureSource based on a type name supplied as a Name or a String. + You can access ``SimpleFeatureSource`` based on a type name supplied as a ``Name`` or a ``String``. -* DataStore.getFeatureReader(Query, Transaction) -* DataStore.getFeatureWriter(String, Filter, Transaction) -* DataStore.getFeatureWriter(String, Transaction) -* DataStore.getFeatureWriterAppend(String, Transaction) +* ``DataStore.getFeatureReader(Query, Transaction)`` +* ``DataStore.getFeatureWriter(String, Filter, Transaction)`` +* ``DataStore.getFeatureWriter(String, Transaction)`` +* ``DataStore.getFeatureWriterAppend(String, Transaction)`` - Access to a low-level FeatureReader and FeatureWriter class allowing direct access to DataStore contents (complete with IO Exceptions). + Access to a low-level ``FeatureReader`` and ``FeatureWriter`` class allowing direct access to ``DataStore`` contents (complete with ``IOExceptions``). - The various FeatureWriter methods require a Transaction (i.e. session) to perform their work on, and allow existing content to be updated + The various ``FeatureWriter`` methods require a ``Transaction`` (i.e. session) to perform their work on, and allow existing content to be updated or new content to be appended. -* DataStore.getLockingManager() +* ``DataStore.getLockingManager()`` - Access to the LockingManager used to sort out any time based locks acquired on to restrict access + Access to the ``LockingManager`` used to sort out any time based locks acquired on to restrict access when multiple threads are working on the same information. FeatureSource ^^^^^^^^^^^^^ -A FeatureSource is used to provide access to the contents of a DataStore. +A ``FeatureSource`` is used to provide access to the contents of a DataStore. .. image:: /images/FeatureSource.PNG **Approach** -As you can see FeatureSource provides different subclasses depending on the -level of access available. So a read-only file will be an instanceof **FeatureSource** -while a writable file will be able to return a **FeatureStore**. +As you can see ``FeatureSource`` provides different subclasses depending on the +level of access available. So a read-only file will be an ``instanceof`` ``FeatureSource`` +while a writable file will be able to return a ``FeatureStore``. -To check if the contents of a file are writable you can use an **instanceof** check:: +To check if the contents of a file are writable you can use an ``instanceof`` check:: SimpleFeatureSource featureSource = dataStore.getFeatureSource( "roads" ); @@ -171,7 +172,7 @@ To check if the contents of a file are writable you can use an **instanceof** ch } This approach is nice in that you cannot accidentally modify a read-only file (as your -would get a ClassCastException):: +would get a ``ClassCastException``):: // ClassCastException if "roads" is not writable! SimpleFeatureStore featureStore = (SimpleFeatureStore) dataStore.getFeatureSource( "roads" ); @@ -186,139 +187,140 @@ In a similar fashion you can check if locking is supported between threads:: SimpleFeatureSource ''''''''''''''''''' -SimpleFeatueSource is the extension of FeatureSource returned by DataStore to explicitly work with -SimpleFeature and SimpleFeatureCollection. +``SimpleFeatueSource`` is the extension of ``FeatureSource`` returned by ``DataStore`` to explicitly work with +``SimpleFeature`` and ``SimpleFeatureCollection``. .. image:: /images/SimpleFeatureSource.PNG Access to basic name and schema information: -* FeatureSource.getName() -* FeatureSource.getSchema() -* FeatureSource.getDataStore() +* ``FeatureSource.getName()`` +* ``FeatureSource.getSchema()`` +* ``FeatureSource.getDataStore()`` Access to contents: -* FeatureSource.getFeatures() -* FeatureSource.getFeatures(Filter) -* FeatureSource.getFeatures(Query) -* SimpleFeatureSource.getFeatures() -* SimpleFeatureSource.getFeatures( Filter ) -* SimpleFeatureSource.getFeatures( Query ) +* ``FeatureSource.getFeatures()`` +* ``FeatureSource.getFeatures(Filter)`` +* ``FeatureSource.getFeatures(Query)`` +* ``SimpleFeatureSource.getFeatures()`` +* ``SimpleFeatureSource.getFeatures( Filter )`` +* ``SimpleFeatureSource.getFeatures( Query )`` - In the case of SimpleFeatureSource these methods will return a SimpleFeatureCollection. + In the case of ``SimpleFeatureSource`` these methods will return a ``SimpleFeatureCollection``. Access to metadata describing the contents and capabilities available. -* FeatureSource.getInfo() -* FeatureSource.getSupportedHints() -* FeatureSource.getQueryCapabilities() +* ``FeatureSource.getInfo()`` +* ``FeatureSource.getSupportedHints()`` +* ``FeatureSource.getQueryCapabilities()`` You can listen to changes made to the contents: -* FeatureSource.addFeatureListener(FeatureListener) -* FeatureSource.removeFeatureListener(FeatureListener) +* ``FeatureSource.addFeatureListener(FeatureListener)`` +* ``FeatureSource.removeFeatureListener(FeatureListener)`` Summary information: -* FeatureSource.getBounds() -* FeatureSource.getBounds(Query) +* ``FeatureSource.getBounds()`` +* ``FeatureSource.getBounds(Query)`` May return null if the bounds are unknown or too costly to calculate. -* FeatureSource.getCount(Query) +* ``FeatureSource.getCount(Query)`` May return -1 if the information is not readily available. Formats such as shapefile keep this information available in the header for handy reference. WFS does not provide any way to ask for this information and thus always returns -1. -Where a request is captured by a **Query**: +Where a request is captured by a ``Query``: -* Query +* ``Query`` Used to stage a request for information, identifying a set of features using a filter, the attributes requested along with any additional hints for processing. - There are two predefined Querys available: + There are two predefined types of ``Query`` available: - * Query.ALL - to request all content - * Query.FIDS - To request only the feature IDs with no content + * ``Query.ALL`` - to request all content + * ``Query.FIDS`` - To request only the feature IDs with no content - The typeName information must match your featureSource (and explicitly required when sending a Query directly to a DataStore). + The ``typeName`` information must match your ``featureSource`` (and explicitly required when sending a ``Query`` directly to a ``DataStore``). - * Query.getTypeName() - * Query.setTypeName(String) + * ``Query.getTypeName()`` + * ``Query.setTypeName(String)`` - Namespace can be overridden. + ``Namespace`` can be overridden. - * Query.getNamespace() - * Query.setNamespace(URI) + * ``Query.getNamespace()`` + * ``Query.setNamespace(URI)`` - Override to request a specific namespace, or use Query.NON_NAMESPACE. + Override to request a specific namespace, or use ``Query.NON_NAMESPACE``. Simple string "handle" to identify this query in any logs or error messages. - * Query.getHandle() - * Query.setHandle(String) + * ``Query.getHandle()`` + * ``Query.setHandle(String)`` - Paging support is available using a start and max features as part of your Query. + Paging support is available using a start and maximum + features as part of your Query. - * Query.getMaxFeatures() - * Query.isMaxFeaturesUnlimited() - * Query.setMaxFeatures(int) - * Query.getStartIndex() - * Query.setStartIndex(Integer) + * ``Query.getMaxFeatures()`` + * ``Query.isMaxFeaturesUnlimited()`` + * ``Query.setMaxFeatures(int)`` + * ``Query.getStartIndex()`` + * ``Query.setStartIndex(Integer)`` Specify the set of requested attributes to return: - * Query.getPropertyNames() - * Query.setPropertyNames(String[]) - * Query.setPropertyNames(List) - * Query.retrieveAllProperties() + * ``Query.getPropertyNames()`` + * ``Query.setPropertyNames(String[])`` + * ``Query.setPropertyNames(List)`` + * ``Query.retrieveAllProperties()`` - There are a couple well defined constants:: + There are a couple well defined constants: - * Query.NO_NAMES - * Query.ALL_NAMES + * ``Query.NO_NAMES`` + * ``Query.ALL_NAMES`` - The same options are available using PropertyName in order to support XPath expressions with namespace information. + The same options are available using ``PropertyName`` in order to support XPath expressions with namespace information. - * Query.getProperties() - * Query.setProperties(List) + * ``Query.getProperties()`` + * ``Query.setProperties(List)`` There are a couple of well defined constants: - * Query.NO_PROPERTIES - * Query.ALL_PROPERTIES + * ``Query.NO_PROPERTIES`` + * ``Query.ALL_PROPERTIES`` - * Query.getFilter() - * Query.setFilter(Filter) + * ``Query.getFilter()`` + * ``Query.setFilter(Filter)`` When working with versioned data you ask for a specific version. - * Query.getVersion() - * Query.setVersion(String) + * ``Query.getVersion()`` + * ``Query.setVersion(String)`` - Override this value in the event the datasource is incorrect - and your user knows the correct CoordinateReferenceSystem. + Override this value in the event the ``DataSource`` is incorrect + and your user knows the correct ``CoordinateReferenceSystem``. - * Query.getCoordinateSystem() - * Query.setCoordinateSystem(CoordinateReferenceSystem) + * ``Query.getCoordinateSystem()`` + * ``Query.setCoordinateSystem(CoordinateReferenceSystem)`` - Used to transform the information to requested CoordinateReferenceSystem. + Used to transform the information to requested ``CoordinateReferenceSystem``. - * Query.getCoordinateSystemReproject() - * Query.setCoordinateSystemReproject(CoordinateReferenceSystem) + * ``Query.getCoordinateSystemReproject()`` + * ``Query.setCoordinateSystemReproject(CoordinateReferenceSystem)`` Ask for the results to be sorted as indicated - * Query.getSortBy() - * Query.setSortBy(SortBy[]) + * ``Query.getSortBy()`` + * ``Query.setSortBy(SortBy[])`` - Open ended hints (check getSupportedHints for details) + Open ended hints (check ``getSupportedHints()`` for details) - * Query.getHints() - * Query.setHints(Hints) + * ``Query.getHints()`` + * ``Query.setHints(Hints)`` Example:: @@ -328,7 +330,7 @@ Examples: * How to count the number of features. - Because the getCount method just checks the file or database header information it is designed + Because the ``getCount`` method just checks the file or database header information it is designed to be very fast. Not all implementations have access to this information making it a bit tricky to count the number of available features. @@ -349,7 +351,7 @@ Examples: SimpleFeatureStore '''''''''''''''''' -SimpleFeatureStore is an extension to FeatureStore returning SimpleFeatureCollection as expected and allowing the contents +``SimpleFeatureStore`` is an extension to ``FeatureStore`` returning ``SimpleFeatureCollection`` as expected and allowing the contents to be modified using a simple String to indicate attribute. @@ -357,57 +359,57 @@ to be modified using a simple String to indicate attribute. Ability to add and remove features: -* FeatureStore.addFeatures(FeatureCollection) -* FeatureStore.removeFeatures(Filter) +* ``FeatureStore.addFeatures(FeatureCollection)`` +* ``FeatureStore.removeFeatures(Filter)`` -Ability to modify feature attributes in place using a Filter to select the content to modify: +Ability to modify feature attributes in place using a ``Filter`` to select the content to modify: -* FeatureStore.modifyFeatures(Name[], Object[], Filter) -* FeatureStore.modifyFeatures(AttributeDescriptor[], Object[], Filter) -* FeatureStore.modifyFeatures(Name, Object, Filter) -* FeatureStore.modifyFeatures(AttributeDescriptor, Object, Filter) -* SimpleFeatureStore.modifyFeatures(String, Object, Filter) -* SimpleFeatureStore.modifyFeatures(String[], Object[], Filter) +* ``FeatureStore.modifyFeatures(Name[], Object[], Filter)`` +* ``FeatureStore.modifyFeatures(AttributeDescriptor[], Object[], Filter)`` +* ``FeatureStore.modifyFeatures(Name, Object, Filter)`` +* ``FeatureStore.modifyFeatures(AttributeDescriptor, Object, Filter)`` +* ``SimpleFeatureStore.modifyFeatures(String, Object, Filter)`` +* ``SimpleFeatureStore.modifyFeatures(String[], Object[], Filter)`` - SimpleFeatureStore allows attribute information to be represented as a simple String. + ``SimpleFeatureStore`` allows attribute information to be represented as a simple ``String``. Transaction control: -* FeatureStore.setTransaction(Transaction) -* FeatureStore.getTransaction() +* ``FeatureStore.setTransaction(Transaction)`` +* ``FeatureStore.getTransaction()`` -Reset the entire contents of the FeatureStore: +Reset the entire contents of the ``FeatureStore``: -* FeatureStore.setFeatures(FeatureReader) +* ``FeatureStore.setFeatures(FeatureReader)`` -Session information is captured using a Transaction: +Session information is captured using a ``Transaction``: -* Transaction +* ``Transaction`` Used to control the current editing process and close the transaction when it is completed. - * Transaction.commit() - * Transaction.rollback() - * Transaction.close() + * ``Transaction.commit()`` + * ``Transaction.rollback()`` + * ``Transaction.close()`` Transaction properties used to hold values for the duration of a transaction. - * Transaction.putProperty(Object, Object) - * Transaction.getProperty(Object) + * ``Transaction.putProperty(Object, Object)`` + * ``Transaction.getProperty(Object)`` - Authorisations acquired using a FeatureLock request - * Transaction.addAuthorization(String) - * Transaction.getAuthorizations() + ``Authorization`` acquired using a ``FeatureLock`` request + * ``Transaction.addAuthorization(String)`` + * ``Transaction.getAuthorizations()`` - There is also a placeholder Transaction.AUTO_COMMIT available to configure a FeatureStore + There is also a placeholder ``Transaction.AUTO_COMMIT`` available to configure a ``FeatureStore`` to write out each change as it occurs. - For internal use Transaction also holds session information for commit and rollback. + For internal use ``Transaction`` also holds session information for commit and rollback. - * Transaction.putState(Object, State) - * Transaction.removeState(Object) - * Transaction.getState(Object) + * ``Transaction.putState(Object, State)`` + * ``Transaction.removeState(Object)`` + * ``Transaction.getState(Object)`` SimpleFeatureLocking '''''''''''''''''''' @@ -415,78 +417,78 @@ SimpleFeatureLocking .. image:: /images/SimpleFeatureLocking.PNG -FeatureLocking adds a couple of methods to support the idea of time based locking. Each lock request -is made for a specific duration, if attempt to modify the locked features requires an authorisation -code. Any modifications made without the authorisation code will result in an error. Authorisation -codes can be configured per transaction (and may in fact apply to more than one DataStore). +``FeatureLocking`` adds a couple of methods to support the idea of time based locking. Each lock request +is made for a specific duration, if attempt to modify the locked features requires an authorization +code. Any modifications made without the authorization code will result in an error. Authorization +codes can be configured per transaction (and may in fact apply to more than one ``DataStore``). -Here are the methods for FeatureLocking: +Here are the methods for ``FeatureLocking``: -* FeatureLocking.setFeatureLock(FeatureLock) +* ``FeatureLocking.setFeatureLock(FeatureLock)`` - Set the FeatureLock being requested. + Set the ``FeatureLock`` being requested. -* FeatureLocking.lockFeatures(Query) -* FeatureLocking.lockFeatures(Filter) -* FeatureLocking.lockFeatures() +* ``FeatureLocking.lockFeatures(Query)`` +* ``FeatureLocking.lockFeatures(Filter)`` +* ``FeatureLocking.lockFeatures()`` Lock all features, or limit the features being locked with a filter or query. -* FeatureLocking.unLockFeatures() -* FeatureLocking.unLockFeatures(Filter) -* FeatureLocking.unLockFeatures(Query) +* ``FeatureLocking.unLockFeatures()`` +* ``FeatureLocking.unLockFeatures(Filter)`` +* ``FeatureLocking.unLockFeatures(Query)`` Called to release features. -Session information for FeatureLocking is captured with a FeatureLock. This represents the request being -made with each call to lockFeatures. +Session information for ``FeatureLocking`` is captured with a ``FeatureLock``. This represents the request being +made with each call to ``lockFeatures``. -* FeatureLock +* ``FeatureLock`` - Used to configure a FeatureLocking to request that features be locked for a set duration of time. + Used to configure a ``FeatureLocking`` to request that features be locked for a set duration of time. - * FeatureLock.getDuration() + * ``FeatureLock.getDuration()`` - Resulting in a set of authorisation Strings. These strings can be used to configure a Transaction + Resulting in a set of authorization ``Strings``. These strings can be used to configure a ``Transaction`` allowing locked features to be operated on. - * FeatureLock.getAuthorization() + * ``FeatureLock.getAuthorization()`` DataAccessFactorySpi ^^^^^^^^^^^^^^^^^^^^^ -To create a DataStore GeoTools uses a plugin system based around the DataStoreFactorySpi class. +To create a ``DataStore`` GeoTools uses a plugin system based around the ``DataStoreFactorySpi`` class. -For most purposes this class is an internal details, however if you want to look at all the supported formats on the CLASSPATH you can ask DataStoreFinder for the complete list.:: +For most purposes this class is an internal detail, however if you want to look at all the supported formats on the CLASSPATH you can ask ``DataStoreFinder`` for the complete list.:: for( Iterator i=DataStoreFinder.getAvailableDataStores(); i.hasNext(); ){ DataStoreFactorySpi factory = (DataStoreFactorySpi) i.next(); System.out.println( factory.getDisplayName() ); } -* DataAccessFactory.createDataStore(Map) -* DataStoreFactorySpi.createDataStore(Map) +* ``DataAccessFactory.createDataStore(Map)`` +* ``DataStoreFactorySpi.createDataStore(Map)`` - Used to create a DataStore using the provided map of connection parameters. + Used to create a ``DataStore`` using the provided map of connection parameters. Please note this is used to connect to an existing source of information such as an existing shapefile or an existing web feature server. -* DataStoreFactorySpi.createNewDataStore(Map) +* ``DataStoreFactorySpi.createNewDataStore(Map)`` Used to create a new storage location (example a new shapefile). -* DataAccessFactory.getDisplayName() -* DataAccessFactory.getDescription() +* ``DataAccessFactory.getDisplayName()`` +* ``DataAccessFactory.getDescription()`` Human readable name and description. -* DataAccessFactory.getParametersInfo() +* ``DataAccessFactory.getParametersInfo()`` Description of connection parameters. -* DataAccessFactory.canProcess(Map) +* ``DataAccessFactory.canProcess(Map)`` Used to check the required connection parameters and confirm they can be processed into a DataStore. Note the DataStore may @@ -495,10 +497,10 @@ For most purposes this class is an internal details, however if you want to look This method confirms the required information is available. -* DataAccessFactory.isAvailable() +* ``DataAccessFactory.isAvailable()`` - Some formats require additional jars to be available on the CLASSPATH. As an example + Some formats require additional jars to be available on the ``CLASSPATH``. As an example database formats often require a JDBC driver to be present. This method will perform a check and confirm that the needed dependencies are available - providing a smooth way for the DataAccessFactory to report if it is unable to connect. + providing a smooth way for the ``DataAccessFactory`` to report if it is unable to connect. diff --git a/docs/user/library/main/envelope.rst b/docs/user/library/main/envelope.rst index 793f060c475..79a85da599c 100644 --- a/docs/user/library/main/envelope.rst +++ b/docs/user/library/main/envelope.rst @@ -7,68 +7,68 @@ Envelopes are used to represent the bounds of a geometry, and are used very freq GeoTools, through virtue of reusing code, has two "Envelope" implementations to contend with: -* Java Rectangle2D - we have **Envelope2D** which is spatial extension of the Java Rectangle2D class. Our implementation makes use of doubles to store coordinates and holds on to a CoordinateReferenceSystem allowing us to tell where the coordinates are located. +* Java ``Rectangle2D`` - we have ``Envelope2D`` which is spatial extension of the Java ``Rectangle2D`` class. Our implementation makes use of doubles to store coordinates and holds on to a ``CoordinateReferenceSystem`` allowing us to tell where the coordinates are located. -* JTS Envelope - we have *ReferencedEnvelope* which is adds a CoordinateReferenceSystem to a traditional JTS Envelope. A subclass of ReferencedEnvelope is *ReferencedEnvelope3D* which supports a third dimension on top of the regular two dimensions. +* JTS ``Envelope`` - we have ``ReferencedEnvelope`` which is adds a ``CoordinateReferenceSystem`` to a traditional JTS Envelope. A subclass of ``ReferencedEnvelope`` is ``ReferencedEnvelope3D`` which supports a third dimension on top of the regular two dimensions. -As you can see **ReferencedEnvelope** and **ReferencedEnvelope3D** are a bit of a olive branch between the JTS Geometry model and ISO Geometry model. +As you can see ``ReferencedEnvelope`` and ``ReferencedEnvelope3D`` are a bit of a olive branch between the JTS Geometry model and ISO Geometry model. You will find other "Rectangles" around as you make use of GeoTools in a real world application. -* Java Rectangles +* Java ``Rectangles`` - Java Rectangles record x,y,w,h: + Java ``Rectangles`` record x,y,w,h: -* Rectangle2D +* ``Rectangle2D`` - * Rectangle2D.Double rectangle working with doubles - * Rectangle2D.Float rectangle working with floats + * ``Rectangle2D.Double`` rectangle working with doubles + * ``Rectangle2D.Float`` rectangle working with floats -* Envelope2D we have a spatial specific version of Rectangle2D that implements ISO Geometry Envelope +* ``Envelope2D`` we have a spatial specific version of ``Rectangle2D`` that implements ISO Geometry Envelope -* Rectangle the original rectangle for working on the screen, measured in integers +* ``Rectangle`` the original rectangle for working on the screen, measured in integer pixels. ReferencedEnvelope ^^^^^^^^^^^^^^^^^^ -ReferencedEnvelope is all of these: +``ReferencedEnvelope`` is all of these: -* **org.locationtech.jts.geom.Envelope** - as defined by the JTS Topology System ( a Simple Feature for SQL concept) -* **org.opengis.geometry.BoundingBox** - 2D bounds as defined by the ISO 19107 Geometry -* **org.opengis.geometry.Envelope** - captures 3D bounds as defined by ISO 19107 Geometry. +* ``org.locationtech.jts.geom.Envelope`` - as defined by the JTS Topology System ( a Simple Feature for SQL concept) +* ``org.opengis.geometry.BoundingBox`` - 2D bounds as defined by the ISO 19107 Geometry +* ``org.opengis.geometry.Envelope`` - captures 3D bounds as defined by ISO 19107 Geometry. -Note that in order to support 3D bounds (and use a 3D Coordinate Reference System) we must create an instance of the child class **ReferencedEnvelope3D** (see below). +Note that in order to support 3D bounds (and use a 3D Coordinate Reference System) we must create an instance of the child class ``ReferencedEnvelope3D`` (see below). -In short this is the class to use when you want to represent a bounds in GeoTools. The only other thing of note is the that the constructor expects the input in xMin,xMax,yMin,yMax order and expects a (2D) crs: +In short this is the class to use when you want to represent a bounds in GeoTools. The only other thing of note is the that the constructor expects the input in ``xMin,xMax,yMin,yMax`` order and expects a (2D) CRS: .. literalinclude:: /../src/main/java/org/geotools/api/APIExamples.java :language: java :start-after: // exampleReferencedEnvelope start :end-before: // exampleReferencedEnvelope end -ReferencedEnvelope does one thing very well; it is an Envelope that has a CoordinateReferenceSystem. Because it has a CoordinateReferenceSystem you can quickly transform it between projections.: +``ReferencedEnvelope`` does one thing very well; it is an ``Envelope`` that has a ``CoordinateReferenceSystem``. Because it has a ``CoordinateReferenceSystem`` you can quickly transform it between projections.: .. literalinclude:: /../src/main/java/org/geotools/api/APIExamples.java :language: java :start-after: // transformReferencedEnvelope start :end-before: // transformReferencedEnvelope end -**ReferencedEnvelope** is used in a lot of GeoTools interfaces, basically anywhere we can get away -with it. Using a raw JTS Envelope without knowing the the CoordinateReferenceSystem is difficult to +``ReferencedEnvelope`` is used in a lot of GeoTools interfaces, basically anywhere we can get away +with it. Using a raw JTS ``Envelope`` without knowing the ``CoordinateReferenceSystem`` is difficult to use as the information is incomplete forcing client code to make assumptions. Some code assumes the envelope is in WGS84 while other code assumes it is in the same Coordinate Reference System as the data being worked on. Some of our older interfaces that you are forced to read the javadocs in order to figure out the -CoordinateReferenceSystem for a returned Envelope. +``CoordinateReferenceSystem`` for a returned Envelope. -* Using a FeatureSource without ReferencedEnvelope example:: +* Using a ``FeatureSource`` without ``ReferencedEnvelope`` example:: Envelope bounds = featureSource.getBounds(); CoordinateReferenceSystem crs = featureSource.getSchema().getDefaultGeometry().getCoordinateSystem(); -* Using a FeatureSource with ReferencedEnvelope:: +* Using a ``FeatureSource`` with ``ReferencedEnvelope``:: ReferencedEnvelope bounds = (ReferencedEnvelope) featureSource.getBounds(); @@ -77,20 +77,20 @@ CoordinateReferenceSystem for a returned Envelope. ReferencedEnvelope3D ^^^^^^^^^^^^^^^^^^^^ -ReferencedEnvelope3D is all of these: +``ReferencedEnvelope3D`` is all of these: -* **ReferencedEnvelope** including all parent classes and interfaces -* **org.opengis.geometry.BoundingBox3D** - 3D bounds as defined by the ISO 19107 Geometry +* ``ReferencedEnvelope`` including all parent classes and interfaces +* ``org.opengis.geometry.BoundingBox3D`` - 3D bounds as defined by the ISO 19107 Geometry -This is the class to use when you want to represent a 3D bounds in GeoTools. The constructor expects the input in xMin,xMax,yMin,yMax,zMin,zMax order and expects a 3D crs: +This is the class to use when you want to represent a 3D bounds in GeoTools. The constructor expects the input in ``xMin,xMax,yMin,yMax,zMin,zMax`` order and expects a 3D CRS: .. literalinclude:: /../src/main/java/org/geotools/api/APIExamples.java :language: java :start-after: // exampleReferencedEnvelope3D start :end-before: // exampleReferencedEnvelope3D end -As explained above, when using a 3D CRS we must create an instance of ReferencedEnvelope3D and not of its parent class. If we are not sure what dimension we are dealing with, -there are safe ways to create, copy, convert or reference ReferencedEnvelope instances: +As explained above, when using a 3D CRS we must create an instance of ``ReferencedEnvelope3D`` and not of its parent class. If we are not sure what dimension we are dealing with, +there are safe ways to create, copy, convert or reference ``ReferencedEnvelope`` instances: .. literalinclude:: /../src/main/java/org/geotools/api/APIExamples.java :language: java @@ -100,15 +100,15 @@ there are safe ways to create, copy, convert or reference ReferencedEnvelope ins OpenGIS Envelope ^^^^^^^^^^^^^^^^ -OpenGIS records a "rectangle" as a bounds along the axis mentioned by the CoordinateReferenceSystem object. You can use this idea to record a simple rectangle in space, a height range and and a range in time as needed. +OpenGIS records a "rectangle" as a bounds along the axis mentioned by the ``CoordinateReferenceSystem`` object. You can use this idea to record a simple rectangle in space, a height range and a range in time as needed. .. image:: /images/envelope2.PNG -* Envelope2D - was introduced above; used to bridge to Java2D -* ReferencedEnvelope - was introduced above; used to bridge to JTS Geometry -* GeneralEnvelope - allows you to record spans in multiple dimensions (think depth, height or time) +* ``Envelope2D`` - was introduced above; used to bridge to Java2D +* ``ReferencedEnvelope`` - was introduced above; used to bridge to JTS Geometry +* ``GeneralEnvelope`` - allows you to record spans in multiple dimensions (think depth, height or time) -Since **Envelope** is just and interface, so we will use **ReferencedEnvelope** for the example: +Since ``Envelope`` is just and interface, so we will use ``ReferencedEnvelope`` for the example: .. literalinclude:: /../src/main/java/org/geotools/api/APIExamples.java :language: java @@ -117,10 +117,9 @@ Since **Envelope** is just and interface, so we will use **ReferencedEnvelope** You can see even in a simple example we should be looking at the CRS to figure out what the axis is actually measuring. -If you are super confident that you are working with data in X/Y order you can directly make use of BoundingBox box. BoundingBox is an extension of Envelope for working with 2D data, and it has been made method compatible with JTS Envelope where possible. +If you are super confident that you are working with data in X/Y order you can directly make use of ``BoundingBox`` box. ``BoundingBox`` is an extension of ``Envelope`` for working with 2D data, and it has been made method compatible with JTS ``Envelope`` where possible. -Since **BoundingBox** is just an interface, so we will use **ReferencedEnvelope** -for this example: +Since ``BoundingBox`` is just an interface, so we will use ``ReferencedEnvelope`` for this example: .. literalinclude:: /../src/main/java/org/geotools/api/APIExamples.java :language: java @@ -130,16 +129,16 @@ for this example: JTS Envelope ^^^^^^^^^^^^ -The JTS Topology Suite has the concept of an Envelope recorded in x1,x2, y1,y2 order. +The JTS Topology Suite has the concept of an ``Envelope`` recorded in ``x1,x2, y1,y2`` order. -You can see that the use of JTS Envelope has the same "assumptions" as the use of BoundingBox above.: +You can see that the use of JTS ``Envelope`` has the same "assumptions" as the use of ``BoundingBox`` above.: .. literalinclude:: /../src/main/java/org/geotools/api/APIExamples.java :language: java :start-after: // exampleEnvelope start :end-before: // exampleEnvelope end -Transform an Envelope using the JTS Utility class: +Transform an ``Envelope`` using the JTS ``Utility`` class: .. literalinclude:: /../src/main/java/org/geotools/api/APIExamples.java :language: java diff --git a/docs/user/library/main/faq.rst b/docs/user/library/main/faq.rst index a3fe3b048c5..cf4d5ca6ef1 100644 --- a/docs/user/library/main/faq.rst +++ b/docs/user/library/main/faq.rst @@ -1,23 +1,23 @@ Main FAQ -------- -Q: What is gt-main responsible for? -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Q: What is ``gt-main`` responsible for? +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The gt-main completes the GeoTools API with additional interfaces extending the concepts provided by gt-opengis. +The ``gt-main`` completes the GeoTools API with additional interfaces extending the concepts provided by ``gt-opengis``. -The gt-main module is responsible for the default mplementation of the interfaces in gt-main and gt-opengis. This includes the default implementations for the feature model, filter support, and style definition. +The ``gt-main`` module is responsible for the default implementation of the interfaces in ``gt-main`` and ``gt-opengis``. This includes the default implementations for the feature model, filter support, and style definition. -The gt-main module makes this functionality available through the plug-in system allowing you to make use of CommonFactoryFinder rather than directly depend on the default implementations provided here. +The ``gt-main`` module makes this functionality available through the plug-in system allowing you to make use of CommonFactoryFinder rather than directly depend on the default implementations provided here. Q: How do I make a FeatureType? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -You can make a feature type quickly using using the DataUtilities class: +You can make a feature type quickly using using the DataUtilities class:: SimpleFeatureType lineType = DataUtilities.createType("LINE", "centerline:LineString,name:\"\",id:0"); -For greater control consider direct use of a FeatureTypeBuilder:: +For greater control consider direct use of a ``FeatureTypeBuilde``:: SimpleFeatureTypeBuilder b = new SimpleFeatureTypeBuilder(); @@ -65,8 +65,8 @@ This requirement prevents us implementing Collection (and being compatible with I am afraid this is a fundamental limitation of Java and not something that can or should be addressed in a future release. -Q: Why does gt-main define its own Style interfaces? -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Q: Why does ``gt-main`` define its own Style interfaces? +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The GeoTools interfaces for Style are a straight extension of the gt-opengis interfaces allowing mutability. This does come with a drawback; we need to ask you to be careful of thread safety. +The GeoTools interfaces for Style are a straight extension of the ``gt-opengis`` interfaces allowing mutability. This does come with a drawback; we need to ask you to be careful of thread safety. diff --git a/docs/user/library/main/feature.rst b/docs/user/library/main/feature.rst index d24cd787f8e..faad8031e42 100644 --- a/docs/user/library/main/feature.rst +++ b/docs/user/library/main/feature.rst @@ -5,14 +5,14 @@ This page consists of a series of code examples showing how to do common tasks w Reference: -* :doc:`../opengis/model` gt-opengis data model -* :doc:`../opengis/type` gt-opengis feature type interfaces -* :doc:`../opengis/feature` gt-opengis feature interfaces +* :doc:`../opengis/model` ``gt-opengis`` data model +* :doc:`../opengis/type` ``gt-opengis`` feature type interfaces +* :doc:`../opengis/feature` ``gt-opengis`` feature interfaces Build a Feature Type ^^^^^^^^^^^^^^^^^^^^ -Since FeatureType is immutable you will often see them used as constants as shown in the following examples: +Since ``FeatureType`` is immutable you will often see them used as constants as shown in the following examples: Simple case:: @@ -61,7 +61,7 @@ Multiple geometries (with implicit default geometry):: b.add( "hub", Point.class ); b.add( "network", MultiLineString.class ); -Multiple geometries with explicit default geoemtry:: +Multiple geometries with explicit default geometry:: b.setCRS( DefaultGeographicCRS.WSG84 ); @@ -108,7 +108,7 @@ Alternative: Chaining:: b.crs( crs1 ).add( "local", Point.class ); b.crs( crs2 ).add( "world", Point.class ); -Alternative: Using an SRS:: +Alternative: Using an CRS:: b.srs( "EPSG:3005" ).add( "local", Point.class ); b.srs( "EPSG:4326" ).add( "world", Point.class ); @@ -165,15 +165,15 @@ Creating a global name:: DataUtilities ''''''''''''' -DataUtilities has a method that you can use to quickly create a FeatureType for test cases:: +``DataUtilities`` has a method that you can use to quickly create a ``FeatureType`` for test cases:: final SimpleFeatureType FLAG = DataUtilities.createType("Flag","Location:Point,Name:String"); -You can define the Coordinate Reference System using : +You can define the Coordinate Reference System using:: final SimpleFeatureType FLAG = DataUtilities.createType("Flags","geom:MultiPoint:srid=4326,Name:String"); -You can also ask for the String representation of a FeatureType: +You can also ask for the String representation of a ``FeatureType``:: System.out.println( DataUtilities.spec( FLAG ) ); @@ -182,9 +182,9 @@ For more information see :doc:`data`. FeatureFactory '''''''''''''' -You can also use FeatureFactory directly; this is advised when building nested features (as we only have a SimpleFeatureTypeBuilder at present). +You can also use ``FeatureFactory`` directly; this is advised when building nested features (as we only have a ``SimpleFeatureTypeBuilder`` at present). -Using a TypeFactory:: +Using a ``TypeFactory``:: TypeFactory typeFactory = CommonFactoryFinder.getTypeFactory( null ); SimpleTypeFactory featureTypeFactory = CommonFactoryFinder.getSimpleTypeFeatureFactory( null ); @@ -214,7 +214,7 @@ Using a TypeFactory:: final FeatureType FLAG = featureTypeFactory.createSimpleFeatureType( name, types, defaultGeometry, crs, Collections.EMPTY_SET, description ); -As you can see we usually recommend SimpleFeatureTypeBuilder as it provides assistance with the above work for you. +As you can see we usually recommend ``SimpleFeatureTypeBuilder`` as it provides assistance with the above work for you. Build a Feature ^^^^^^^^^^^^^^^ @@ -269,14 +269,14 @@ Alternative setting by index:: DataUtilities ''''''''''''' -DataUtilities has some utility methods that will create a "template" feature with sensible default values filled in based on the FeatureType. +``DataUtilities`` has some utility methods that will create a "template" feature with sensible default values filled in based on the ``FeatureType``. For more information see :doc:`data`. FeatureFactory '''''''''''''' -Once again we will ask you to use FilterFactory directly if you are building up a Feature by hand. +Once again we will ask you to use ``FilterFactory`` directly if you are building up a ``Feature`` by hand. Accessing ^^^^^^^^^ @@ -353,17 +353,17 @@ Geometry value access using name:: Coordinate Reference System ''''''''''''''''''''''''''' -CoordinateReferenceSystem access:: +``CoordinateReferenceSystem`` access:: // Access the CRS of getDefaultGeometryProperty() CoordinateReferenceSystem crs = feature.getCRS(); -CoordinateReferenceSystem of default geometry property:: +``CoordinateReferenceSystem`` of default geometry property:: CoordinateReferenceSystem crs = feature.getDefaultGeometryProperty() == null ? null : feature.getDefaultGeometryProperty().getCRS(); -CoordinateReferenceSystem of named Property:: +``CoordinateReferenceSystem`` of named Property:: GeometryAttribute location = (GeometryAttribute) feature.getProperty( "location" ); CoordinateReferenceSystem bounds = location.getCRS(); @@ -371,17 +371,17 @@ CoordinateReferenceSystem of named Property:: BoundingBox ''''''''''' -BoundingBox access:: +``BoundingBox`` access:: // Access the BoundingBox of getDefaultGeometryProperty() BoundingBox bounds = feature.getBounds(); -BoundingBox of getDefaultGeometryProperty():: +``BoundingBox`` of ``getDefaultGeometryProperty()``:: BoundingBox bounds = feature.getDefaultGeometryProperty() == null ? null : feature.getDefaultGeometryProperty().getBounds(); -BoundingBox of named Property:: +``BoundingBox`` of named ``Property``:: GeometryAttribute location = (GeometryAttribute) feature.getProperty( "location" ); BoundingBox bounds = location.getBounds(); @@ -389,7 +389,7 @@ BoundingBox of named Property:: Name '''' -Name access:: +``Name`` access:: // can access both parts of a name - similar to XML QName String localName = name.getLocalPart(); @@ -399,7 +399,7 @@ Check if name is global:: name.isGlobal(); // true! name.getNamespaceURI() == null -Name comparison:: +``Name`` comparison:: Name name1 = new Name( "gopher://localhost/example", "name" ); Name name2 = new Name( "gopher://localhost", "example/name" ); diff --git a/docs/user/library/main/filter.rst b/docs/user/library/main/filter.rst index b21220bc1ba..b6a532ae293 100644 --- a/docs/user/library/main/filter.rst +++ b/docs/user/library/main/filter.rst @@ -1,20 +1,20 @@ Filter ------ -GeoTools makes use of the gt-opengis **Filter** and **Expression** interfaces in order to express constraints. This is most often used when making a Query to retrieve specific Features from a DataStore. +GeoTools makes use of the ``gt-opengis`` ``Filter`` and ``Expression`` interfaces in order to express constraints. This is most often used when making a Query to retrieve specific ``Features`` from a ``DataStore``. Reference: -* gt-opengis data :doc:`../opengis/model` for feature, featureType and filter -* gt-opengis :doc:`../opengis/filter` model -* gt-cql :doc:`../cql/index` -* gt-xml :doc:`../xml/index` +* ``gt-opengis`` data :doc:`../opengis/model` for ``Feature``, ``FeatureType`` and ``Filter`` +* ``gt-opengis`` :doc:`../opengis/filter` model +* ``gt-cql`` :doc:`../cql/index` +* ``gt-xml`` :doc:`../xml/index` * http://docs.geoserver.org/stable/en/user/filter/function_reference.html -You will find the use of Filter in an number of other locations: +You will find the use of ``Filter`` in an number of other locations: -* it is used as part of a Style when we need to select what is drawn on the screen -* Part of our FeatureType to express any special constraints on data values (such as the length of a String) +* it is used as part of a ``Style`` when we need to select what is drawn on the screen +* Part of our ``FeatureType`` to express any special constraints on data values (such as the length of a ``String``) Create Filter ^^^^^^^^^^^^^ @@ -22,7 +22,7 @@ Create Filter Using CQL ''''''''' -Most code examples in this guide will assume you are using the "Common Query Language", this parser is provided by the **gt-cql** jar.:: +Most code examples in this guide will assume you are using the "Common Query Language", this parser is provided by the ``gt-cql`` module.:: Filter filter = CQL.toFilter("attName >= 5"); @@ -31,15 +31,15 @@ Using FilterFactory You have a choice of which filter factory to use: -* **FilterFactory** directly create a filter - according to the - limitations of the standard standard. +* ``FilterFactory`` directly create a filter - according to the + limitations of the standard. Use this if you are making a request of an external Web Feature Server and do not want to accidentally step out of bounds. -* **FilterFactory2** directly create a filter. +* ``FilterFactory2`` directly create a filter. - Has some additional methods for working with JTS Geometry. + Has some additional methods for working with JTS ``Geometry``. Here is an example:: @@ -47,7 +47,7 @@ Here is an example:: Filter filter = ff.contains( ff.property( "THE_GEOM"), ff.literal( geometry ) ); -One thing you can do with with a FilterFactory (which you cannot do in CQL) is request features by their FeatureId:: +One thing you can do with with a ``FilterFactory`` (which you cannot do in CQL) is request features by their ``FeatureId``:: FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2( GeoTools.getDefaultHints() ); @@ -79,20 +79,21 @@ Java Beans (and plenty of other objects) also work with filter:: System.out.println( bean + " was selected" ); } -If you look in the advanced guide you can find out about **PropertyAccessors** which is how Filter learns how to access new content. +If you look in the advanced guide you can find out about ``PropertyAccessors`` which is how ``Filter`` learns how to access new content. You can teach GeoTools how to work with your domain objects by implementing a custom Property Accessor. Using this facility GeoTools -users have used filters with Java Beans, Maps and Collections and featureTypes. +users have used filters with Java ``Beans``, ``Maps`` and ``Collections`` and +``FeatureTypes``. Writing XML ''''''''''' -We have a traditional "Transformer" for quickly writing out an XML fragment for a filter:: +We have a traditional ``Transformer`` for quickly writing out an XML fragment for a filter:: FilterTransformer transform = new FilterTransformer(); transform.setIndentation(2); String xml = transform.transform( filter ); -You can also **gt-xml** and its **OGCConfiguration** for encoding a filter:: +You can also ``gt-xml`` and its ``OGCConfiguration`` for encoding a filter:: //create the encoder with the filter 1.0 configuration Configuration = new org.geotools.filter.v1_0.OGCConfiguration(); @@ -104,20 +105,20 @@ You can also **gt-xml** and its **OGCConfiguration** for encoding a filter:: Handling Selection '''''''''''''''''' -Often an application will want to remember the Feature that a user was working with for later. This section shows a couple of approaches to recording what Features a user has "selected". +Often an application will want to remember the Feature that a user was working with for later. This section shows a couple of approaches to recording what ``Features`` a user has "selected". * Q: How to find Features using IDs - Each Feature has a FeatureID; you can use these FeatureIDs to request the feature again later. + Each ``Feature`` has a ``FeatureID``; you can use these ``FeatureIDs`` to request the feature again later. - If you have a Set of feature IDs, which you would like to query from a shapefile: + If you have a ``Set`` of feature IDs, which you would like to query from a shapefile: .. literalinclude:: /../src/main/java/org/geotools/main/FilterExamples.java :language: java :start-after: // grabSelectedIds start :end-before: // grabSelectedIds end - Keeping a Set of feature ids is the best way to handle selection. + Keeping a ``Set`` of feature ids is the best way to handle selection. Using an Id filter as shown above is often very fast. @@ -134,16 +135,16 @@ Q: How to find a Feature by Name :start-after: // grabSelectedName start :end-before: // grabSelectedName end - To select this feature while ignoring case we are going to have to use the FilterFactory (rather than CQL): + To select this feature while ignoring case we are going to have to use the ``FilterFactory`` (rather than CQL): .. literalinclude:: /../src/main/java/org/geotools/main/FilterExamples.java :language: java :start-after: // grabSelectedNameIgnoreCase start :end-before: // grabSelectedNameIgnoreCase end -* Q: How find Features using Names +* Q: How find ``Features`` using ``Names`` - If you have a Set of "names" which you would like to query from PostGIS. In this case we are doing a + If you have a ``Set`` of "names" which you would like to query from PostGIS. In this case we are doing a check for an attribute called "Name". .. literalinclude:: /../src/main/java/org/geotools/main/FilterExamples.java @@ -156,7 +157,7 @@ Q: How to find a Feature by Name Handling Bounding Box ''''''''''''''''''''' -Often your users start by selecting on something with a click. Translating that to a BoundingBox, and then into a query is a little involved. +Often your users start by selecting on something with a click. Translating that to a ``BoundingBox``, and then into a query is a little involved. .. image:: /images/Filter_BBox.png @@ -172,9 +173,9 @@ in order to make the correct query. * Q: What features are on the screen? - * BBOX + * ``BBOX`` - One quick way to handle this is to treat the screen as a BBox and + One quick way to handle this is to treat the screen as a ``BBox`` and make a request for the contents. .. image:: /images/filter_screen.png @@ -205,10 +206,10 @@ in order to make the correct query. :start-after: // grabFeaturesInPolygon start :end-before: // grabFeaturesInPolygon end - * BBox and then Intersects + * ``BBox`` and then ``Intersects`` You can go faster by using both techniques, the bounds check will cut down on most of the features - right away; and the more expensive Polygon for the final check. + right away; and the more expensive ``Polygon`` for the final check. .. image:: /images/filter_screen2.png @@ -236,7 +237,7 @@ Q: What did I click on? :start-after: // click1 start :end-before: // click1 end - * Use a point for to Check Polygon Layers + * Use a ``Point`` to check ``Polygon`` layers You can turn the tables around when selecting polygons, and issue your query using a single point - and check what polygon(s) contain the point. @@ -244,15 +245,15 @@ Q: What did I click on? .. image:: /images/filter_point.png - Please note this is only suitable for working with Polygons as selecting a line + Please note this is only suitable for working with ``Polygons`` as selecting a line using a single point is next to impossible.:: FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2( null ); Filter filter = ff.contains( ff.property( geometryAttributeName ), ff.literal( point ) ); - * Use a distance Check + * Use a distance check - Another common approach is to call geometry.buffer( distance ) and then select with the resulting + Another common approach is to call ``geometry.buffer(distance)`` and then select with the resulting polygon. Please consider making your request with a distance check instead. @@ -265,30 +266,30 @@ Q: What did I click on? :start-after: // distance start :end-before: // distance end - This technique also benefits from adding a BBox check in front. + This technique also benefits from adding a ``BBox`` check in front. Expression ^^^^^^^^^^ -We can go through the same steps to create an expression. +We can go through the same steps to create an ``Expression``. * CQL - Used for human readable code examples, "Common Query Language" parser is provided by **gt-cql** jar.:: + Used for human readable code examples, "Common Query Language" parser is provided by ``gt-cql`` jar.:: Expression filter = CQL.toExpression("attName"); -* FilterFactory +* ``FilterFactory`` You have a choice of which filter factory to use: - * **FilterFactory** directly create a filter - according to the + * ``FilterFactory`` directly create a filter - according to the limitations of the standard standard. Use this if you are making a request of an external Web Feature Server and do not want to accidentally step out of bounds. - * **FilterFactory2** directly create a filter. + * ``FilterFactory2`` directly create a filter. Has some additional methods for working with JTS Geometry. @@ -309,11 +310,11 @@ Function is a little special as it is your chance to add new functions to the sy .. image:: /images/filter_function.PNG -You accomplish this by providing three peices of information: +You accomplish this by providing three pieces of information: -* Function - implementation of Function -* FunctionName - description of Function including name and argument names advertising that a Function is available -* FunctionFactory - used to construct a Function on request by FilterFactory.function( name, expression ... ) +* ``Function`` - implementation of ``Function`` +* ``FunctionName`` - description of ``Function`` including name and argument names advertising that a Function is available +* ``FunctionFactory`` - used to construct a Function on request by ``FilterFactory.function( name, expression ... )`` If you are interested in implementing a function and registering it with GeoTools is the example used to explain the GeoTools plugin system. @@ -321,16 +322,16 @@ is the example used to explain the GeoTools plugin system. FunctionFinder ^^^^^^^^^^^^^^ -You can directly create a Function with a FunctionFinder; this gives you access to the actual implementing +You can directly create a ``Function`` with a ``FunctionFinder``; this gives you access to the actual implementing class; which occasionally offer more options that are accessible through filter factory. -* getAllFunctionDescriptions() -* findFunctionDescription(String) -* FunctionFinder.findFunction(String) -* FunctionFinder.findFunction(String, List ) -* FunctionFinder.findFunction(String, List )`` +* ``FunctionFinder.findFunction(String, List) -* gets(String, Class) -* number(Object) -* puts(Color) -* puts(double) -* puts(Object) +* ``asDouble(Expression)`` +* ``asInt(Expression)`` +* ``asString(Expression)`` +* ``asType(Expression, Class)`` +* ``gets(String, Class)`` +* ``number(Object)`` +* ``puts(Color)`` +* ``puts(double)`` +* ``puts(Object)`` - Helper methods for those implementing Filter, these have been - replaced with the much more powerful **Converters** class.:: + Helper methods for those implementing ``Filter``, these have been + replaced with the much more powerful ``Converters`` class.:: // before text = Filters.puts( Color.BLACK ); // after text = Converters.convert( Color.BLACK, String.class ); -* Filters.getFilterType(Filter) +* ``Filters.getFilterType(Filter)`` - Assist GeoTools 2.2 code where FeatureType constants were used rather than instanceof checks.:: + Assist GeoTools 2.2 code where ``FeatureType`` constants were used rather than ``instanceof`` checks.:: // before switch( Filters.getFilterType( filter ) ){ @@ -537,30 +538,30 @@ There is a small utility class **Filters** that packages up some common Filter o .. } -* Filters.duplicate( filter ) +* ``Filters.duplicate( filter )`` - Can be used to perform a deep copy of a Filter:: + Can be used to perform a deep copy of a ``Filter``:: Filters utility = Filters(); Filter copy = filters.duplicate( filter ); - Internally this method uses DuplicatingFilterVisitor:: + Internally this method uses ``DuplicatingFilterVisitor``:: DuplicatingFilterVisitor duplicate = new DuplicatingFilterVisitor(); Filter copy = (Filter) filter.accept( duplicate, null ); -* Filters.attributeNames(filter, SimpleFeatureType) -* Filters.propertyNames(expression) -* Filters.propertyNames(expression, SimpleFeatureType) -* Filters.propertyNames(filter) -* Filters.propertyNames(filter, SimpleFeatureType) -* Filters.findPropertyName( filter ); +* ``Filters.attributeNames(filter, SimpleFeatureType)`` +* ``Filters.propertyNames(expression)`` +* ``Filters.propertyNames(expression, SimpleFeatureType)`` +* ``Filters.propertyNames(filter)`` +* ``Filters.propertyNames(filter, SimpleFeatureType)`` +* ``Filters.findPropertyName( filter );`` - Methods use to query the structure of the provided Filter. Internally these - usually use a FilterVisitor to transerse the provided Filter + Methods use to query the structure of the provided ``Filter``. Internally these + usually use a ``FilterVisitor`` to traverse the provided ``Filter`` to determine the answer. - Here is a quick example using findPropertyName( filter ):: + Here is a quick example using ``findPropertyName( filter )``:: String xpath = Filters.findPropertyName(b); if( xpath != null ){ @@ -570,15 +571,15 @@ There is a small utility class **Filters** that packages up some common Filter o // filter does not contain any references to PropertyName } -* Filters.hasChildren(Filter) -* Filters.children(Filter) -* Filters.children(Filter, boolean) +* ``Filters.hasChildren(Filter)`` +* ``Filters.children(Filter)`` +* ``Filters.children(Filter, boolean)`` - Query methods regard "children" only apply to filters *and*, *or* and *not* + ``Query`` methods regard "children" only apply to filters *and*, *or* and *not* which are used to combine the results of several filters. -* Filters.and(FilterFactory, Filter, Filter) -* Filters.or(FilterFactory, Filter, Filter) +* ``Filters.and(FilterFactory, Filter, Filter)`` +* ``Filters.or(FilterFactory, Filter, Filter)`` Used to combine two filters; will sensibly "append" filters onto an existing *and* or *or* filter. @@ -587,8 +588,8 @@ There is a small utility class **Filters** that packages up some common Filter o Tip: Used to update GeoTools 2.2 code where Filter was mutable. -* Filters.removeFilter(Filter, Filter) -* Filters.removeFilter(Filter, Filter, boolean) +* ``Filters.removeFilter(Filter, Filter)`` +* ``Filters.removeFilter(Filter, Filter, boolean)`` Used to separate out a child from the provided filter. @@ -598,13 +599,13 @@ There is a small utility class **Filters** that packages up some common Filter o Capabilities ^^^^^^^^^^^^ -You can also use the FilterFactory to fill in a filter capabilities data structure describing +You can also use the ``FilterFactory`` to fill in a filter capabilities data structure describing the abilities of a web or database service. -However we also have a **Capabilities** user class which is helpful both in acting as a "builder" -when creating a FilterCapabilities data structure; and also in making use of the result. +However we also have a ``Capabilities`` user class which is helpful both in acting as a "builder" +when creating a ``FilterCapabilities`` data structure; and also in making use of the result. -* Capabilities as a builder:: +* ``Capabilities`` as a builder:: Capabilities capabilities = new Capabilities(); capabilities.addType( Beyond.class ); // add to SpatialCapabilities diff --git a/docs/user/library/main/function_list.rst b/docs/user/library/main/function_list.rst index 92f1500f75d..86b0b8757cb 100644 --- a/docs/user/library/main/function_list.rst +++ b/docs/user/library/main/function_list.rst @@ -3,4 +3,4 @@ Function List Generated list of available functions at the time of writing: -.. include:: /artifacts/function_list \ No newline at end of file +.. include:: /artifacts/function_list diff --git a/docs/user/library/main/geometry.rst b/docs/user/library/main/geometry.rst index 7d92e4cc19c..9bd4a1720d2 100644 --- a/docs/user/library/main/geometry.rst +++ b/docs/user/library/main/geometry.rst @@ -1,18 +1,18 @@ WKT Parser ---------- -The **gt-main** module supports a "well known text" geometry parser that is able to produce ISO 19107 Geometry instances. This page documents the use of the parser, and provides a little bit of background on the state of ISO 19107 support in GeoTools. +The ``gt-main`` module supports a "well known text" geometry parser that is able to produce ISO 19107 Geometry instances. This page documents the use of the parser, and provides a little bit of background on the state of ISO 19107 support in GeoTools. ISO 19107 Geometry ^^^^^^^^^^^^^^^^^^ -The gt-opengis project provides interfaces for ISO Geometry interfaces, we make use of them day in and -day out for transforming DirectPositions as described in the referencing module. +The ``gt-opengis`` project provides interfaces for ISO Geometry interfaces, we make use of them day in and +day out for transforming ``DirectPositions`` as described in the referencing module. -ISO 19107 also defines TransfineSet of which GeoTools has two implementations: +ISO 19107 also defines ``TransfineSet`` of which GeoTools has two implementations: -* unsupported/jts-wrapper -* unsupported/geometry +* ``unsupported/jts-wrapper`` +* ``unsupported/geometry`` As indicated by their unsupported status neither has past our QA checks at this time. @@ -24,22 +24,22 @@ As indicated by their unsupported status neither has past our QA checks at this Although the entire library is not using ISO Geometry yet; this does not prevent you from going there in your own application. Just be sure to include one of the module mentioned above before you start. -* What is TransfiniteSet +* What is ``TransfiniteSet`` - A TransfiniteSet is the same thing as a JTS Geometry near as I can tell. + A ``TransfiniteSet`` is the same thing as a JTS Geometry near as I can tell. From email - thanks Sunburned Surveyor and Bryce: - I'm a little confused about the purpose of TransfiniteSet. Either this class is a little + I'm a little confused about the purpose of ``TransfiniteSet``. Either this class is a little too abstract for my purposes or I need more explanation in the Javadoc comments. :] - I don't think so. TransfiniteSet is JTS. It just uses some different terminology (from set + I don't think so. ``TransfiniteSet`` is JTS. It just uses some different terminology (from set theory). A circle is what? The set of all points exactly radius "r" from a center point. - If you ask circle.contains(pointA), you'll get a "true" if and only iff "pointA" is - exactly circle.radius away from circle.center. + If you ask ``circle.contains(pointA)``, you'll get a ``true`` if and only if ``pointA`` is + exactly ``circle.radius`` away from ``circle.center``. - A curve is the set of all points which lie along the curve. "Is pointA on the curve?" is - exactly the same as asking curve.contains(pointA)? Same thing different words. + A curve is the set of all points which lie along the curve. "Is ``pointA`` on the curve?" is + exactly the same as asking ``curve.contains(pointA)``? Same thing different words. 19107 was written by math geeks. @@ -48,7 +48,7 @@ ISO Geometry from WKT 1. Start with a Factory - The first step to creating a Geometry is to acquire a GeometryFactory:: + The first step to creating a Geometry is to acquire a ``GeometryFactory``:: GeometryFactory CoordinateReferenceSystem crs = CRS.decode("EPSG:4326"); @@ -56,17 +56,17 @@ ISO Geometry from WKT GeometryFactory geometryFactory = new GeometryFactoryImpl( crs ); - As you can see in the above example you need to already know your CoordinateReferenceSystem - and Precision before creating a GeometryFactory. You can create and use several GeometryFactory + As you can see in the above example you need to already know your ``CoordinateReferenceSystem`` + and Precision before creating a ``GeometryFactory``. You can create and use several ``GeometryFactory`` instances at the same time if you need to work in several projections. - There is one problem here - the GeometryFactory is only good for making Geometry. And to make a Geometry you need Coordinates, and primitives and ... + There is one problem here - the ``GeometryFactory`` is only good for making Geometry. And to make a Geometry you need Coordinates, and primitives and ... 2. Start with Several Factories So I lied to you. You actually need a few more bits of the puzzle before we can accomplish anything. - GeometryFactory and friends:: + ``GeometryFactory`` and friends:: PositionFactory positionFactory = new PositionFactoryImpl(...); CoordinateFactory coordinateFactory = new CoordinateFactoryImpl(...); @@ -80,7 +80,7 @@ ISO Geometry from WKT 2. But wait! - * Where do all these Impls come from? + * Where do all these ``Impls`` come from? * What do they take as parameters? * eek! @@ -88,7 +88,7 @@ ISO Geometry from WKT 3. Use a Good Tool to Sort out the Factories - Using a container such as a PicoContainer, we can teach it about all the factories + Using a container such as a ``PicoContainer``, we can teach it about all the factories and dependencies and it will figure out what to use when you create a factory.:: PicoContainer and dependencies... @@ -120,17 +120,17 @@ ISO Geometry from WKT The SFSQL specification defines a Well Known Text (WKT) format for representing the kind of simple (Point, Line, Polygon) geometry constructs covered by the simple feature for SQL specification. - We have a parser that will use a GeometryFactory to produce the ISO Geometry constructs for you. It will also parse some extra geometry types. + We have a parser that will use a ``GeometryFactory`` to produce the ISO Geometry constructs for you. It will also parse some extra geometry types. - ================== ===================================================== - WKT ISO Geometry - ================== ===================================================== - POINT org.opengis.geometry.primitive.Point - LINESTRING org.opengis.geometry.primitive.Curve - LINEARRING org.opengis.geometry.primitive.Curve - POLYGON org.opengis.geometry.primitive.Surface - MULTIPOINT org.opengis.geometry.coordinate.aggregate.MultiPoint - MULTILINESTRING org.opengis.geometry.aggregate.MultiPrimitive - MULTIPOLYGON org.opengis.geometry.aggregate.MultiPrimitive - GEOMETRYCOLLECTION org.opengis.geometry.aggregate.MultiPrimitive - ================== ===================================================== + ====================== ======================================================== + WKT ISO Geometry + ====================== ======================================================== + ``POINT`` ``org.opengis.geometry.primitive.Point`` + ``LINESTRING`` ``org.opengis.geometry.primitive.Curve`` + ``LINEARRING`` ``org.opengis.geometry.primitive.Curve`` + ``POLYGON`` ``org.opengis.geometry.primitive.Surface`` + ``MULTIPOINT`` ``org.opengis.geometry.coordinate.aggregate.MultiPoint`` + ``MULTILINESTRING`` ``org.opengis.geometry.aggregate.MultiPrimitive`` + ``MULTIPOLYGON`` ``org.opengis.geometry.aggregate.MultiPrimitive`` + ``GEOMETRYCOLLECTION`` ``org.opengis.geometry.aggregate.MultiPrimitive`` + ====================== ======================================================== diff --git a/docs/user/library/main/index.rst b/docs/user/library/main/index.rst index bb6ef22462d..419bd8e1c96 100644 --- a/docs/user/library/main/index.rst +++ b/docs/user/library/main/index.rst @@ -1,20 +1,20 @@ Main ==== -The gt-main module extends the *gt-opengis* concepts with additional interfaces forming the GeoTools API. +The ``gt-main`` module extends the ``gt-opengis`` concepts with additional interfaces forming the GeoTools API. -The gt-main module provides default implementations for the GeoTools API +The ``gt-main`` module provides default implementations for the GeoTools API (Filter, Style, Feature etc...) and enough glue code to make creating an application possible (various builders and utility classes). .. image:: /images/gt-main.png -The gt-main module is responsible for: +The ``gt-main`` module is responsible for: -* Default implementation :doc:`gt-opengis <../opengis/index>` interfaces for Feature, FeatureType and Filter and Style +* Default implementation :doc:`gt-opengis <../opengis/index>` interfaces for ``Feature``, ``FeatureType``, ``Filter`` and ``Style`` * Default set of :doc:`gt-opengis <../opengis/filter>` Functions for working with spatial data -* Helper classes for your own application development such as *DataUtilities* and *SimpleFeatureTypeBuilder* -* Abstract classes to help implementors of :doc:`DataStore ` +* Helper classes for your own application development such as ``DataUtilities`` and ``SimpleFeatureTypeBuilder`` +* Abstract classes to help implementers of :doc:`DataStore ` **Maven**:: @@ -49,4 +49,4 @@ The gt-main module is responsible for: shape datastore repository - sld \ No newline at end of file + sld diff --git a/docs/user/library/main/internal.rst b/docs/user/library/main/internal.rst index 2d0b2efcd17..8759e55c701 100644 --- a/docs/user/library/main/internal.rst +++ b/docs/user/library/main/internal.rst @@ -1,180 +1,182 @@ Internals --------- -The gt-main class holds a number of internal and abstract classes useful to those implementing support for additional DataStore formats. -These classes should be moved to gt-main when time permits. +The ``gt-main`` class holds a number of internal and abstract classes useful to those implementing support for additional ``DataStore`` formats. +These classes should be moved to ``gt-main`` when time permits. -The gt-main module provides many well known classes covered in the public documentation: +The ``gt-main`` module provides many well known classes covered in the public documentation: -* DataAccessFinder -* DataStoreFinder -* FileDataStoreFinder -* DataUtilities -* DefaultRepository -* DefaultTransaction -* DefaultView +* ``DataAccessFinder`` +* ``DataStoreFinder`` +* ``FileDataStoreFinder`` +* ``DataUtilities`` +* ``DefaultRepository`` +* ``DefaultTransaction`` +* ``DefaultView`` A few public exceptions: -* FeatureLockException -* SchemaNotFoundException +* ``FeatureLockException`` +* ``SchemaNotFoundException`` + AbstractDataStore ^^^^^^^^^^^^^^^^^ -The **AbstractDataStore** is an old base class for DataStore implementations, currently used only by MemoryDataStore and PropertyDataStore (Old). All new stores use **ContentDataStore** instead. +The ``AbstractDataStore`` is an old base class for ``DataStore`` implementations, currently used only by ``MemoryDataStore`` and ``PropertyDataStore`` (Old). All new stores use ``ContentDataStore`` instead. .. image:: /images/AbstractDataStore.PNG -This class is helpful starting point, however we have taken the lessons learned and wrapped them up in ContentDataStore covered in the :doc:`gt-main <../data/internal>` documentation. +This class is helpful starting point, however we have taken the lessons learned and wrapped them up in ``ContentDataStore`` covered in the :doc:`gt-main <../data/internal>` documentation. The following classes are related: -* AbstractDataStore -* AbstractDataStoreFactory -* AbstractDataStoreTest -* AbstractFeatureSource -* AbstractFeatureStore -* AbstractFeatureLocking -* DefaultFeatureResults - the original name of FeatureCollection was FeatureResults!Simpl +* ``AbstractDataStore`` +* ``AbstractDataStoreFactory`` +* ``AbstractDataStoreTest`` +* ``AbstractFeatureSource`` +* ``AbstractFeatureStore`` +* ``AbstractFeatureLocking`` +* ``DefaultFeatureResults`` - the original name of ``FeatureCollection`` was ``FeatureResults`` DataStore ^^^^^^^^^ -There are a large number of DataStore helper classes in gt-main. +There are a large number of DataStore helper classes in ``gt-main``. * Default implementations: - * DefaultResourceInfo - * DefaultServiceInfo + * ``DefaultResourceInfo`` + * ``DefaultServiceInfo`` -* FileDataStore +* ``FileDataStore`` - * AbstractFileDataStore + * ``AbstractFileDataStore`` * Conformance test case: - * DataTestCase + * ``DataTestCase`` * Managers - These managers, with their supporting readers and writers are responsible for AbstractDataStore being able + These managers, with their supporting readers and writers are responsible for ``AbstractDataStore`` being able wrap transaction and locking support around you work. - * FeatureListenerManager - * InProcessLockingManager + * ``FeatureListenerManager`` + * ``InProcessLockingManager`` * Transaction Implementation - You can store a TransactionStateDiff in a Transaction, the DiffFeatureReader and DiffFeatureWriters will collect any changes for you + You can store a ``TransactionStateDiff`` in a Transaction, the ``DiffFeatureReader`` and ``DiffFeatureWriters`` will collect any changes for you in memory which you can review when the user calls commit. - * TransactionStateDiff - * Diff - * DiffFeatureReader - * DiffFeatureWriter + * ``TransactionStateDiff`` + * ``Diff`` + * ``DiffFeatureReader`` + * ``DiffFeatureWriter`` * Projection File - * PrjFileReader - * WorldFileReader - * WorldFileWriter - -FeatureCollection -''''''''''''''''' - -Lots of abstract and utility classes are available when working with FeatureCollection: - -* AbstractFeatureCollection. -* AbstractFeatureVisitor -* AdaptorFeatureCollection -* DecoratingFeatureCollection -* DecoratingSimpleFeatureCollection -* DelegateFeatureIterator -* DelegateSimpleFeatureIterator -* FilteringSimpleFeatureCollection -* MaxSimpleFeatureCollection -* SubFeatureCollection / FilteredIterator -* SubFeatureList - -Feature collections often form a pair with the iterator they use to make contents available: -* DataFeatureCollection / FeatureWriterIterator / FeatureReaderIterator -* EmptyFeatureCollection / EmptyIterator -* FilteringFeatureCollection / FilteringFeatureIterator -* MaxFeaturesFeatureCollection / MaxFeaturesIterator -* ReprojectingFeatureCollection / ReprojectingIterator -* ReTypingFeatureCollection / ReTypingIterator + * ``PrjFileReader`` + * ``WorldFileReader`` + * ``WorldFileWriter`` + +``FeatureCollection`` +''''''''''''''''''''' + +Lots of abstract and utility classes are available when working with ``FeatureCollection``: + +* ``AbstractFeatureCollection`` +* ``AbstractFeatureVisitor`` +* ``AdaptorFeatureCollection`` +* ``DecoratingFeatureCollection`` +* ``DecoratingSimpleFeatureCollection`` +* ``DelegateFeatureIterator`` +* ``DelegateSimpleFeatureIterator`` +* ``FilteringSimpleFeatureCollection`` +* ``MaxSimpleFeatureCollection`` +* ``SubFeatureCollection`` / ``FilteredIterator`` +* ``SubFeatureList`` + +``FeatureCollections`` often form a pair with the iterator they use to make contents available: +* ``DataFeatureCollection`` / ``FeatureWriterIterator`` / ``FeatureReaderIterator`` +* ``EmptyFeatureCollection`` / ``EmptyIterator`` +* ``FilteringFeatureCollection`` / ``FilteringFeatureIterator`` +* ``MaxFeaturesFeatureCollection`` / ``MaxFeaturesIterator`` +* ``ReprojectingFeatureCollection`` / ``ReprojectingIterator`` +* ``ReTypingFeatureCollection`` / ``ReTypingIterator`` + And the lower level iterator helpers: -* SimpleFeatureIteratorImpl - used by DefaultFeatureCollection to access all contents -* FeatureIteratorImpl -* NoContentIterator - used to throw an exception on next() -* FilteringIterator -* FeatureIteratorIterator -* FeatureReaderFeatureIterator -* FeatureWriterFeatureIterator - -FeatureReader -''''''''''''' - -Low-level implementation support for implementing FeatureReader. - -* DefaultFeatureReader -* DefaultFIDReader -* EmptyFeatureReader -* EmptyFeatureWriter - -These readers wrap around your simple FeatureReader and add additional functionality such as filtering: - -* DelegatingFeatureReader -* DelegatingFeatureWriter -* FIDFeatureReader -* FIDReader -* FilteringFeatureReader -* FilteringFeatureWriter -* MaxFeatureReader -* ReTypeFeatureReader -* ForceCoordinateSystemFeatureReader -* ForceCoordinateSystemFeatureResults -* ReprojectFeatureReader -* ReprojectFeatureResults +* ``SimpleFeatureIteratorImpl`` - used by ``DefaultFeatureCollection`` to access all contents +* ``FeatureIteratorImpl`` +* ``NoContentIterator`` - used to throw an exception on next() +* ``FilteringIterator`` +* ``FeatureIteratorIterator`` +* ``FeatureReaderFeatureIterator`` +* ``FeatureWriterFeatureIterator`` + +``FeatureReader`` +'''''''''''''''''' + +Low-level implementation support for implementing ``FeatureReader``. + +* ``DefaultFeatureReader`` +* ``DefaultFIDReader`` +* ``EmptyFeatureReader`` +* ``EmptyFeatureWriter`` + +These readers wrap around your simple ``FeatureReader`` and add additional functionality such as filtering: + +* ``DelegatingFeatureReader`` +* ``DelegatingFeatureWriter`` +* ``FIDFeatureReader`` +* ``FIDReader`` +* ``FilteringFeatureReader`` +* ``FilteringFeatureWriter`` +* ``MaxFeatureReader`` +* ``ReTypeFeatureReader`` +* ``ForceCoordinateSystemFeatureReader`` +* ``ForceCoordinateSystemFeatureResults`` +* ``ReprojectFeatureReader`` +* ``ReprojectFeatureResults`` A few even work on iterators: -* CollectionFeatureReader -* ForceCoordinateSystemIterator -* ReprojectFeatureIterator +* ``CollectionFeatureReader`` +* ``ForceCoordinateSystemIterator`` +* ``ReprojectFeatureIterator`` -Where general facilities are available we need SimpleFeature implementations: +Where general facilities are available we need ``SimpleFeature`` implementations: -* DelegateSimpleFeatureReader -* DelegatingSimpleFeatureWriter -* EmptySimpleFeatureReader -* FilteringSimpleFeatureReader +* ``DelegateSimpleFeatureReader`` +* ``DelegatingSimpleFeatureWriter`` +* ``EmptySimpleFeatureReader`` +* ``FilteringSimpleFeatureReader`` AttributeReader ''''''''''''''' Sub-zero: These are not used in practice they were intended to be used for attribute level operations; in practice everyone works directly with features. The only place where they are used is with the Shapefile implementation where they are used to "join" the attributes -from the shp and dbf files. +from the ``shp`` and ``dbf`` files. -* AbstractAttributeIO -* AttributeReader -* AttributeWriter -* JoiningAttributeReader -* JoiningAttributeWriter +* ``AbstractAttributeIO`` +* ``AttributeReader`` +* ``AttributeWriter`` +* ``JoiningAttributeReader`` +* ``JoiningAttributeWriter`` Wrappers '''''''' -Wrappers used by DataUtilities to morph to SimpleFeatureSource, SimpleFeatureCollection etc... +Wrappers used by ``DataUtilities`` to morph to ``SimpleFeatureSource``, ``SimpleFeatureCollection`` etc... -* SimpleFeatureCollectionBridge -* SimpleFeatureLockingBridge -* SimpleFeatureSourceBridge -* SimpleFeatureStoreBridge +* ``SimpleFeatureCollectionBridge`` +* ``SimpleFeatureLockingBridge`` +* ``SimpleFeatureSourceBridge`` +* ``SimpleFeatureStoreBridge`` Open Web Services ^^^^^^^^^^^^^^^^^ @@ -184,16 +186,16 @@ Some of the data structures used by open web services such as WMS and WFS are de XML ^^^ -Some of the SAX, DOM and Transform classes for handling are defined in gt-main. +Some of the SAX, DOM and Transform classes for handling are defined in ``gt-main``. -Their use for XML and GML handling will be covered in gt-xml. +Their use for XML and GML handling will be covered in ``gt-xml``. Style ^^^^^ -The gt-main interfaces for Style are a straight extension of the gt-opengis interfaces for mutability. This does come with a drawback; we need to ask you to be careful of thread safety. +The ``gt-main`` interfaces for ``Style`` are a straight extension of the ``gt-opengis`` interfaces for mutability. This does come with a drawback; we need to ask you to be careful of thread safety. Filter ^^^^^^ -The Filter classes in gt-main are deprecated; and have been so since GeoTools 2.3. We are having trouble removing all the existing test cases that depend on these old Filter definitions. \ No newline at end of file +The Filter classes in ``gt-main`` are deprecated; and have been so since GeoTools 2.3. We are having trouble removing all the existing test cases that depend on these old Filter definitions. diff --git a/docs/user/library/main/jts.rst b/docs/user/library/main/jts.rst index bb5dabe6811..0f3dd29aa34 100644 --- a/docs/user/library/main/jts.rst +++ b/docs/user/library/main/jts.rst @@ -19,16 +19,16 @@ There is a helper method allowing you to calculate the real-world distance betwe :start-after: // orthodromicDistance start :end-before: // orthodromicDistance end -Internally this method makes use of GeodeticCalculator which offers a more general purpose solution +Internally this method makes use of ``GeodeticCalculator`` which offers a more general purpose solution able to take the distance between any two points (even if they are provided in different -coordiante reference systems). +coordinate reference systems). Transform ^^^^^^^^^ -You can make use of *MathTransform** directly - it has methods for feeding **DirectPosition** instances in one at a time, transforming, and returning a modified **DirectPosition**. +You can make use of ``MathTransform`` directly - it has methods for feeding ``DirectPosition`` instances in one at a time, transforming, and returning a modified ``DirectPosition``. -The problem is our JTS Geometry instances are built out of **Coordinate** instances rather than using **DirectPosition**. +The problem is our JTS Geometry instances are built out of ``Coordinate`` instances rather than using ``DirectPosition``. The **JTS** utility class defines a helper method for this common activity:: @@ -49,7 +49,7 @@ As a quick example, you can make use of an affine transformation to perform simp Geometry rotatedPoint = JTS.transform(geometry, mathTransform); -The same approach works with a JTS Coordinate:: +The same approach works with a JTS ``Coordinate``:: // by default it can make a new Coordinate for the result Coordinate targetCoordinate = JTS.transform( coordinate, null, transform ); @@ -60,14 +60,14 @@ The same approach works with a JTS Coordinate:: // or modify a coordinate in place JTS.transform( coordinate, coordinate, transform ); -And also a JTS Envelope, although this case is a bit special in that you get a chance to specify how many points along the edge of the boundary are sampled. If you specify 5, five points along the top, bottom, left and right edges will be transformed - giving you a chance to better account for the curvature of the earth.: +And also a JTS ``Envelope``, although this case is a bit special in that you get a chance to specify how many points along the edge of the boundary are sampled. If you specify 5, five points along the top, bottom, left and right edges will be transformed - giving you a chance to better account for the curvature of the earth.: .. literalinclude:: /../src/main/java/org/geotools/api/APIExamples.java :language: java :start-after: // transformEnvelope start :end-before: // transformEnvelope end -Finally the common target of DefaultGeographicCRS.WGS84 is given its own method (to quickly +Finally the common target of ``DefaultGeographicCRS.WGS84`` is given its own method (to quickly transform to geographic bounds):: Envelope geographicBounds = JTS.toGeographic( envelope, dataCRS ); @@ -79,10 +79,10 @@ Finally there is a very fast method for performing a transform directly on an ar Convert ^^^^^^^ -There are a number of methods to help convert JTS Geometry to some of the ISO Geometry ideas used +There are a number of methods to help convert JTS ``Geometry`` to some of the ISO ``Geometry`` ideas used by the referencing module. -Quickly convert from a JTS Envelope to the ISO Geometry Envelope (with a provided CoordinateReferenceSystem):: +Quickly convert from a JTS ``Envelope`` to the ISO Geometry ``Envelope`` (with a provided ``CoordinateReferenceSystem``):: Envelope envelope = geometry.getEnvelopeInternal(); diff --git a/docs/user/library/main/parameter.rst b/docs/user/library/main/parameter.rst index f76e69dd2af..f6871080223 100644 --- a/docs/user/library/main/parameter.rst +++ b/docs/user/library/main/parameter.rst @@ -1,57 +1,57 @@ Parameter --------- -The connection parameters are described using the **Parameter** class. There is also a small -extension to this idea with the **DataAccessFactory.Param** class. The extension provided +The connection parameters are described using the ``Parameter`` class. There is also a small +extension to this idea with the ``DataAccessFactory.Param`` class. The extension provided for backwards compatibility, as the methods focus on data entry and has been superseded by the Converters class. .. image:: /images/param.PNG -The **Parameter** is used for: +The ``Parameter`` is used for: -* DataAccessFactory.getParameterInfo() +* ``DataAccessFactory.getParameterInfo()`` To describe the keys and values to put into your map. You can use this information to ask your end users the details about their data such as if they want an index created for their shapefile access. -* **ProcessFactory** in **gt-process** to describe the parameters to geospatial processes. -* **JDataStoreWizard** from **gt-swing** used to allow users to connect to data in our tutorials. +* ``ProcessFactory`` in ``gt-process`` to describe the parameters to geospatial processes. +* ``JDataStoreWizard`` from ``gt-swing`` used to allow users to connect to data in our tutorials. -In all these cases the Parameter are used to describe the contents of a Map. +In all these cases the Parameter are used to describe the contents of a ``Map``. The class itself is open ended, with only a few well defined restrictions advertised at this time. The following public fields are available: -* Parameter.key : String +* ``Parameter.key`` : ``String`` - Programmatic machine readable key or name used to store the value. Suitable for use in a java.util.Map of connection parameters. -* Parameter.type : Class + Programmatic machine readable key or name used to store the value. Suitable for use in a ``java.util.Map`` of connection parameters. +* ``Parameter.type`` : ``Class`` - Formal restriction on the type of the Java Object allowed as a value. May be used in conjunction with minOccurs and maxOccurs - when a List of values is allowed. -* Parameter.title : InternationalString -* Parameter.description : InternationalString + Formal restriction on the type of the Java Object allowed as a value. May be used in conjunction with ``minOccurs`` and ``maxOccurs`` + when a ``List`` of values is allowed. +* ``Parameter.title`` : ``InternationalString`` +* ``Parameter.description`` : ``InternationalString`` Human readable title and description for data entry prompting. -* Parameter.required : boolean -* Parameter.minOccurs : int -* Parameter.maxOccurs : int +* ``Parameter.required`` : ``boolean`` +* ``Parameter.minOccurs`` : ``int`` +* ``Parameter.maxOccurs`` : ``int`` Indication of if the value is required, or if more than one value is allowed and any restrictions on the resulting list. -* Parameter.sample : Object +* ``Parameter.sample`` : ``Object`` A sample, or default, value that can be shown to users as a starting point. -* Parameter.metadata : Map +* ``Parameter.metadata`` : ``Map`` - Here is where the Parameter description becomes open ended, as you can add your own restrictions and information + Here is where the ``Parameter`` description becomes open ended, as you can add your own restrictions and information to this "metadata" map. We have defined a series of well known keys (with javadocs): - * FEATURE_TYPE - when the parameter.type is a SimpleFeature, this key is used to record the expected FeatureType - * IS_PASSWORD + * ``FEATURE_TYPE`` - when the ``Parameter.type`` is a ``SimpleFeature``, this key is used to record the expected ``FeatureType`` + * ``IS_PASSWORD`` Example use:: @@ -61,30 +61,30 @@ The following public fields are available: // Or use the utility method field.setPassword( parameter.isPassword() ); - * LENGTH + * ``LENGTH`` - Example use: + Example use:: Integer length = parameter.metadata.get( Parameter.LENGTH ); field.setLength( length == null ? 40 : length ); - * CRS - when the parameter type is spatial (such as a Geometry or Feature) this records the expected CoordinateReferenceSystem - * ELEMENT - used to indicate the element type for a List - * MIN - min value for any comparable such as a Number, Date or String. Assumed to be the same Class as parameter.type. - * MAX - max value for any comparable such as a Number, Date or String. Assumed to be the same Class as parameter.type. - * EXT - extension used for selecting Files - * LEVEL - indicates if the parameter is suitable for a general "user", "advanced" user, or only applicable to a "program" (such as a JEE Session). + * ``CRS`` - when the parameter type is spatial (such as a ``Geometry`` or ``Feature``) this records the expected ``CoordinateReferenceSystem`` + * ``ELEMENT`` - used to indicate the element type for a ``List`` + * ``MIN`` - minimum value for any comparable such as a ``Number``, ``Date`` or ``String``. Assumed to be the same ``Class`` as ``Parameter.type``. + * ``MAX`` - maximum value for any comparable such as a ``Number``, ``Date`` or ``String``. Assumed to be the same ``Class`` as ``Parameter.type``. + * ``EXT`` - extension used for selecting Files + * ``LEVEL`` - indicates if the parameter is suitable for a general "user", "advanced" user, or only applicable to a "program" (such as a JEE Session). -A number of constructors are available. It is recommended that you use *KVP* when defining the metadata map (as it was created with this express purpose in mind). +A number of constructors are available. It is recommended that you use ``KVP`` when defining the metadata map (as it was created with this express purpose in mind). A couple of methods have been defined; to solidify how the metadata map above is used: -* Parameter.isPassword() - check if metadata.get( IS_PASSWORD ) is true -* Parameter.getLevel() - check if level is "user", "advanced" or "program" (defaulting to "user"). +* ``Parameter.isPassword()`` - check if ``metadata.get(IS_PASSWORD)`` is true +* ``Parameter.getLevel()`` - check if level is "user", "advanced" or "program" (defaulting to "user"). -The **Param** subclass only offers a few additional ideas: +The ``Param`` subclass only offers a few additional ideas: -* Param.lookUp(Map) +* ``Param.lookUp(Map)`` Used to safely look up a value in a map of connection parameters:: @@ -98,21 +98,21 @@ The **Param** subclass only offers a few additional ideas: port = PORT.sample; // default port for PostGIS } -* Param.text(Object) +* ``Param.text(Object)`` - Convert object to an appropriate String representation for display to a user. + Convert object to an appropriate ``String`` representation for display to a user. -* Param.parse(String) +* ``Param.parse(String)`` - Used to parse a user supplied String into the required Class indicated by Param.type. + Used to parse a user supplied String into the required Class indicated by ``Param.type``. -* Param.handle(String) +* ``Param.handle(String)`` - Convert a String to the required Class; with the extra ability to handle arrays of values:: + Convert a ``String`` to the required ``Class``; with the extra ability to handle arrays of values:: Param DASH = new Param( "dash", int[].class ); int[] arrary = (int[]) DASH.handle("1 2 3 4 5 6"); - Convert a String (provide by the user) to the required Class indicated by Param.type, handling - arrays using whitespace if required. + Convert a ``String`` (provide by the user) to the required ``Class`` indicated by ``Param.type``, handling + arrays using white space if required. diff --git a/docs/user/library/main/repository.rst b/docs/user/library/main/repository.rst index 8855eb9e08e..3d20d611158 100644 --- a/docs/user/library/main/repository.rst +++ b/docs/user/library/main/repository.rst @@ -1,7 +1,7 @@ Repository ---------- -Applications based on Geotools must keep track of the geographic data accessed by the application. It is important not to create and throw away DataStores at runtime; as they often contain JDBC connections or open file handles. +Applications based on GeoTools must keep track of the geographic data accessed by the application. It is important not to create and throw away ``DataStores`` at runtime; as they often contain JDBC connections or open file handles. If there is only one or are only a few sources of data, the application can easily keep track directly the data being handled. However, geographic information systems often handle large volumes of data and it can become complex to keep track of all the different sources of data. GeoTools has developed several approaches to track multiple sources of data but not all of these have matured to be fully functional. @@ -10,26 +10,26 @@ The critical issue is that the GeoTools DataStore class is design: * to be thread safe (so you can access data from multiple threads) * not be duplicated (so a single DataStore talks to a single server or file) -If you have two instances of PostGISDataStore both talking to the same database there is a +If you have two instances of ``PostGISDataStore`` both talking to the same database there is a chance for them to trip over each other - and BAD THINGS TO HAPPEN. A more extreme example -would be losing the contents of your Shapefile as to ShapefileDataStore attempt to update +would be losing the contents of your Shapefile as two ``ShapefileDataStore`` attempt to update it at the same time. -In the simplest approach, applications based on GeoTools keep track explicitly of the different DataStores which they are using and make sure they only connect to each source of data with one and only one DataStore class. They may choose to protect themselves from BAD THINGS by using the 'Singleton' design pattern. +In the simplest approach, applications based on GeoTools keep track explicitly of the different ``DataStores`` which they are using and make sure they only connect to each source of data with one and only one DataStore class. They may choose to protect themselves from BAD THINGS by using the 'Singleton' design pattern. -An alternative approach for applications using more than one or a few DataStores, is to create a map structure with 'singleton' code to both ensure this singleton access to the data and easily grab the right DataStore when it is needed. The Map relates some identifier for the data store (the ID) with the DataStore class accessing that resource. URLs are often used for the ID. +An alternative approach for applications using more than one or a few ``DataStores``, is to create a map structure with 'singleton' code to both ensure this singleton access to the data and easily grab the right DataStore when it is needed. The Map relates some identifier for the data store (the ID) with the DataStore class accessing that resource. URLs are often used for the ID. -This second approach is so common that GeoTools developed the **Repository** interface along with +This second approach is so common that GeoTools developed the ``Repository`` interface along with two implementations to handle this situation. A more sophisticated approach "Catalog" approached is used by GeoServer and uDig in order to track -large numbers of data sources (and lazily create DataStores as needed). +large numbers of data sources (and lazily create ``DataStores`` as needed). Singleton ^^^^^^^^^ -A simple application may track its use of DataStores on its own. Ideally, it will create a -singleton structure around each DataStore to ensure that it only accesses the DataStore once.:: +A simple application may track its use of ``DataStores`` on its own. Ideally, it will create a +singleton structure around each ``DataStore`` to ensure that it only accesses the ``DataStore`` once.:: class MyApp { public static DataStore store; @@ -69,13 +69,13 @@ When you start working with lots of data you end up storing the list of data sou Usually you make up the ID based on: -* the URL of your data (for files and webservices) -* the jdbc url if you are using a database +* the URL of your data (for files and web services) +* the JDBC URL if you are using a database Repository ^^^^^^^^^^ -The use of a Map like that describe above happens so often that we have a special GeoTools interface and two implementations which you can use - so GeoTools code can look up and make use of your applications data.:: +The use of a ``Map`` like that describe above happens so often that we have a special GeoTools interface and two implementations which you can use - so GeoTools code can look up and make use of your applications data.:: interface Repository { Map getDataStores(); @@ -87,19 +87,19 @@ The use of a Map like that describe above happens so often that we have a specia source source(String dataStoreId, String typeName ) } -In addition if you are working inside GeoServer or uDig they offer up access to their internal Catalog using this interface (so you can find DataStores as needed). +In addition if you are working inside GeoServer or uDig they offer up access to their internal ``Catalog`` using this interface (so you can find ``DataStores`` as needed). -To look up individual FeatureSources we use a "typeRef" - basically "dataStoreId:typeName". +To look up individual ``FeatureSources`` we use a ``typeRef`` - basically ``dataStoreId:typeName``. -This interface is used by the gt-validation module in order to look up information for integrity tests. -Often tests make use of several dataStores (in order to make sure roads are on land for example). +This interface is used by the ``gt-validation`` module in order to look up information for integrity tests. +Often tests make use of several ``DataStore`` (in order to make sure roads are on land for example). There are two implementations: -* DefaultRepository - quick implementation - works fine. -* FeatureSourceRepository - quick implementation used to organise FeatureSources +* ``DefaultRepository`` - quick implementation - works fine. +* ``FeatureSourceRepository`` - quick implementation used to organize ``FeatureSources`` -DefaultRepository Example:: +``DefaultRepository`` Example:: class MyApp { public static DefaultRepository data; @@ -117,16 +117,16 @@ DefaultRepository Example:: A couple additional features are available to assist in managing information. -* Registery.load( file ) +* ``Registery.load( file )`` - Load up a DataStores from individual property files. The property files should have the + Load up a ``DataStore`` from individual property files. The property files should have the information needed to connect to your DataStore implementation. - file1.properties:: + ``file1.properties``:: url=file:./myshape.shp - file2.properties:: + ``file2.properties``:: url=http://localhost/geoserver/wfs?SERVICE=WFS+REQUEST=GETCAPABILITIES+VERSION=1.0 @@ -134,18 +134,18 @@ A couple additional features are available to assist in managing information. Catalog ^^^^^^^ -Two major applications (GeoServer and uDig) both use the idea of a Catalog to store "database" -of all the data they are working with (both DataStores and GridCoverages) and then "connect" +Two major applications (GeoServer and uDig) both use the idea of a ``Catalog`` to store "database" +of all the data they are working with (both ``DataStore`` and ``GridCoverage``) and then "connect" to the data only when needed. You may have thousands of entries in your catalog (all the GIS data on your computer?) and only be using 10 of them for your current map. This is the "lazy access" for which catalog was created. -The other Catalog offers is the ability to manage WebMapServer, DataStores and Rasters in a similar -manner (rather than just DataStores). +The other ``Catalog`` offers is the ability to manage ``WebMapServer``, ``DataStores`` and ``Rasters`` in a similar +manner (rather than just a collection of ``DataStore``). -Both GeoServer and and uDig offer some form of Catalog API. Here is an example of using the uDig catalog:: +Both GeoServer and uDig offer some form of Catalog API. Here is an example of using the uDig catalog:: Catalog catalog = new DefaultCatalog(); ServiceFinder finder = new DefaultServiceFactory( catalog ); diff --git a/docs/user/library/main/shape.rst b/docs/user/library/main/shape.rst index f46f01da14b..9e8e0404f35 100644 --- a/docs/user/library/main/shape.rst +++ b/docs/user/library/main/shape.rst @@ -3,14 +3,14 @@ Java2D Shape GeoTools includes a couple of classes for generating a Java 2D Shape from a JTS Geometry. -The examples shown here are taken from LiteShapeTest. +The examples shown here are taken from ``LiteShapeTest``. -You can use LiteShape to quickly make a Java2D shape to display on the screen:: +You can use ``LiteShape`` to quickly make a Java2D shape to display on the screen:: AffineTransform affineTransform = new AffineTransform(); LiteShape lineShape = new LiteShape(lineString, affineTransform, false); -You can also ask for the shape to be simplified; by default is to generalise to a single pixel.:: +You can also ask for the shape to be simplified; by default is to generalize to a single pixel.:: LiteShape lineShape = new LiteShape(lineString, affineTransform, true); @@ -22,7 +22,7 @@ If you are using anti-aliasing you may want to drop that down to half a pixel.:: Drawing ^^^^^^^ -The code makes use of an AffineTransform allowing you to scale and rotate the geometry into the correct position on the screen. You may consider starting with graphics2d.getTransform() representing your image coordinates and work from there.:: +The code makes use of an ``AffineTransform`` allowing you to scale and rotate the geometry into the correct position on the screen. You may consider starting with ``graphics2d.getTransform()`` representing your image coordinates and work from there.:: public void draw( Graphics2d g2, Geometry geom ){ AffineTransform transform = g2.getTransform(); // returns a copy @@ -35,10 +35,10 @@ The code makes use of an AffineTransform allowing you to scale and rotate the ge LiteShape2 ^^^^^^^^^^ -LiteShape2 is similar in function, but makes use of MathTransform (and thus can be used to handle +``LiteShape2`` is similar in function, but makes use of ``MathTransform`` (and thus can be used to handle the case where you using reprojection to manipulate your geometry priory to display). -This class also makes use of a Decimator class to control how generalisation occurs.:: +This class also makes use of a ``Decimator`` class to control how generalization occurs.:: Decimator decimator = new Decimator(screen2world, paintArea ); LiteShape2 lineShape = new LiteShape2(lineString, world2screen, decimator, false); diff --git a/docs/user/library/main/sld.rst b/docs/user/library/main/sld.rst index 8bec9e53a2b..f946b0bec54 100644 --- a/docs/user/library/main/sld.rst +++ b/docs/user/library/main/sld.rst @@ -1,7 +1,7 @@ Style Layer Descriptor ---------------------- -The **gt-main** module provides interfaces for the style layer descriptor data structure and +The ``gt-main`` module provides interfaces for the style layer descriptor data structure and offers GeoTools specific extensions to the symbology encoding data structure. References: @@ -15,7 +15,7 @@ References: Style Layer Descriptor ^^^^^^^^^^^^^^^^^^^^^^ -The StyleLayerDescriptor concept comes to us from the SLD specification. It is aimed at defining how a +The ``StyleLayerDescriptor`` concept comes to us from the SLD specification. It is aimed at defining how a web map server can draw an entire map (with all the layers included in one gulp.) @@ -24,18 +24,18 @@ web map server can draw an entire map (with all the layers included in one gulp. Since many of the elements referenced above assume we are operating inside a WMS this class is not used frequently during day to day use. -That said if you are letting a user manage styles you will want to let them provide names and titles and general organise what is going on. +That said if you are letting a user manage styles you will want to let them provide names and titles and general organize what is going on. -Styling for a Map is captured with three initial classes: +Styling for a map is captured with three initial classes: -* StyledLayerDescriptor representing the styling information for an entire Map -* NamedLayer defines FeatureTypeConstraints to test if the style is applicable to your data, and a list of Style -* Style defines how features or Rasters are to be drawn +* ``StyledLayerDescriptor`` representing the styling information for an entire map +* ``NamedLayer`` defines ``FeatureTypeConstraints`` to test if the style is applicable to your data, and a list of ``Style`` +* ``Style`` defines how ``features`` or ``Rasters`` are to be drawn Symbology Encoding ^^^^^^^^^^^^^^^^^^ -This implementation differs slightly in its approach presented in **gt-opengis** in that the objects are mutable and can be modified +This implementation differs slightly in its approach presented in ``gt-opengis`` in that the objects are mutable and can be modified after construction. This section also introduces some of the interesting GeoTools specific extensions that have been created. @@ -43,14 +43,14 @@ This section also introduces some of the interesting GeoTools specific extension .. image:: /images/rule.PNG -In the above example of **Rule** you can see the following differences: +In the above example of ``Rule`` you can see the following differences: -* Rule.isElseFilter() -* Rule.setElseFilter() +* ``Rule.isElseFilter()`` +* ``Rule.setElseFilter()`` Both getters and setters are now provided. -* Rule.symbolizers() provides direct access to a List +* ``Rule.symbolizers()`` provides direct access to a ``List`` You can modify the list of symbolizers directly:: @@ -58,14 +58,14 @@ In the above example of **Rule** you can see the following differences: rule.symbolizers().add( pointSymbolizer ); This style of programming is available when working with symbology encoding data structures -such as Rule. +such as ``Rule``. Symbolizer '''''''''' .. image:: /images/symbolizer2.PNG -GeoTools extends the concept of Symbolizer allowing the geometry to be defined using a general Expression (rather than just a PropertyName references). This facility allows a geometry to be defined using a Function expression giving users an opportunity to preprocess the geometry. +GeoTools extends the concept of ``Symbolizer`` allowing the geometry to be defined using a general ``Expression`` (rather than just a ``PropertyName`` references). This facility allows a geometry to be defined using a ``Function`` expression giving users an opportunity to pre-process the geometry. TextSymbolizer '''''''''''''' @@ -73,23 +73,23 @@ TextSymbolizer .. image:: /images/textSymbolizer.PNG -GeoTools extends the concept of a TextSymbolizer allowing: +GeoTools extends the concept of a ``TextSymbolizer`` allowing: -* TextSymbolizer.getPriority() +* ``TextSymbolizer.getPriority()`` Priority used to determine precedence when labels collisions occur during rendering. The label with the highest priority "wins" with the others being moved out of the way (within a tolerance) or just not displayed. -* TextSymbolizer.getOption(String) +* ``TextSymbolizer.getOption(String)`` Additional vendor specific options used to control the rendering process. -* TextSymbolizer2.getGraphic() +* ``TextSymbolizer2.getGraphic()`` - Graphic to display behind the text label\ -* TextSymbolizer2.getSnippet() + Graphic to display behind the text label +* ``TextSymbolizer2.getSnippet()`` Used by text renderers such as KML and RSS to specify a snippet of text. -* TextSymbolizer2.getFeatureDescription() +* ``TextSymbolizer2.getFeatureDescription()`` Used by formats like KML or RSS to supply info on a feature. @@ -97,13 +97,13 @@ GeoTools extends the concept of a TextSymbolizer allowing: SLD Utility Class ^^^^^^^^^^^^^^^^^ -The SLD utility class is used to perform common operations on Style objects. This is the class you can used when you "just" want to hack away at an existing Style object. +The SLD utility class is used to perform common operations on ``Style`` objects. This is the class you can used when you "just" want to hack away at an existing ``Style`` object. This utility class originated as part of the uDig application. * Changing the Colors - Utility methods exits to change the "first" symbolizer found in the Style:: + Utility methods exits to change the "first" symbolizer found in the ``Style``:: SLD.setLineColour(style, Color.BLUE ); SLD.setPolyColour(style, Color.RED ); @@ -113,7 +113,7 @@ This utility class originated as part of the uDig application. SLD.setLineColour( lineSymbolizer, Color.BLUE ); SLD.setPolyColour( polygonSymbolizer, Color.RED ); - You can combine this approach with a StyleVisitor to edit the colors for specific rules:: + You can combine this approach with a ``StyleVisitor`` to edit the colors for specific rules:: DuplicatingStyleVisitor repaint = new DuplicatingStyleVisitor(){ boolean flag=false; diff --git a/docs/user/library/metadata/convert.rst b/docs/user/library/metadata/convert.rst index 92442158a9d..9581d8bc990 100644 --- a/docs/user/library/metadata/convert.rst +++ b/docs/user/library/metadata/convert.rst @@ -1,11 +1,11 @@ Converter --------- -The **Converter** API is a way to convert a value of one type into a value of another type. The difference is that we supply a plugins so you can teach the system how to perform additional conversions over time. +The ``Converter`` API is a way to convert a value of one type into a value of another type. The difference is that we supply a plugins so you can teach the system how to perform additional conversions over time. * The most common case of this is to parse a string into another type of value. -The Converter interface looks like this:: +The ``Converter`` interface looks like this:: public interface Converter { Object convert( Object source, Class target ) throws Exception; @@ -13,23 +13,23 @@ The Converter interface looks like this:: When you implement this you can either: -* Handle it correctly (returning an object of the target class +* Handle it correctly (returning an object of the target class)`` * Return null (if you could not handle it correctly) * Throw an exception (if you could not handle it correctly) -Converter for Enum -^^^^^^^^^^^^^^^^^^ +Converter for ``Enum`` +^^^^^^^^^^^^^^^^^^^^^^^ -Lets look at a real world example coming to us from the land of Java 5. Java 5 features a new type of construct called Enum. This is not something GeoTools can usually deal with as a Java 1.4 project - but by supplying a converter you can teach GeoTools to get along with your Java 5 application. +Lets look at a real world example coming to us from the land of Java 5. Java 5 features a new type of construct called ``Enum``. This is not something GeoTools can usually deal with as a Java 1.4 project - but by supplying a converter you can teach GeoTools to get along with your Java 5 application. -Example enum:: +Example ``Enum``:: public enum Choice { THIS, THAT; } -Example enum converter:: +Example ``Enum`` converter:: class Choice2TextConverter { Object convert( Object source, Class target ){ @@ -40,7 +40,7 @@ Example enum converter:: In general the freedom to return null or throw an exception lets you program converters very quickly. -A common case that we see in many places in GeoTools is parsing a string into the type defined by an AttributeType. +A common case that we see in many places in GeoTools is parsing a string into the type defined by an ``AttributeType``. GeoTools 2.3 code (before converters were around):: @@ -50,7 +50,7 @@ GeoTools 2.3 code (before converters were around):: Integer integer = (Integer) intType.parse( string ); -Using the Converters utility class this becomes:: +Using the ``Converters`` utility class this becomes:: FeatureType featureType = .... ; AttributeType intType = featureType.getAttributeType( "intProperty" ); @@ -58,7 +58,7 @@ Using the Converters utility class this becomes:: Integer integer = Converters.convert( string, intType.getType() ); -The Converters are the technology behind our great support for the Filter API Expression:: +The ``Converters`` are the technology behind our great support for the Filter API Expression:: Expression expr = ff.literal("#FF0000") - Color color = expr.evaualte( null, Color.class ); \ No newline at end of file + Color color = expr.evaualte( null, Color.class ); diff --git a/docs/user/library/metadata/faq.rst b/docs/user/library/metadata/faq.rst index 09fdb9c4351..f34252cdd11 100644 --- a/docs/user/library/metadata/faq.rst +++ b/docs/user/library/metadata/faq.rst @@ -33,11 +33,12 @@ Because metadata is the "lowest" implementation jar in our software stack; neede everyone else. These classes really are not interesting enough to separate out into their own module. -Q: Why does gt-metadata contain all this factory stuff? -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Q: Why does ``gt-metadata`` contain all this factory stuff? +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The gt-metadata module introduces some of the "glue code" needed used to hook up GeoTools to services -provided by your project. You will find pages here covering logging and JNDI integration. +The ``gt-metadata`` module introduces some of the "glue code" needed +used to hook up GeoTools to services provided by your project. You will +find pages here covering logging and JNDI integration. -For a more detailed discussion of how to integrate GeoTools into your application please -review the advanced section on integration. \ No newline at end of file +For a more detailed discussion of how to integrate GeoTools into your +application please review the advanced section on integration. diff --git a/docs/user/library/metadata/geotools.rst b/docs/user/library/metadata/geotools.rst index 82f5bf16568..f6ebdc2f86b 100644 --- a/docs/user/library/metadata/geotools.rst +++ b/docs/user/library/metadata/geotools.rst @@ -1,35 +1,35 @@ -GeoTools --------- +``GeoTools`` +------------ -The first utility class we have is helpfully called GeoTools. This class is used to configure the library for your application. +The first utility class we have is helpfully called ``GeoTools``. This class is used to configure the library for your application. It also provides the version number of the library, in case you want to check at runtime.:: GeoTools.getVersion(); // Example 15.0 -Hints -^^^^^ +``Hints`` +^^^^^^^^^ -Hints are used to configure the GeoTools library for use in your application. The value provided by GeoTools.getDefaultHints() can be configured as part of your application startup: +``Hints`` are used to configure the GeoTools library for use in your application. The value provided by ``GeoTools.getDefaultHints()`` can be configured as part of your application startup: .. code-block:: java Hints.putSystemDefault(Hints.ENTITY_RESOLVER, NullEntityResolver.INSTANCE); Hints.removeSystemDefault(Hints.ENTITY_RESOLVER); -GeoTools Hints are similar to a Map, the GeoTools.Key instances each provide javadocs, and some control over the values that may be used. For example the Hints.ENTITY_RESOLVER values must be an instance of EntityResolver. +GeoTools ``Hints`` are similar to a ``Map``, the ``GeoTools.Key`` instances each provide javadocs, and some control over the values that may be used. For example the ``Hints.ENTITY_RESOLVER`` values must be an instance of ``EntityResolver``. -By contrast java system properties are similar to a Map and may be specified programmatically or on the command line. The following bindings to system properties are defined (each as static constants in the GeoTools class): +By contrast Java system properties are similar to a ``Map`` and may be specified programmatically or on the command line. The following bindings to system properties are defined (each as static constants in the ``GeoTools`` class): + +===================================== =============================================== +``CRS_AUTHORITY_EXTRA_DIRECTORY`` ``org.geotools.referencing.crs-directory`` +``EPSG_DATA_SOURCE`` ``org.geotools.referencing.epsg-datasource`` +``FORCE_LONGITUDE_FIRST_AXIS_ORDER`` ``org.geotools.referencing.forceXY`` +``LOCAL_DATE_TIME_HANDLING`` ``org.geotools.localDateTimeHandling`` +``RESAMPLE_TOLERANCE`` ``org.geotools.referencing.resampleTolerance`` +``ENTITY_RESOLVER`` ``org.xml.sax.EntityResolver`` +===================================== =============================================== -================================= =============================================== -CRS_AUTHORITY_EXTRA_DIRECTORY org.geotools.referencing.crs-directory -EPSG_DATA_SOURCE org.geotools.referencing.epsg-datasource -FORCE_LONGITUDE_FIRST_AXIS_ORDER org.geotools.referencing.forceXY -LOCAL_DATE_TIME_HANDLING org.geotools.localDateTimeHandling -DATE_TIME_FORMAT_HANDLING org.geotools.dateTimeFormatHandling -RESAMPLE_TOLERANCE org.geotools.referencing.resampleTolerance -ENTITY_RESOLVER org.xml.sax.EntityResolver -================================= =============================================== The bound system properties can also be used to configure Hints: @@ -42,13 +42,13 @@ The bound system properties can also be used to configure Hints: Plug-ins ^^^^^^^^ -Increasingly GeoTools is being used in carefully managed plug-in systems such as Eclipse or Spring. In oder to allow GeoTools to locate its own plug-ins you may need to configure the GeoTools class with additional class loaders provided by your environment.:: +Increasingly GeoTools is being used in carefully managed plug-in systems such as Eclipse or Spring. In order to allow GeoTools to locate its own plug-ins you may need to configure the ``GeoTools`` class with additional class loaders provided by your environment.:: GeoTools.addClassloader( loader ); -Out of the box GeoTools searches on the CLASSPATH available, in order to find plug-in and wire them into the library. It does this by looking in the JARs META-INF/services folder which lists plug-in classes. +Out of the box GeoTools searches on the ``CLASSPATH`` available, in order to find plug-in and wire them into the library. It does this by looking in the jar's ``META-INF/services`` folder which lists plug-in classes. -In rare cases, such as OSGi plug-in system, adding additional jars to the CLASSPATH is not enough. OSGi blocks access to the META-INF/services folder. In these cases you will need to provide access to the classes yourself.:: +In rare cases, such as OSGi plug-in system, adding additional jars to the ``CLASSPATH`` is not enough. OSGi blocks access to the ``META-INF/services`` folder. In these cases you will need to provide access to the classes yourself.:: GeoTools.addFactoryIteratorProvider( provider ); @@ -59,29 +59,29 @@ If you are working in a Java Enterprise Edition environment, and would like to c GeoTools.init( applicationContext ); // JNDI configuration -GeoTools uses names of the format "jdbc:EPSG" internally these are adapted for use with your applicationContext using the GeoTools fixName methods:: +GeoTools uses names of the format ``jdbc:EPSG`` internally these are adapted for use with your ``applicationContext`` using the ``GeoTools.fixName`` method:: String name = GeoTools.fixName("jdbc.EPSG"); XML ^^^ -When embedding GeoTools in your own application you may wish to configure the library to use a specific EntityResolver (to access any XML Schema files included in your application, or to restrict access based on security policies). +When embedding GeoTools in your own application you may wish to configure the library to use a specific ``EntityResolver`` (to access any XML Schema files included in your application, or to restrict access based on security policies). -GeoTools uses a range of XML technologies when implementing both format and protocol support - where possible these are configured based on the Hints.ENTITY_RESOLVER described above. +GeoTools uses a range of XML technologies when implementing both format and protocol support - where possible these are configured based on the ``Hints.ENTITY_RESOLVER`` described above. -To access the configured ENTITY_RESOLVER: +To access the configured ``ENTITY_RESOLVER``: .. code-block:: java parser.setEntityResolver( GeoTools.getEntityResolver(hints) ); -GeoTools also includes two EntityResolver implementations: +GeoTools also includes two ``EntityResolver`` implementations: -* PreventLocalEntityResolver: For use when working with external XML documents, only allows DTD and XML Schema references to remote resources -* NullEntityResolver: Placeholder allowing the default SAXParser access-anything behaviour. +* ``PreventLocalEntityResolver``: For use when working with external XML documents, only allows DTD and XML Schema references to remote resources +* ``NullEntityResolver``: Placeholder allowing the default ``SAXParser`` access-anything behavior. -The library uses PreventLocalEntityResolver by default, if you wish to work with a local XML file (referencing local DTD and XMLSchema) please use the following during application setup: +The library uses ``PreventLocalEntityResolver`` by default, if you wish to work with a local XML file (referencing local DTD and XMLSchema) please use the following during application setup: .. code-block:: java @@ -96,8 +96,8 @@ If you are working in your own application, you can teach GeoTools to use your a GeoTools provides out of the box implementations for: -* CommonsLoggerFactory - Apache's Common Logging framework -* Log4jLoggerFactory - Log4J +* ``CommonsLoggerFactory`` - Apache's Common Logging framework +* ``Log4jLoggerFactory`` - Log4J Here are a couple of examples of setting things up: @@ -121,7 +121,7 @@ Here are a couple of examples of setting things up: } } - In the above code **ClassNotFoundException** is a checked + In the above code ``ClassNotFoundException`` is a checked exception thrown if Commons-Logging or Log4J is not available on the CLASSPATH, so GeoTools continue to rely on the Java logging system instead. @@ -133,18 +133,18 @@ Here are a couple of examples of setting things up: GeoTools.setLoggerFactory(Log4JLoggerFactory.getInstance()); - Be warned that if Log4j is not available this method call has - unpredictable behaviour. + Be warned that if Log4J is not available this method call has + unpredictable behavior. - It will typically throws a NoClassDefFoundError (the unchecked + It will typically throws a ``NoClassDefFoundError`` (the unchecked error, not the checked exception) at some future point. The - error may not be thrown at the moment setLoggerFactory is + error may not be thrown at the moment ``setLoggerFactory`` is invoked, but rather be delayed until a message is first logged, which may surprise the user. * Custom - You can create your own LoggerFactory if you need to track + You can create your own ``LoggerFactory`` if you need to track messages using your own facilities. This is a good approach if you are making use of Eclipse @@ -153,11 +153,11 @@ Here are a couple of examples of setting things up: JAI ^^^ -GeoTools Logging will listen to **JAI** errors and log them appropriately. It does this by first checking if your application has registered an ImagingListener, and if not it will register a *LoggingImagingListener* to redirect JAI warnings. Common **JAI** errors (such as "Continuing in pure Java mode") are logged as Level.TRACE messages, all other errors are logged as Level.INFO. +GeoTools Logging will listen to ``JAI`` errors and log them appropriately. It does this by first checking if your application has registered an ``ImagingListener``, and if not it will register a ``LoggingImagingListener`` to redirect JAI warnings. Common ``JAI`` errors (such as "Continuing in pure Java mode") are logged as ``Level.TRACE`` messages, all other errors are logged as ``Level.INFO``. If you would like to check this bootstrapping process use the system property `-DLOGGING_TRACE=true`. -To completely filter JAI messages from your application set `javax.media.jai` group to Level.WARNING:: +To completely filter JAI messages from your application set `javax.media.jai` group to ``Level.WARNING``:: Logging.getLogger("javax.media.jai").setLevel(Level.WARNING); diff --git a/docs/user/library/metadata/internal/cache.rst b/docs/user/library/metadata/internal/cache.rst index 67765dd43a5..5ef3cecd012 100644 --- a/docs/user/library/metadata/internal/cache.rst +++ b/docs/user/library/metadata/internal/cache.rst @@ -1,5 +1,5 @@ -ObjectCache ------------ +``ObjectCache`` +--------------- There is a utility class available for your caching needs:: @@ -34,48 +34,48 @@ You can use this interface to safely work with a cache from multiple threads:: cache.writeUnLock(); } -As you can see the peek method is used to sample the cache from within an already established writeLock. Please make use of try / finally to ensure any acquired writeLock is released. +As you can see the peek method is used to sample the cache from within an already established ``writeLock``. Please make use of ``try`` / ``finally`` to ensure any acquired ``writeLock`` is released. -The javadocs has additional examples of how to use this class safely. +The javadocs have additional examples of how to use this class safely. -* Comparison with JSR 107 +* Comparison with JSR-107 Java Specification Request 107 has been tabled in order to define an object cache . We have made our implementation method - compatible in the event JSR 107 is accepted. + compatible in the event JSR-107 is accepted. * Comparison with Commons Pool You may of noticed that GeoTools makes use of the commons pool as a dependency - and that project is well known for offering a - bang up implementation of ObjectPool. So your first question + bang up implementation of ``ObjectPool``. So your first question should very well be - why the heck does GeoTools have an - ObjectCache of its very own. + ``ObjectCache`` of its very own. Well the truth is that we actually need a cache (rather than a - pool) and we need it to be threadsafe. You can configure an - KeyedObjectPool to behave like a cache (by asking it to use weak + pool) and we need it to be thread safe. You can configure an + ``KeyedObjectPool`` to behave like a cache (by asking it to use weak references) - but truth is commons pool wants to manage a pool of instances so can return one right away for performance reasons. Since we are worried about stressing memory (rather than only - performance) our ObjectCache is set up have "per entry" + performance) our ``ObjectCache`` is set up have "per entry" read/write locks. We are using it to manage immutable objects so we do not mind returning the same value again and again. -The following classes are current implementations of the ObjectCache: +The following classes are current implementations of the ``ObjectCache``: -* NullObjectCache +* ``NullObjectCache`` This does nothing and stores nothing. It is similar to a - NullProgressMonitor. + ``NullProgressMonitor``. Policy: none -* DefaultObjectCache +* ``DefaultObjectCache`` - The cache uses a HashMap for storing values. All values are + The cache uses a ``HashMap`` for storing values. All values are stored in the map and not removed unless explicitly removed by the programmer. @@ -84,22 +84,22 @@ The following classes are current implementations of the ObjectCache: Note: That with the default object cache a call to get(key) will add an entry to the map if the key does not exist. -* FixedSizeObjectCache +* ``FixedSizeObjectCache`` - Values are held in a WeakValueHashSet, the garbage collector may - reclaim them at any time. After the LIMIT is reached additional + Values are held in a ``WeakValueHashSet``, the garbage collector may + reclaim them at any time. After the ``LIMIT`` is reached additional values are ignored by the cache. So it is possible to put something in the cache then ask for it later and have it be null. Policy: fixed -* WeakObjectCache +* ``WeakObjectCache`` - Values are held in a WeakReference, the garbage collector may + Values are held in a ``WeakReference``, the garbage collector may reclaim them at any time. Similar to the previous one, it is possible to put something in the cache then ask for it later and have it be null. It is possible to specify an initial size for - the hashmap. + the ``HashMap``. Policy: weak diff --git a/docs/user/library/metadata/internal/collections.rst b/docs/user/library/metadata/internal/collections.rst index 9f5d39368af..301d5c339da 100644 --- a/docs/user/library/metadata/internal/collections.rst +++ b/docs/user/library/metadata/internal/collections.rst @@ -1,21 +1,21 @@ Collections ----------- -GeoTools makes heavy use of Java collections. Given the age of the project you will find some of the older interfaces still make use of arrays. For the most part we have made the same information available as an array (for older code) and a Java collection for ease of use. +GeoTools makes heavy use of Java ``Collections``. Given the age of the project you will find some of the older interfaces still make use of arrays. For the most part we have made the same information available as an array (for older code) and a Java ``Collection`` for ease of use. We do have a number of custom collections, or collections provided by third party libraries that are worth special mention. -* FeatureCollection +* ``FeatureCollection`` - You are also warned that **FeatureCollection** is no long a - Java collection (as we could not support the "for each" loop + You are also warned that ``FeatureCollection`` is no long a + Java ``Collection`` (as we could not support the "for each" loop construct due to the requirement to call iterator.close() ). -* CanocialSet +* ``CanocialSet`` Can be used to create an internal pool of objects so a factory does not hand out duplicates. This works in a manner similar to - the String.intern() method and is useful for optimising memory + the ``String.intern()`` method and is useful for optimizing memory use. Here is an example:: @@ -30,26 +30,26 @@ We do have a number of custom collections, or collections provided by third part } } - At a technical level this class is an AbstractSet in which the entries are weak references. This means that CanonicalSet will not + At a technical level this class is an ``AbstractSet`` in which the entries are weak references. This means that ``CanonicalSet`` will not hold onto created objects when they are no longer in active use by your application. - Please note this is not a "cache" as the intended use is different. We are optimising for memory use here rather than speed. + Please note this is not a "cache" as the intended use is different. We are optimizing for memory use here rather than speed. -* DisjointSet +* ``DisjointSet`` Two disjoint sets will keep each other in sync (as content is added to one set it will be removed from the other and vice versa) -* DerivedSet +* ``DerivedSet`` Abstract class for when you want to make a sub set -* DerivedMap +* ``DerivedMap`` Abstract class for when you want to make a sub map -* Singleton - Deprecated +* ``Singleton`` - **Deprecated** Remember GeoTools being slightly ahead of its time? This is an example of a collection in which a ready alternative is now @@ -63,62 +63,62 @@ We do have a number of custom collections, or collections provided by third part We had expected Java 5 to provided checked collections, but instead the collections were limited to some creative compile time checking. The only downside to this is if you pass a - List around there is a chance it could end up in - the wrong spot and cause ClassCastExceptions. + ``List`` around there is a chance it could end up in + the wrong spot and cause ``ClassCastExceptions``. The following collections ask you to indicate the element type during creation - and will check that new elements are of the required type as you add them to the collection. - * CheckedArrayList - * CheckedCollection - * CheckedHashMap - * CheckedHashSet + * ``CheckedArrayList`` + * ``CheckedCollection`` + * ``CheckedHashMap`` + * ``CheckedHashSet`` Check the version of Java you are using to see if a replacement for these classes are available. When GeoTools upgrades we will cleanly extend a built-in Java implementation to preserve compatibility. -* WeakReference Collections +* ``WeakReference`` Collections The following collection implementations make use of weak reference allowing the contents to "evaporate" when not in use: - * WeakHashSet - * WeakValueHashMap + * ``WeakHashSet`` + * ``WeakValueHashMap`` The following implementation makes use of a mix of strong and weak references in order to operate as an effective cache: - * SoftValueHashMap + * ``SoftValueHashMap`` Note: You may also wish to in the commons-pool library which - offer similar functionality when using an **ObjectPool** with + offer similar functionality when using an ``ObjectPool`` with weak references. - A key difference between many of the uses of WeakReference you + A key difference between many of the uses of ``WeakReference`` you will find on the web and these classes implemented in GeoTools if how aggressive we have had to be in order to manage memory. While many applications are content to let the garbage collector get around to cleaning up memory. GeoTools has had to introduce a background thread in order to keep memory size in check when - working with large datasets. + working with large data sets. -* KeySortedList +* ``KeySortedList`` As advertised a list where you can specify the order using a look aside index providing the order. -* IntegerList +* ``IntegerList`` Integer list that adjust how much memory is used to store the values depending on what your expected maximum value is. The contents are packed into the minimum number of bits needed. -* KVP +* ``KVP`` Used for quick "key value pair" maps, where they keys are Strings and the values can be any object. @@ -136,11 +136,11 @@ The use of this background thread is not at first obvious - it is used internall The question is of course why a high priority thread? -First some background - our collection classes do not directly use WeakReference - instead they work with a subclass in which the clean method has been overridden to: +First some background - our collection classes do not directly use ``WeakReference`` - instead they work with a subclass in which the clean method has been overridden to: -* throw away the value (ie normal behaviour) +* throw away the value (i.e. normal behavior) * remove itself from the collection -WeakCollectionCleaner is a fast thread that spends most of its time asleep (so your application can do its work), when it does wake up we want it to be a high priority so it can get in there and recover memory .. so your application is not starved for resources. +``WeakCollectionCleaner`` is a fast thread that spends most of its time asleep (so your application can do its work), when it does wake up we want it to be a high priority so it can get in there and recover memory, so your application is not starved for resources. This is an example of real world use not being very obvious. The real work of your application is often best handled in a low priority thread, with system management work like this happening quickly in a high priority thread. diff --git a/docs/user/library/metadata/internal/utilities.rst b/docs/user/library/metadata/internal/utilities.rst index e289b0c3e12..0fe194f17b8 100644 --- a/docs/user/library/metadata/internal/utilities.rst +++ b/docs/user/library/metadata/internal/utilities.rst @@ -3,7 +3,7 @@ Utilities The Utilities class is interesting, in that it contains helper methods used when implementing basic Java functionality such -as equals or hashcode. +as ``equals`` or ``hashcode``. * It is fairly annoying to compare if two objects are equal, when either of the objects could be null. * It is also annoying to sort out how to compare or print an array diff --git a/docs/user/library/metadata/metadata.rst b/docs/user/library/metadata/metadata.rst index e5af6c59a43..6199c965824 100644 --- a/docs/user/library/metadata/metadata.rst +++ b/docs/user/library/metadata/metadata.rst @@ -1,7 +1,7 @@ Metadata -------- -The MetaData interfaces can be used as straight up Java Beans, with properties and so on. +The ``MetaData`` interfaces can be used as straight up Java Beans, with properties and so on. Simple Properties:: @@ -20,15 +20,15 @@ Use in this manner is straightforward. Predefined Metadata ^^^^^^^^^^^^^^^^^^^ -The GeoTools library provides predefined constants for the usual suspects, using Citation as an example the usual suspects are among others: +The GeoTools library provides predefined constants for the usual suspects, using ``Citation`` as an example the usual suspects are among others: * EPSG * OGC * Oracle -All of these organisations have published documentation, or specifications, that you may wish to offer as a citation when describing your own information. +All of these organizations have published documentation, or specifications, that you may wish to offer as a citation when describing your own information. -The **Citations** class rounds up these constants, and a few more, for you to reuse:: +The ``Citations`` class rounds up these constants, and a few more, for you to reuse:: referenceDocument( Citations.EPSG ); referenceDocument( Citations.OGC ); @@ -63,12 +63,12 @@ The above method set the whole collection, discarding any previous collection fo Freeze ^^^^^^ -Next we have our first trick; although you can set up metadata classes using setter methods, the result is not generally considered threadsafe. +Next we have our first trick; although you can set up metadata classes using setter methods, the result is not generally considered thread safe. -There are three techniques commonly employed for threadsafety: +There are three techniques commonly employed for thread safety: * Do nothing: and in the javadocs ask developers to only edit from one thread -* Synchronise: really safe, but you pay a performance hit when reading values from many threads +* Synchronize: really safe, but you pay a performance hit when reading values from many threads * Immutable: super safe as you can only configure the object during creation, allowing it to be quickly read from many threads at once. It is however inconvenient to setup. With the limitations of those two ideas in mind, the metadata has an interesting compromise: @@ -81,19 +81,19 @@ The Freeze step "throws a switch" and keeps the object from having any further c Note that the original code c citation stay modifiable; only the returned one is unmodifiable. -The OpenGIS interfaces are not really set up to be mutable, that is once created a lot of code expects them to never change. Hence the freeze step, it works better then the honour system. +The OpenGIS interfaces are not really set up to be mutable, that is once created a lot of code expects them to never change. Hence the freeze step, it works better then the honor system. Metadata WKT ^^^^^^^^^^^^ WKT is actually "Well Known Text" and don't worry nobody knows this the first time. -Not all meatadata beans have a WKT representation, the ones used in defining a CoordinateReferenceSystem are generally well behaved.:: +Not all metadata beans have a WKT representation, the ones used in defining a ``CoordinateReferenceSystem`` are generally well behaved.:: CoordinateReferenceSystem crs = DefaultGeographicCRS.WGS84; System.out.println( crs.toWKT() ); -Scary I know, CoordinateReferenceSystems are actually metadata - in this case the define the meaning of all those coordinates we shunt around a GIS system. +Scary I know, ``CoordinateReferenceSystems`` are actually metadata - in this case the define the meaning of all those coordinates we shunt around a GIS system. Metadata ISO19115 ^^^^^^^^^^^^^^^^^ diff --git a/docs/user/library/metadata/pool.rst b/docs/user/library/metadata/pool.rst index 3903dba39bf..9a094088dbc 100644 --- a/docs/user/library/metadata/pool.rst +++ b/docs/user/library/metadata/pool.rst @@ -1,7 +1,7 @@ Commons Pool ------------ -The Commons Pool project is built around a single idea - the creation of an ObjectPool. This page captures our "best practices" discovered over the course of building the GeoTools project. +The Commons Pool project is built around a single idea - the creation of an ``ObjectPool``. This page captures our "best practices" discovered over the course of building the GeoTools project. References: @@ -10,12 +10,12 @@ References: ObjectPool as a Cache ^^^^^^^^^^^^^^^^^^^^^ -You can configure an SoftReferenceObjectPool to use weak references, the result functions the same as a cache. +You can configure an ``SoftReferenceObjectPool`` to use weak references, the result functions the same as a cache. ObjectPool for Interning ^^^^^^^^^^^^^^^^^^^^^^^^ -You can configure an ObjectPool to use weak references in order to "Intern" objects and prevent duplicates from being +You can configure an ``ObjectPool`` to use weak references in order to "Intern" objects and prevent duplicates from being used in your application. ObjectPool as a Pool @@ -34,52 +34,52 @@ First comes the set up - so the object pool can create the objects as needed.:: ObjectPool Configuration '''''''''''''''''''''''' -And then comes the configuration (of GenericKeyedObjectPool ): +And then comes the configuration (of ``GenericKeyedObjectPool`` ): * Number of Objects - maxActive + ``maxActive`` capacity of created objects - maxIdle + ``maxIdle`` maximum number of lurkers * What to do when at capacity: - whenExhausedAction + ``whenExhausedAction`` fail, grow or block when capacity reached * When to check objects in pool - testOnBorrow - Check with validateObject when borrowed + ``testOnBorrow`` + Check with ``validateObject`` when borrowed - testOnreturn - Check with validateObject when returned + ``testOnreturn`` + Check with ``validateObject`` when returned - testWhenIdle - Check with validateObject from the eviction thread + ``testWhenIdle`` + Check with ``validateObject`` from the eviction thread * Eviction Thread - timeBetweenEvictionRunsMillis + ``timeBetweenEvictionRunsMillis`` Time to sleep - minEvictableIdleTimeMills + ``minEvictableIdleTimeMills`` time to wait before an object could be cleaned up -The way it works is this, for a maxActive of 20 at most 20 objects will be created. If they are all returned the pool will throw the instances away until it has maxIdle (this is kind of its comfort zone). After this point each object will have to time out (based on minEvictableIdleTimeMills) before it is reclaimed.:: +The way it works is this, for a ``maxActive`` of 20 at most 20 objects will be created. If they are all returned the pool will throw the instances away until it has ``maxIdle`` (this is kind of its comfort zone). After this point each object will have to time out (based on ``minEvictableIdleTimeMills``) before it is reclaimed.:: maxActive - /--This is the absolute capacity of our ObjectCache + /--This is the absolute capacity of our ``ObjectCache`` | | Objects are immediately evicted when they are not in use | - \-> maxIdle - /-- This is the "comfort zone" that your ObjectCache will try for under heavy use + \-> ``maxIdle`` + /-- This is the "comfort zone" that your ``ObjectCache`` will try for under heavy use | - | Objects are evicted when they have not been used, every minEvictableIdleTimeMills + | Objects are evicted when they have not been used, every ``minEvictableIdleTimeMills`` | \-> Empty @@ -88,41 +88,42 @@ Eviction Here is how eviction works: -1. it will grab numTestsPerEvictionRun objects from the pool -2. for any object that has exceeded minEvictableIdleTimeMillis it will call validateObject -3. it will throw away any object that fails the validateObject test -4. If we have less than minIdle left in the pool new objects will be spawned +1. it will grab ``numTestsPerEvictionRun`` objects from the pool +2. for any object that has exceeded ``minEvictableIdleTimeMillis`` it will call + ``validateObject`` +3. it will throw away any object that fails the ``validateObject`` test +4. If we have less than ``minIdle`` left in the pool new objects will be spawned -You can perform eviction in a thread controlled by setting testWhenIdle and providing a value for timeBetweenEvictionRunsMillis. +You can perform eviction in a thread controlled by setting ``testWhenIdle`` and providing a value for ``timeBetweenEvictionRunsMillis``. GenericObjectPool Configuration ''''''''''''''''''''''''''''''' -GenericObjectPool introduces the concept of a "soft min" operating as a preferred number object objects to hold in reserved (even when we are completly idle). +``GenericObjectPool`` introduces the concept of a "soft min" operating as a preferred number object objects to hold in reserved (even when we are completely idle). -This concept is a little freaky in that it looks like the GenericObjectPool will create these objects in a background thread even if nothing is going on. +This concept is a little freaky in that it looks like the ``GenericObjectPool`` will create these objects in a background thread even if nothing is going on. -minIdle +``minIdle`` minimum number of lurkers -softMinEvictableIdleTimeMills +``softMinEvictableIdleTimeMills`` time to wait before an object is cleaned up -The way it works is this, for a maxActive of 20 at most 20 objects will be created. If they are all returned the pool will throw the instances away until it has maxIdle (this is kind of its comfort zone). As each object times out we will be left with minIdel number of objects in the pool.:: +The way it works is this, for a ``maxActive`` of 20 at most 20 objects will be created. If they are all returned the pool will throw the instances away until it has ``maxIdle`` (this is kind of its comfort zone). As each object times out we will be left with ``minIdle`` number of objects in the pool.:: maxActive - /--This is the absolute capacity of our ObjectCache + /--This is the absolute capacity of our ``ObjectCache`` | | Objects are immediately evicted when they are not in use | - \-> maxIdle - /-- This is the "comfort zone" that your ObjectCache will try for under heavy use + \-> ``maxIdle`` + /-- This is the "comfort zone" that your ``ObjectCache`` will try for under heavy use | - | Objects are evicted when they have not been used, every minEvictableIdleTimeMills + | Objects are evicted when they have not been used, every ``minEvictableIdleTimeMills`` | - \-> minIdle + \-> ``minIdle`` /-> This is the number of Objects reserved when we are completely idle | - | Objects are spawned as needed, every softMinEvictableIdleTimeMills + | Objects are spawned as needed, every ``softMinEvictableIdleTimeMills`` | \-- Empty diff --git a/docs/user/library/metadata/range.rst b/docs/user/library/metadata/range.rst index 162aa9c7dae..e14e14a01c9 100644 --- a/docs/user/library/metadata/range.rst +++ b/docs/user/library/metadata/range.rst @@ -1,7 +1,7 @@ Range ----- -GeoTools inlcudes a **Range** class to represent a numeric, or value, range. This is handy when expressing scales a dataset is useful for. +GeoTools includes a ``Range`` class to represent a numeric, or value, range. This is handy when expressing scales a data set is useful for. .. literalinclude:: /../src/main/java/org/geotools/metadata/MetadataExamples.java :language: java @@ -15,7 +15,7 @@ This actually works with any Comparable such as Strings or enumerations. :start-after: // exampleRangeComparable start :end-before: // exampleRangeComparable end -We have a special **NumericRange** that uses the fact that numbers can work together to allow comparisons between NumericRange and NumericRange. +We have a special ``NumericRange`` that uses the fact that numbers can work together to allow comparisons between ``NumericRange`` and ``NumericRange``. .. literalinclude:: /../src/main/java/org/geotools/metadata/MetadataExamples.java :language: java diff --git a/docs/user/library/metadata/text.rst b/docs/user/library/metadata/text.rst index ceaa779f23a..9549fc329a4 100644 --- a/docs/user/library/metadata/text.rst +++ b/docs/user/library/metadata/text.rst @@ -1,7 +1,7 @@ Text ---- -The **Text** utility class helps your code access GeoTools text +The ``Text`` utility class helps your code access GeoTools text facilities.: .. literalinclude:: /../src/main/java/org/geotools/metadata/MetadataExamples.java @@ -9,13 +9,13 @@ facilities.: :start-after: // exampleText start :end-before: // exampleText end -The idea of an InternationalString comes from the gt-opengis module. +The idea of an ``InternationalString`` comes from the ``gt-opengis`` module. -The above class is backed by a couple of implementations provided by gt-metadata: +The above class is backed by a couple of implementations provided by ``gt-metadata``: -* ResourceInternationalString +* ``ResourceInternationalString`` - Used to set up an InternationalString based on a resource + Used to set up an ``InternationalString`` based on a resource bundle. .. literalinclude:: /../src/main/java/org/geotools/metadata/MetadataExamples.java @@ -26,10 +26,10 @@ The above class is backed by a couple of implementations provided by gt-metadata As noted above Java ResourceBundle is responsible for loading the correct property file for the requested String. -* SimpleInternationalString +* ``SimpleInternationalString`` This is used when you need to quickly get back to work. You can - replace the default english text with a real translator when a + replace the default English text with a translated string when a volunteer shows interest. .. literalinclude:: /../src/main/java/org/geotools/metadata/MetadataExamples.java @@ -37,7 +37,7 @@ The above class is backed by a couple of implementations provided by gt-metadata :start-after: // exampleSimpleInternationalStirng start :end-before: // exampleSimpleInternationalStirng end -* GrowableInternaionalString +* ``GrowableInternaionalString`` The easiest one to use as a programmer; allows you to set up multiple translations in code. diff --git a/docs/user/library/metadata/urls.rst b/docs/user/library/metadata/urls.rst index 12a0091be42..b2bf0492533 100644 --- a/docs/user/library/metadata/urls.rst +++ b/docs/user/library/metadata/urls.rst @@ -1,14 +1,14 @@ URLs ---- -**org.geotools.util.URLs** provides methods for safely handling URLs. +``org.geotools.util.URLs`` provides methods for safely handling URLs. -* URLs.fileToUrl(File) -* URLs.urlToFile(URL) +* ``URLs.fileToUrl(File)`` +* ``URLs.urlToFile(URL)`` -One of the changes between Java 5 and Java 6 is the deprecation of the File.toURL() method. Earlier version of Java implemented this method incorrectly, and Java 6 offers File.toURI().toURL() as a replacement. +One of the changes between Java 5 and Java 6 is the deprecation of the ``File.toURL()`` method. Earlier version of Java implemented this method incorrectly, and Java 6 offers ``File.toURI().toURL()`` as a replacement. -Problem is that does not help anyone - since when we are provided a URL we cannot be sure if it was constructed correctly. +The problem is that does not help anyone - since when we are provided a URL we cannot be sure if it was constructed correctly. These two methods have been extensively tested and can handle odd corner cases such as files located on windows shared folders. @@ -21,9 +21,9 @@ Here is a scary example of a windows network share:: See also: -* changeUrlExt(URL, String) -* extendUrl(URL, String) -* getParentUrl(URL) +* ``changeUrlExt(URL, String)`` +* ``extendUrl(URL, String)`` +* ``getParentUrl(URL)`` References: diff --git a/docs/user/library/opengis/coverage.rst b/docs/user/library/opengis/coverage.rst index 84345534198..c521af4078e 100644 --- a/docs/user/library/opengis/coverage.rst +++ b/docs/user/library/opengis/coverage.rst @@ -1,9 +1,9 @@ GridCoverage ------------ -Before tackling the details of how to create and use **GridCoverage2D** instances, the semantics of the information contents of a GridCoverage must be well understood. +Before tackling the details of how to create and use ``GridCoverage2D`` instances, the semantics of the information contents of a ``GridCoverage`` must be well understood. -At the most basic level, a GridCoverage is a matrix of numeric values with information about the meaning of the numeric values and about the geographic position of the values. So for each 'GridCoverage' there will be one data structure, such as an image file, which contains all of the numeric values of interest. There will also be some data structure containing the meaning of the data and another data structure containing the georeferencing information for the data. +At the most basic level, a ``GridCoverage`` is a matrix of numeric values with information about the meaning of the numeric values and about the geographic position of the values. So for each ``GridCoverage`` there will be one data structure, such as an image file, which contains all of the numeric values of interest. There will also be some data structure containing the meaning of the data and another data structure containing the georeferencing information for the data. Example: @@ -19,39 +19,39 @@ Categories Images used in geospatial science have highly structured values. For example, the image could have one value, like -9999, used to indicate that the data were not available for that location. The image might have another value, such as -8888, used to indicate cloud cover. Then we might have the actual measurements in a range, possibly from 0 to 5000 but these actually map to 5000 levels between -99 to 400 of some unit of measure which interests the user, say US feet above a given vertical datum. -In GeoTools, we treat the different kinds of values with different categories. That is we create a Category for the -9999 value, another for the -8888 value and a third for the range from 0 to 5000. The categories define how we want to use the values, what they will map to and provide a default color to use for the data when presented in an image. So we have: +In GeoTools, we treat the different kinds of values with different categories. That is we create a ``Category`` for the -9999 value, another for the -8888 value and a third for the range from 0 to 5000. The categories define how we want to use the values, what they will map to and provide a default color to use for the data when presented in an image. So we have: -========== ==================== ============== ====================== -RAW Data Category Value Colour -========== ==================== ============== ====================== --9999 QualitativeCategory NaN new Color(0,0,0,0) --8888 QualitativeCategory NaN Color.WHITE -0:5000 QuantitativeCategory -99:400 foot Color.BLUE:Color.GREEN -========== ==================== ============== ====================== +========== ======================== ============== ====================== +RAW Data Category Value Color +========== ======================== ============== ====================== +-9999 ``QualitativeCategory`` NaN new Color(0,0,0,0) +-8888 ``QualitativeCategory`` NaN Color.WHITE +0:5000 ``QuantitativeCategory`` -99:400 foot Color.BLUE:Color.GREEN +========== ======================== ============== ====================== -If the file contains a value which is not defined in one category or another, the behaviour of how that value will be handled is undefined. +If the file contains a value which is not defined in one category or another, the behavior of how that value will be handled is undefined. SampleDimensions ^^^^^^^^^^^^^^^^ -A sample dimension establishes the mapping for each band of the resulting GridCoverage. Typically we map each band in the original data to one SampleDimension in the GridCoverage so the number of bands in the original data is the same as the number of bands in the resulting GridCoverage. In this example we have only one band so we only create a single SampleDimension. +A sample dimension establishes the mapping for each band of the resulting ``GridCoverage``. Typically we map each band in the original data to one ``SampleDimension`` in the ``GridCoverage`` so the number of bands in the original data is the same as the number of bands in the resulting ``GridCoverage``. In this example we have only one band so we only create a single ``SampleDimension``. -The 'sample dimension' will be built out of the three category objects so we have a complete mapping from the data values in the file to some numeric value. To build the sample dimension, we would create an array of the Category instances and define the Unit in which the values -99 to 400 are defined. +The 'sample dimension' will be built out of the three category objects so we have a complete mapping from the data values in the file to some numeric value. To build the sample dimension, we would create an array of the ``Category`` instances and define the Unit in which the values -99 to 400 are defined. Georeferencing ^^^^^^^^^^^^^^ -To build a GeoTools GridCoverage we also need information about the mapping between coordinate space in the data matrix (row/column) and the real world coordinate space in some geographically meaningful Coordinate Reference System, projected or not. +To build a GeoTools ``GridCoverage`` we also need information about the mapping between coordinate space in the data matrix (row/column) and the real world coordinate space in some geographically meaningful Coordinate Reference System, projected or not. -The quick way to build this information is to build an Envelope from both the CoordinateReferenceSystem of the resulting GridCoverage and the coordinates in that CRS of the lower and upper corners of the original data matrix (the outer corners not the pixel center). The coverage module can draw on this Envelope to build the MathTransform which it will use. While this strategy is provided for convenience, it does not allow for much flexibility: the grid must be perfectly axis aligned in the resulting CRS and the axes must be in the same order in the original data matrix and in the resulting CRS. +The quick way to build this information is to build an Envelope from both the ``CoordinateReferenceSystem`` of the resulting ``GridCoverage`` and the coordinates in that CRS of the lower and upper corners of the original data matrix (the outer corners not the pixel center). The coverage module can draw on this Envelope to build the ``MathTransform`` which it will use. While this strategy is provided for convenience, it does not allow for much flexibility: the grid must be perfectly axis aligned in the resulting CRS and the axes must be in the same order in the original data matrix and in the resulting CRS. -A more complex but fully powerful approach to building the georeferencing information involves building oneself the MathTransform which maps from the coordinate space of the data matrix to the georeferenced space of the real world for the resultant GridCoverage. This approach allows for rotated imagery, axis order switching and other more complex transforms. +A more complex but fully powerful approach to building the georeferencing information involves building oneself the ``MathTransform`` which maps from the coordinate space of the data matrix to the georeferenced space of the real world for the resultant ``GridCoverage``. This approach allows for rotated imagery, axis order switching and other more complex transforms. GridCoverage views ^^^^^^^^^^^^^^^^^^ -With the original data matrix, an array of all the SampleDimension instances and the georeferencing information, we can then create the GridCoverage instance. +With the original data matrix, an array of all the ``SampleDimension`` instances and the georeferencing information, we can then create the ``GridCoverage`` instance. -On the resulting GridCoverage objects, we will be able to obtain different 'views' of the data values. We can work against either of the original 'native' data, the transformed 'geophysical' data in the given unit, or the colour values. +On the resulting ``GridCoverage`` objects, we will be able to obtain different 'views' of the data values. We can work against either of the original 'native' data, the transformed 'geophysical' data in the given unit, or the color values. Example: An RGB file diff --git a/docs/user/library/opengis/cs.rst b/docs/user/library/opengis/cs.rst index 84fca995d0f..e181e0645fb 100644 --- a/docs/user/library/opengis/cs.rst +++ b/docs/user/library/opengis/cs.rst @@ -1,7 +1,7 @@ Coordinate Systems ------------------ -In the previous page we saw that each geometry had an associated **CoordinateReferenceSystem**. This page introduces some coordinate system concepts along with the interfaces used, and may be interested as background reading. +In the previous page we saw that each geometry had an associated ``CoordinateReferenceSystem``. This page introduces some coordinate system concepts along with the interfaces used, and may be interested as background reading. .. image:: /images/crs_overview.PNG @@ -36,15 +36,15 @@ There is not just one ellipsoid. An ellipsoid is a matter of choice, and therefo Map projections ^^^^^^^^^^^^^^^ -A Geographic CRS is not suitable for mapmaking on a planar surface, because it describes geometry on a curved surface. It is impossible to represent such geometry in a Euclidean plane without introducing distortions. The need to control these distortions has given rise to the development of the science of map projections. Although some map projections can be represented as a geometric process, in general a map projection is a set of formulae that converts geodetic latitude and longitude to plane (map) coordinates. Height plays no role in this process, which is entirely two-dimensional. The same map projection can be applied to many geographic CRSs, resulting in many projected CRSs each of which is related to the same geodetic datum as the geographic CRS on which it was based. +A Geographic CRS is not suitable for map-making on a planar surface, because it describes geometry on a curved surface. It is impossible to represent such geometry in a Euclidean plane without introducing distortions. The need to control these distortions has given rise to the development of the science of map projections. Although some map projections can be represented as a geometric process, in general a map projection is a set of formulae that converts geodetic latitude and longitude to plane (map) coordinates. Height plays no role in this process, which is entirely two-dimensional. The same map projection can be applied to many geographic CRS, resulting in many projected CRS each of which is related to the same geodetic datum as the geographic CRS on which it was based. -Some common map projections include the Mercator, Transverse Mercator, Lambert Conformal Conic and Stereographic. The formulae for these map projections can be used to convert (latitude, longitude) coordinates from a geographic CRS to planar (x,y) coordinates in a projected CRS. Parameters used for the map projections (eg. Central Meridian) are chosen to minimize distortion for the area of study. +Some common map projections include the Mercator, Transverse Mercator, Lambert Conformal Conic and Stereographic. The formulae for these map projections can be used to convert (latitude, longitude) coordinates from a geographic CRS to planar (x,y) coordinates in a projected CRS. Parameters used for the map projections (e.g. Central Meridian) are chosen to minimize distortion for the area of study. OpenGIS Concepts ^^^^^^^^^^^^^^^^ The Open GIS Consortium (OGC) is a non-profit association that develops standards for -GIS. These are mainly standards for exchanging geodata and geoobjects. +GIS. These are mainly standards for exchanging geographic data and geographic objects. Some specifications related to coordinate systems have also been created. @@ -68,17 +68,16 @@ The major difference between the documents is that the newer one distinguishes b Definitions: -coordinate system +Coordinate system set of (mathematical) rules for specifying how coordinates are to be assigned to points - NOTE One coordinate system may be used in many coordinate reference systems. + .. note:: One coordinate system may be used in many coordinate reference systems. -coordinate reference system +Coordinate reference system (CRS) coordinate system which is related to the real world by a datum. - NOTE 1: For geodetic and vertical datums, it will be related to the Earth. - NOTE 2: The geometric properties of a coordinate space determine how distances and - angles between points are calculated from the coordinates. + .. note:: For geodetic and vertical datums, it will be related to the Earth. + .. note:: The geometric properties of a coordinate space determine how distances and angles between points are calculated from the coordinates. For example, in an ellipsoidal (2D) space distances are defined as curves on the surface of the ellipsoid, whereas in a Euclidean plane as used for projected CRS @@ -86,79 +85,72 @@ coordinate reference system that determine distances and angles are calculated from coordinates and vice versa are comprised in the concept of coordinate system. -compound coordinate reference system +Compound coordinate reference system coordinate reference system using at least two independent coordinate reference systems describing horizontal positions and/or vertical positions and/or temporal positions or positions. - NOTE: It cannot contain another compound coordinate reference system. + .. note:: It cannot contain another compound coordinate reference system. -datum +Datum parameter or set of parameters that determine the location of the origin, the orientation and the scale of a coordinate reference system -geodetic datum +Geodetic datum datum describing the relationship of a 3D or 2D coordinate system to the Earth - NOTE In most cases, the geodetic datum includes an ellipsoid definition. + .. note:: In most cases, the geodetic datum includes an ellipsoid definition. Coordinate One of a sequence of N numbers designating the position of a point in N-dimensional space. In a coordinate reference system, the coordinate numbers must be qualified by units. -geodetic coordinates +Geodetic coordinates coordinates defined in a geocentric, geographic (2D or 3D) or projected coordinate reference system. -cartesian coordinate system +Cartesian coordinate system coordinate system which gives the position of points relative to N mutually- perpendicular straight axes. - NOTE In the context of geospatial coordinates the maximum values of N is three. + .. note:: In the context of geospatial coordinates the maximum values of N is three. -ellipsoid +Ellipsoid surface formed by the rotation of an ellipse about an axis - NOTE: Sometimes the alternative word "spheroid" is used in geodetic or survey practice - to express the same concept. Although mathematically speaking incorrect the more common - term in geodetic or survey practice is "ellipsoid". An alternative term used in - geodetic practice is "reference ellipsoid". + .. note:: Sometimes the alternative word "spheroid" is used in geodetic or survey practice to express the same concept. Although mathematically speaking incorrect the more common term in geodetic or survey practice is "ellipsoid". An alternative term used in geodetic practice is "reference ellipsoid". -flattening +Flattening ratio of the difference between the semi-major (a) and semi-minor axis (b) of an ellipsoid to the semi-major axis; f = (a-b)/a - NOTE Sometimes inverse flattening 1/f = a/(a-b) is given instead of flattening; 1/f is - also known as reciprocal flattening. + .. note:: Sometimes inverse flattening 1/f = a/(a-b) is given instead of flattening; 1/f is also known as reciprocal flattening. -semi-major axis +Semi-major axis semi-diameter of the longest axis of a reference ellipsoid. - NOTE This equates to the semi-diameter of the reference ellipsoid measured in its - equatorial plane + .. note:: This equates to the semi-diameter of the reference ellipsoid measured in its equatorial plane -semi-minor axis +Semi-minor axis semi-diameter of the shortest axis of a reference ellipsoid - NOTE The shortest axis coincides with the rotation axis of the reference ellipsoid and - therefore contains both poles. + .. note:: The shortest axis coincides with the rotation axis of the reference ellipsoid and therefore contains both poles. -geographic coordinate reference system +Geographic coordinate reference system coordinate reference system using an ellipsoidal coordinate system and based on an ellipsoid that approximates the shape of the Earth - NOTE A geographic coordinate system can be 2D or 3D. In a 3D geographic coordinate - system, the third dimension is height above the ellipsoid surface + .. note:: A geographic coordinate system can be 2D or 3D. In a 3D geographic coordinate system, the third dimension is height above the ellipsoid surface -geocentric coordinate reference system - 3-dimensional coordinate reference system with its origin at the (approximate) centre +Geocentric coordinate reference system + 3-dimensional coordinate reference system with its origin at the (approximate) center of the Earth. -map projection +Map projection conversion from a geodetic coordinate system to a planar surface -prime meridian, zero meridian +Prime meridian, zero meridian meridian from which the longitudes of other meridians are quantified -coordinate conversion +Coordinate conversion change of coordinates, based on a one-to-one relationship, from one coordinate reference system to another based on the same datum @@ -166,80 +158,75 @@ coordinate conversion coordinates and projected coordinates, or change of units such as from radians to degrees or feet to metres. - NOTE A conversion uses parameters which have specified values, not empirically - determined values. + .. note:: A conversion uses parameters which have specified values, not empirically determined values. -coordinate transformation +Coordinate transformation computational process of converting a position given in one coordinate reference system into the corresponding position in another coordinate reference system - NOTE A coordinate transformation can require and use the parameters of the ellipsoids - associated with the source and target coordinate + .. note:: A coordinate transformation can require and use the parameters of the ellipsoids associated with the source and target coordinate -projected coordinate reference system +Projected coordinate reference system two-dimensional coordinate system resulting from a map projection. - NOTE Projected coordinate reference system is derived from a 2D geographic coordinate - reference system by applying a parameterised coordinate transformation known as a "map - projection". Projected coordinate reference system commonly uses a Cartesian coordinate - system. + .. note:: Projected coordinate reference system is derived from a 2D geographic coordinate reference system by applying a parameterized coordinate transformation known as a "map projection". Projected coordinate reference system commonly uses a Cartesian coordinate system. -latitude, geodetic latitude, ellipsoidal latitude +Latitude, geodetic latitude, ellipsoidal latitude angle from the equatorial plane to the perpendicular to the ellipsoid through a given point, northwards treated as positive. -longitude, geodetic longitude, ellipsoidal longitude +Longitude, geodetic longitude, ellipsoidal longitude angle from the prime meridian plane to the meridian plane of the given point, eastward treated as positive. -prime meridian, zero meridian +Prime meridian, zero meridian meridian from which the longitudes of other meridians are quantified. -reference ellipsoid +Reference ellipsoid ellipsoid used as the best local or global approximation of the surface of the geoid. -ellipsoidal (geodetic) height +Ellipsoidal (geodetic) height distance of a point from the ellipsoid measured along the perpendicular from the ellipsoid to the point itself, taken as positive upwards or outside the ellipsoid. -ellipsoidal (geodetic) coordinate system +Ellipsoidal (geodetic) coordinate system coordinate system in which position is specified by geodetic latitude, geodetic longitude and ( in the three dimensional case) ellipsoidal height, associated with one or more geographic coordinate reference systems. -geoid +Geoid level surface which best fits mean sea level either locally or globally. -gravity related height +Gravity related height height dependent on the earth's gravity field. -mean sea level +Mean sea level average level of the surface of the sea over all stages of tide and seasonal variations. -meridian +Meridian intersection of an ellipsoid by a plane containing the semi-minor axis of the ellipsoid. -prime meridian +Prime meridian meridian from which longitudes of other meridians are quantified. -temporal reference system +Temporal reference system reference system against which time is measured. -temporal datum +Temporal datum datum defining the origin of a temporal reference system. -time coordinate system +Time coordinate system one-dimensional coordinate system containing a time axis used in temporal reference systems to describe the temporal position of a point in the specified time units from a specified temporal datum. -vertical coordinate reference system +Vertical coordinate reference system one-dimensional coordinate reference system used for gravity-related height or depth measurements. -vertical datum +Vertical datum datum describing the relation of gravity-related heights or depths to the Earth. Coordinate Reference Systems @@ -254,15 +241,15 @@ A datum specifies the relationship of a coordinate system to the earth, thus ens **Principal sub-types of coordinate reference systems** -Geodetic survey practice usually divides coordinate reference systems into a number of sub-types. The common classification criterion for sub-typing of coordinate reference systems can be described as the way in which they deal with earth curvature. This has a direct effect on the portion of the earth?s surface that can be covered by that type of CRS with an acceptable degree of error. Thus the following principal sub-types of coordinate reference system are distinguished: +Geodetic survey practice usually divides coordinate reference systems into a number of sub-types. The common classification criterion for sub-typing of coordinate reference systems can be described as the way in which they deal with earth curvature. This has a direct effect on the portion of the earth's surface that can be covered by that type of CRS with an acceptable degree of error. Thus the following principal sub-types of coordinate reference system are distinguished: -1. Geocentric. Type of coordinate reference system that deals with the earth?s curvature by taking the 3D spatial view, which obviates the need to model the earth?s curvature. The origin of a geocentric CRS is at the approximate centre of mass of the earth. +1. Geocentric. Type of coordinate reference system that deals with the earth's curvature by taking the 3D spatial view, which obviates the need to model the earth's curvature. The origin of a geocentric CRS is at the approximate center of mass of the earth. -2. Geographic. Type of coordinate reference system based on an ellipsoidal approximation of the geoid. This provides an accurate representation of the geometry of geographic features for a large portion of the earth?s surface. Geographic coordinate reference systems can be 2D or 3D. A 2D Geographic CRS is used when positions of features are described on the surface of the reference ellipsoid; a 3D geographic CRS is used when positions are described on, above or below the reference ellipsoid. +2. Geographic. Type of coordinate reference system based on an ellipsoidal approximation of the geoid. This provides an accurate representation of the geometry of geographic features for a large portion of the earth's surface. Geographic coordinate reference systems can be 2D or 3D. A 2D Geographic CRS is used when positions of features are described on the surface of the reference ellipsoid; a 3D geographic CRS is used when positions are described on, above or below the reference ellipsoid. 3. Projected. Type of coordinate reference system that is based on an approximation of the shape of the earths surface by a plane. The distortion that is inherent to the approximation is carefully controlled and known. Distortion correction is commonly applied to calculated bearings and distances to produce values that are a close match to actual field values. -4. Engineering. Type of coordinate reference system that is that is used only in a contextually local sense. This sub-type is used to model two broad categories of local coordinate reference systems:earth-fixed systems, applied to engineering activities on or near the surface of the earth; coordinates on moving platforms such as road vehicles, vessels, aircraft or spacecraft. Earth-fixed Engineering CRSs are commonly based on a simple flat-earth approximation of the earth?s surface, and the effect of earth curvature on feature geometry is ignored: calculations on coordinates use simple plane arithmetic without any corrections for earth curvature. The application of such Engineering CRSs to relatively small areas and "contextually local" is in this case equivalent to "spatially - local". Engineering CRSs used on moving platforms are usually intermediate coordinate reference systems that are computationally required to calculate geodetic coordinates. These coordinate reference systems are subject to all the motions of the platform with which they are associated. In this case "contextually local" means that the associated coordinates are meaningful only relative to the moving platform. Earth curvature is usually irrelevant and is therefore ignored. In the spatial sense their applicability may extend from the immediate vicinity of the platform (e.g. a moving seismic ship) to the entire earth (e.g. in space applications). The determining factor is the mathematical model deployed in the positioning calculations. Transformation of coordinates from these moving Engineering CRSs to earth-referenced coordinate reference systems involves time-dependent coordinate operation parameters. -5. Vertical. Type of coordinate reference system used for the recording of heights or depths. Vertical CRSs make use of the direction of gravity to define the concept of height or depth, but its relationship with gravity may not be straightforward. By implication therefore, ellipsoidal heights (h) cannot be captured in a vertical coordinate reference system: ellipsoidal heights cannot exist independently, but only as an inseparable part of a 3D coordinate tuple defined in a geographic 3D coordinate reference system. +4. Engineering. Type of coordinate reference system that is that is used only in a contextually local sense. This sub-type is used to model two broad categories of local coordinate reference systems:earth-fixed systems, applied to engineering activities on or near the surface of the earth; coordinates on moving platforms such as road vehicles, vessels, aircraft or spacecraft. Earth-fixed Engineering CRS are commonly based on a simple flat-earth approximation of the earth's surface, and the effect of earth curvature on feature geometry is ignored: calculations on coordinates use simple plane arithmetic without any corrections for earth curvature. The application of such Engineering CRS to relatively small areas and "contextually local" is in this case equivalent to "spatially + local". Engineering CRS used on moving platforms are usually intermediate coordinate reference systems that are computationally required to calculate geodetic coordinates. These coordinate reference systems are subject to all the motions of the platform with which they are associated. In this case "contextually local" means that the associated coordinates are meaningful only relative to the moving platform. Earth curvature is usually irrelevant and is therefore ignored. In the spatial sense their applicability may extend from the immediate vicinity of the platform (e.g. a moving seismic ship) to the entire earth (e.g. in space applications). The determining factor is the mathematical model deployed in the positioning calculations. Transformation of coordinates from these moving Engineering CRS to earth-referenced coordinate reference systems involves time-dependent coordinate operation parameters. +5. Vertical. Type of coordinate reference system used for the recording of heights or depths. Vertical CRS make use of the direction of gravity to define the concept of height or depth, but its relationship with gravity may not be straightforward. By implication therefore, ellipsoidal heights (h) cannot be captured in a vertical coordinate reference system: ellipsoidal heights cannot exist independently, but only as an inseparable part of a 3D coordinate tuple defined in a geographic 3D coordinate reference system. 6. Temporal. Used for the recording of time in association with any of the listed spatial coordinate reference systems. @@ -270,7 +257,7 @@ Geodetic survey practice usually divides coordinate reference systems into a num **Additional sub-types of coordinate reference systems** -In addition to the principal sub-types, so called because they represent concepts generally known in geodetic practice, two more sub-types have been defined to permit modelling of certain relationships and constraints that exist between the principal sub-types. These additional sub-types are: +In addition to the principal sub-types, so called because they represent concepts generally known in geodetic practice, two more sub-types have been defined to permit modeling of certain relationships and constraints that exist between the principal sub-types. These additional sub-types are: 1. Compound coordinate reference system 2. Derived coordinate reference system @@ -281,13 +268,13 @@ The traditional separation of horizontal and vertical position has resulted in c A Compound CRS is thus a coordinate reference system that combines two or more coordinate reference systems, none of which can itself be compound. In general, a Compound CRS may contain any number of axes. The Compound CRS contains an ordered set of coordinate reference systems and the tuple order of a compound coordinate set shall follow that order, while the subsets of the tuple, described by each of the composing coordinate reference systems, follow the tuple order valid for their respective coordinate reference systems. -For spatial coordinates, a number of constraints exist for the construction of Compound CRSs. For example, the coordinate reference systems that are combined should not contain any duplicate or redundant axes. +For spatial coordinates, a number of constraints exist for the construction of Compound CRS. For example, the coordinate reference systems that are combined should not contain any duplicate or redundant axes. **Derived coordinate reference system** Some coordinate reference systems are defined by applying a coordinate conversion to another coordinate reference system. Such a coordinate reference system is called a Derived CRS and the coordinate reference system it was derived from by applying the conversion is called the Source or Base CRS. A coordinate conversion is an arithmetic operation with zero or more parameters that have defined values. The Source CRS and Derived CRS have the same Datum. The best-known example of a Derived CRS is a Projected CRS, which is always derived from a source Geographic CRS by applying the coordinate conversion known as a map projection. -In principle, all sub-types of coordinate reference system may take on the role of either Source or Derived CRS with the exception of a Geocentric CRS and a Projected CRS. The latter is modelled as an object class under its own name, rather than as a general Derived CRS of type ?projected?. This has been done to honour common practice, which acknowledges Projected CRSs as one of the best known types of coordinate reference systems. +In principle, all sub-types of coordinate reference system may take on the role of either Source or Derived CRS with the exception of a Geocentric CRS and a Projected CRS. The latter is modeled as an object class under its own name, rather than as a general Derived CRS of type "projected". This has been done to honor common practice, which acknowledges Projected CRS as one of the best known types of coordinate reference systems. Coordinate Systems ^^^^^^^^^^^^^^^^^^ @@ -299,56 +286,57 @@ The coordinates of points are recorded in a coordinate system. A coordinate syst One coordinate system may be used by multiple coordinate reference systems. Its axes can be spatial, temporal, or mixed. A coordinate system is composed of an ordered set of coordinate system axes, the number of axes being equal to the dimension of the space of which it describes the geometry. Coordinates in coordinate tuples shall be supplied in the same order as the coordinate axes are defined. The dimension of the coordinate space, the names, the units of measure, the directions and sequence of the axes are all part of the Coordinate System definition. The number of coordinates in a tuple and consequently the number of coordinate axes in a coordinate system shall be equal to the number of coordinate axes in the coordinate system. Coordinate systems are divided into subtypes by the geometric properties of the coordinate space spanned and the geometric properties of the axes themselves (straight or curved; perpendicular or not). Certain subtypes of coordinate system can only be used with specific subtypes of coordinate reference system. -+------------------+--------------------------------------------------------------------------------+--------------+ -|CoordainteSystem |Description | For CRS | -+------------------+--------------------------------------------------------------------------------+--------------+ -| Cartesian | 1-, 2-, or 3-dimensional coordinate system. It gives the position of points | Geocentric | -| | relative to orthogonal straight axes in the 2- and 3-dimensional cases. In | Projected | -| | 1-dimensional case, it contains a single straight coordinate axis. In the | Engineering | -| | multi-dimensional case, all axes shall have the same unit of measure. | Image | -+------------------+--------------------------------------------------------------------------------+--------------+ -|oblique Cartesian | 2- or 3-dimensional coordinate system with straight axes that are not | Engineering | -| | necessarily orthogonal. | Image | -+------------------+--------------------------------------------------------------------------------+--------------+ -|ellipsoidal | 2- or 3-dimensional coordinate system in which position is specified by | Engineering | -| | geodetic latitude, geodetic longitude and (in the three-dimensional case) | | -| | ellipsoidal height, associated with one or more geographic coordinate | | -| | reference systems.Geographic | | -+------------------+--------------------------------------------------------------------------------+--------------+ -|spherical | 3-dimensional coordinate system with one distance, measured from the origin, | Geocentric | -| | and two angular coordinates. Not to be confused with an ellipsoidal coordinate | Engineering | -| | system based on an ellipsoid ?degenerated? into a sphere | | -+------------------+--------------------------------------------------------------------------------+--------------+ -| cylindrical | 3-dimensional coordinate system consisting of a polar coordinate system | Engineering | -| | extended by a straight coordinate axis perpendicular to the plane spanned by | | -| | the polar coordinate system. | | -+------------------+--------------------------------------------------------------------------------+--------------+ -| polar | 2-dimensional coordinate system in which position is specified by distance to | Engineering | -| | the origin and the angle between the line from origin to point and a reference | | -| | direction. | | -+------------------+--------------------------------------------------------------------------------+--------------+ -| vertical | 1-dimensional coordinate system used to record the heights (or depths) of | Vertical | -| | points dependent on the Earth?s gravity field. An exact definition is | Engineering | -| | deliberately not provided as the complexities of the subject fall outside the | | -| | scope of this specification. | | -+------------------+--------------------------------------------------------------------------------+--------------+ -| linear | 1-dimensional coordinate system that consists of the points that lie on the | Engineering | -| | single axis described. The associated ordinate is the distance from the | | -| | specified origin to the point along the Axis. Example: usage of the line | | -| | feature representing a road to describe points on or along that road. | | -+------------------+--------------------------------------------------------------------------------+--------------+ -| temporal | dimensional coordinate system containing a single time axis and used to | Temporal | -| | describe the temporal position of a point in the specified time units from a | | -| | specified time origin. | | -+------------------+--------------------------------------------------------------------------------+--------------+ - -**Coordinate system axis** - -A coordinate system is composed of an ordered set of coordinate system axes. Each of its axes is completely characterised by a unique combination of axis name, axis abbreviation, axis direction and axis unit of measure. The concept of coordinate axis requires some clarification. Consider an arbitrary x, y, z coordinate system. The x-axis may be defined as the locus of points with y = z = 0. This is easily enough understood if the x, y, z coordinate system is a Cartesian system and the space it describes is Euclidean. It becomes a bit more difficult to understand in the case of a strongly curved space, such as the surface of an ellipsoid, its geometry described by an ellipsoidal coordinate system (2D or 3D). Applying the same definition by analogy to the curvilinear latitude and longitude coordinates the latitude axis would be the equator and the longitude axis would be the prime meridian, which is not a satisfactory definition. Bearing in mind that the order of the coordinates in a coordinate tuple must be the same as the defined order of the coordinate axes, the i-th coordinate axis of a coordinate system is defined as the locus of points for which all coordinates with sequence number not equal to ?i?, have a constant value locally (whereby i = 1 ...n, and n is the dimension of the coordinate space). It will be evident that the addition of the word "locally" in this definition apparently adds an element of ambiguity and this is intentional. However, the definition of the coordinate parameter associated with any axis must be unique. The coordinate axis itself should not be interpreted as a unique mathematical object, the associated coordinate parameter should. - -Example: Geodetic latitude is defined as the "Angle from the equatorial plane to the perpendicular to the ellipsoid through a given point, northwards usually treated as positive". However, hen used in an ellipsoidal coordinate system the geodetic latitude axis will be described as pointing "north". In two different points on the ellipsoid the direction "north" will be a spatially ifferent direction, but the concept of latitude is the same. - -Furthermore the specified direction of the coordinate axes is often only approximate; two geographic coordinate reference systems will make use of the same ellipsoidal coordinate system. These coordinate systems are associated with the earth hrough two different geodetic datums, which may lead to the two systems being slightly rotated w.r.t. each other. ++-------------------+--------------------------------------------------------------------------------+--------------+ +| Coordinate System | Description | For CRS | ++-------------------+--------------------------------------------------------------------------------+--------------+ +| Cartesian | 1-, 2-, or 3-dimensional coordinate system. It gives the position of points | Geocentric | +| | relative to orthogonal straight axes in the 2- and 3-dimensional cases. In | Projected | +| | 1-dimensional case, it contains a single straight coordinate axis. In the | Engineering | +| | multi-dimensional case, all axes shall have the same unit of measure. | Image | ++-------------------+--------------------------------------------------------------------------------+--------------+ +| Oblique Cartesian | 2- or 3-dimensional coordinate system with straight axes that are not | Engineering | +| | necessarily orthogonal. | Image | ++-------------------+--------------------------------------------------------------------------------+--------------+ +| Ellipsoidal | 2- or 3-dimensional coordinate system in which position is specified by | Engineering | +| | geodetic latitude, geodetic longitude and (in the three-dimensional case) | | +| | ellipsoidal height, associated with one or more geographic coordinate | | +| | reference systems.Geographic | | ++-------------------+--------------------------------------------------------------------------------+--------------+ +| Spherical | 3-dimensional coordinate system with one distance, measured from the origin, | Geocentric | +| | and two angular coordinates. Not to be confused with an ellipsoidal coordinate | Engineering | +| | system based on an ellipsoid "degenerated" into a sphere | | ++-------------------+--------------------------------------------------------------------------------+--------------+ +| Cylindrical | 3-dimensional coordinate system consisting of a polar coordinate system | Engineering | +| | extended by a straight coordinate axis perpendicular to the plane spanned by | | +| | the polar coordinate system. | | ++-------------------+--------------------------------------------------------------------------------+--------------+ +| Polar | 2-dimensional coordinate system in which position is specified by distance to | Engineering | +| | the origin and the angle between the line from origin to point and a reference | | +| | direction. | | ++-------------------+--------------------------------------------------------------------------------+--------------+ +| Vertical | 1-dimensional coordinate system used to record the heights (or depths) of | Vertical | +| | points dependent on the Earth's gravity field. An exact definition is | Engineering | +| | deliberately not provided as the complexities of the subject fall outside the | | +| | scope of this specification. | | ++-------------------+--------------------------------------------------------------------------------+--------------+ +| Linear | 1-dimensional coordinate system that consists of the points that lie on the | Engineering | +| | single axis described. The associated ordinate is the distance from the | | +| | specified origin to the point along the Axis. Example: usage of the line | | +| | feature representing a road to describe points on or along that road. | | ++-------------------+--------------------------------------------------------------------------------+--------------+ +| Temporal | dimensional coordinate system containing a single time axis and used to | Temporal | +| | describe the temporal position of a point in the specified time units from a | | +| | specified time origin. | | ++-------------------+--------------------------------------------------------------------------------+--------------+ + +Coordinate system axis +'''''''''''''''''''''' + +A coordinate system is composed of an ordered set of coordinate system axes. Each of its axes is completely characterized by a unique combination of axis name, axis abbreviation, axis direction and axis unit of measure. The concept of coordinate axis requires some clarification. Consider an arbitrary x, y, z coordinate system. The x-axis may be defined as the locus of points with y = z = 0. This is easily enough understood if the x, y, z coordinate system is a Cartesian system and the space it describes is Euclidean. It becomes a bit more difficult to understand in the case of a strongly curved space, such as the surface of an ellipsoid, its geometry described by an ellipsoidal coordinate system (2D or 3D). Applying the same definition by analogy to the curvilinear latitude and longitude coordinates the latitude axis would be the equator and the longitude axis would be the prime meridian, which is not a satisfactory definition. Bearing in mind that the order of the coordinates in a coordinate tuple must be the same as the defined order of the coordinate axes, the i\ :sup:`th` coordinate axis of a coordinate system is defined as the locus of points for which all coordinates with sequence number not equal to 'i', have a constant value locally (whereby i = 1 ...n, and n is the dimension of the coordinate space). It will be evident that the addition of the word "locally" in this definition apparently adds an element of ambiguity and this is intentional. However, the definition of the coordinate parameter associated with any axis must be unique. The coordinate axis itself should not be interpreted as a unique mathematical object, the associated coordinate parameter should. + +Example: Geodetic latitude is defined as the "Angle from the equatorial plane to the perpendicular to the ellipsoid through a given point, northwards usually treated as positive". However, hen used in an ellipsoidal coordinate system the geodetic latitude axis will be described as pointing "north". In two different points on the ellipsoid the direction "north" will be a spatially different direction, but the concept of latitude is the same. + +Furthermore the specified direction of the coordinate axes is often only approximate; two geographic coordinate reference systems will make use of the same ellipsoidal coordinate system. These coordinate systems are associated with the earth through two different geodetic datums, which may lead to the two systems being slightly rotated w.r.t. each other. Usage of coordinate system axis names is constrained by geodetic custom in a number of cases, depending mainly on the coordinate reference system type. These constraints are shown in table below. This constraint works in two directions; for example the names "geodetic latitude" and "geodetic longitude" shall be used to designate the coordinate axis names associated with a geographic coordinate reference system. Conversely, these names shall not be used in any other context. @@ -358,7 +346,7 @@ CS CRS Permitted coordinate system axis names Cartesian Geocentric Geocentric X, Geocentric Y, Geocentric Z Spherical Geocentric Spherical Latitude, Spherical Longitude, Geocentric Radius Ellipsoidal Geographic Geodetic Latitude, Geodetic Longitude, Ellipsoidal height (if 3D) -Vertical Vertica Gravity-related height +Vertical Vertical Gravity-related height Vertical Vertical Depth Cartesian Projected Easting, Northing Cartesian Projected Westing, Southing @@ -372,7 +360,7 @@ A datum specifies the relationship of a coordinate system to the earth or, in so .. image:: /images/datum.PNG -Many subtypes of datum are specified: geodetic, vertical, engineering etc. Each datum subtype can be associated only with specific types of coordinate reference systems. A geodetic datum is used with three dimensional or horizontal (two-dimensional) coordinate reference systems, and requires an ellipsoid definition and a prime meridian definition. It is used to describe large portions of the earth?s surface up to the entire earth's surface. A vertical datum can only be associated with a vertical coordinate reference system. Image datum and engineering datum are both used in a local context only: to describe the origin of an image and the origin of an engineering (or local) coordinate reference system. +Many subtypes of datum are specified: geodetic, vertical, engineering etc. Each datum subtype can be associated only with specific types of coordinate reference systems. A geodetic datum is used with three dimensional or horizontal (two-dimensional) coordinate reference systems, and requires an ellipsoid definition and a prime meridian definition. It is used to describe large portions of the earth's surface up to the entire earth's surface. A vertical datum can only be associated with a vertical coordinate reference system. Image datum and engineering datum are both used in a local context only: to describe the origin of an image and the origin of an engineering (or local) coordinate reference system. **Vertical Datum** @@ -389,9 +377,9 @@ A prime meridian defines the origin from which longitude values are specified. M **Ellipsoid** -An ellipsoid is defined that approximates the surface of the geoid. Because of the area for which the approximation is valid ? traditionally regionally, but with the advent of satellite positioning often globally ? the ellipsoid is typically associated with Geographic and Projected CRSs. An ellipsoid specification shall not be provided if the datum type not geodetic. +An ellipsoid is defined that approximates the surface of the geoid. Because of the area for which the approximation is valid - traditionally regionally, but with the advent of satellite positioning often globally - the ellipsoid is typically associated with Geographic and Projected CRS. An ellipsoid specification shall not be provided if the datum type not geodetic. -One ellipsoid must be specified with every geodetic datum, even if the ellipsoid is not used computationally. The latter may be the case when a Geocentric CRS is used, e.g., in the calculation of satellite orbit and ground positions from satellite observations. Although use of a Geocentric CRS apparently obviates the need of an ellipsoid, the ellipsoid usually played a role in the determination of the associated geodetic datum. Furthermore one or more Geographic CRSs may be based on the same geodetic datum, which requires the correct ellipsoid the associated with any given geodetic datum. -An ellipsoid is defined either by its semi-major axis and inverse flattening, or by its semimajor axis and semi-minor axis. For some applications, for example small-scale mapping in atlases, a spherical approximation of the geoid?s surface is used, requiring only the radius of the sphere to be specified +One ellipsoid must be specified with every geodetic datum, even if the ellipsoid is not used computationally. The latter may be the case when a Geocentric CRS is used, e.g., in the calculation of satellite orbit and ground positions from satellite observations. Although use of a Geocentric CRS apparently obviates the need of an ellipsoid, the ellipsoid usually played a role in the determination of the associated geodetic datum. Furthermore one or more Geographic CRS may be based on the same geodetic datum, which requires the correct ellipsoid the associated with any given geodetic datum. +An ellipsoid is defined either by its semi-major axis and inverse flattening, or by its semi-major axis and semi-minor axis. For some applications, for example small-scale mapping in atlases, a spherical approximation of the geoid's surface is used, requiring only the radius of the sphere to be specified -Source for the above definitions: Spatial Referencing by Coordinates 2.0. Slightly edited. \ No newline at end of file +Source for the above definitions: Spatial Referencing by Coordinates 2.0. Slightly edited. diff --git a/docs/user/library/opengis/faq.rst b/docs/user/library/opengis/faq.rst index fb611b2c0e6..ba47e0d7135 100644 --- a/docs/user/library/opengis/faq.rst +++ b/docs/user/library/opengis/faq.rst @@ -4,10 +4,10 @@ OpenGIS FAQ Q: Relationship with "GeoAPI"? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -* GeoAPI was started in 2002 James McGill (who also set up GeoTools). The aim at that time was to provide common API for independent projects like GeoTools, deegree and OpenJump, allowing the easy exchange of code. +* GeoAPI was started in 2002 James McGill (who also set up GeoTools). The aim at that time was to provide common API for independent projects like GeoTools, Deegree and OpenJump, allowing the easy exchange of code. * Later on, the Open Geospatial Consortium started the "GO-1" project with a similar goal. The "Geospatial Object" project was led by Polexis which was at the time based in the United States. * Given the similarity between GO-1 and GeoAPI goals, we got in touch each other and managed to merge the two projects. -* Polexis produces the following official OGC specification based on GeoAPI 2.0: http://www.opengeospatial.org/standards/go +* Polexis produced the following official OGC specification based on GeoAPI 2.0: http://www.opengeospatial.org/standards/go * Later Polexis was bought by Sys Technology, with the new owner and priorities their investment in GeoAPI / GO-1 stopped. * The GO-1 / GeoAPI working group at OGC was dissolved due to lack of activity. * GeoTools contributors gradually took over the GeoAPI project and in GeoTools 2.7 folded these interfaces back into the GeoTools OpenGIS module diff --git a/docs/user/library/opengis/feature.rst b/docs/user/library/opengis/feature.rst index 2e88c0076f5..ac15a8859d5 100644 --- a/docs/user/library/opengis/feature.rst +++ b/docs/user/library/opengis/feature.rst @@ -17,7 +17,7 @@ Associations. .. image:: /images/feature_data_model.PNG -To directly create a **Feature** you can make use of **FeatureFactory**, or use a builder which makes things a little easier (as it fills in defaults):: +To directly create a ``Feature`` you can make use of ``FeatureFactory``, or use a builder which makes things a little easier (as it fills in defaults):: //create the builder SimpleFeatureBuilder builder = new SimpleFeatureBuilder(featureType); @@ -31,9 +31,9 @@ To directly create a **Feature** you can make use of **FeatureFactory**, or use //build the feature with provided ID SimpleFeature feature = builder.buildFeature( "fid.1" ); -In practice you can use a feature much like a java.util.Map to get and put values. The difference is that the "keys" are formally defined by the FeatureType (which helps us swap information between systems). +In practice you can use a feature much like a ``java.util.Map`` to get and put values. The difference is that the "keys" are formally defined by the ``FeatureType`` (which helps us swap information between systems). -This is a little bit easier with **SimpleFeature** which allows direct access to attribute values: +This is a little bit easier with ``SimpleFeature`` which allows direct access to attribute values:: feature.setAttribute( "turbidity", 3.7 ); Object value = feature.getAttribute( "turbidity" ); // returns double 3.7 stored above @@ -43,13 +43,13 @@ For more information see the examples listed in gt-main :doc:`../main/feature`. Simple Feature ^^^^^^^^^^^^^^ -Most GIS data does not need a full dynamic type system with associations, operations, multiple values. With this in mind we have a "simple" extension of Feature and FeatureType providing to represent this kind of information. +Most GIS data does not need a full dynamic type system with associations, operations, multiple values. With this in mind we have a "simple" extension of ``Feature`` and ``FeatureType`` providing to represent this kind of information. -A "simple" feature is an object that can be drawn on a map (ie a feature) that does not contain any complicated internal structure. A SimpleFeature is "flat" recording of key value pairs. At least one of the values should be a Geometry, and the list of keys is known ahead of time. +A "simple" feature is an object that can be drawn on a map (i.e. a feature) that does not contain any complicated internal structure. A ``SimpleFeature`` is "flat" recording of key value pairs. At least one of the values should be a ``Geometry``, and the list of keys is known ahead of time. -SimpleFeature may be used when: +``SimpleFeature`` may be used when: -* a feature's properties are limited to mandatory GeometryAttribute and Attribute (no complex attributes or multiplicity allowed). +* a feature's properties are limited to mandatory ``GeometryAttribute`` and ``Attribute`` (no complex attributes or multiplicity allowed). * Attributes values may be null; but each attribute must be represented * order of attribute values is considered significant allowing values to be looked up by attribute name, or by the order they are listed * These restrictions match the abilities of a simple shapefile or database table @@ -58,7 +58,7 @@ Here are the additional methods made available: .. image:: /images/feature_simple.PNG -Here is an example of constructing a SimpleFeatureType:: +Here is an example of constructing a ``SimpleFeatureType``:: SimpleFeatureTypeBuilder b = new SimpleFeatureTypeBuilder(); diff --git a/docs/user/library/opengis/filter.rst b/docs/user/library/opengis/filter.rst index 7eac00577ed..e0848a2891c 100644 --- a/docs/user/library/opengis/filter.rst +++ b/docs/user/library/opengis/filter.rst @@ -1,11 +1,11 @@ Filter ------ -The filter api defines the first step of a Query, it is used when requesting data from a DataStore +The filter API defines the first step of a Query, it is used when requesting data from a DataStore or Catalog. The Filter specification itself is maintained by the OGC and is used in a number of their specifications (Catalog, WFS, and so on). -In practice **Filter** is used to select features that are of interest and the **Expression** to +In practice ``Filter`` is used to select features that are of interest and the ``Expression`` to drill in and access information. Although this forms a closed set of classes (for interoperability), you can extend the system with @@ -21,8 +21,8 @@ References: Introduction ^^^^^^^^^^^^ -The Filer specification defines a the **filter** data structure used to perform selection. -A subset of this data structure is used to define **expressions** to define, calculate or +The Filter specification defines the ``filter`` data structure used to perform selection. +A subset of this data structure is used to define ``expressions`` to define, calculate or extract information. * Here is an example of using filter and expression together:: @@ -35,7 +35,6 @@ extract information. public void visit( SimpleFeature feature ){ Expression expression = ff.property( "NAME" ); String name = expression.evaulate( feature, String.class ); - System.out.println( feature.getID() + " is named: "+ name ); } }, null ); @@ -88,9 +87,9 @@ extract information. Expression expression = ff.literal("#FFFFFF"); Color color = expression.evaluate( feature, Color.class ); - * You can also use a Filter on normal Java objects (ie POJOs) + * You can also use a Filter on normal Java objects (i.e. POJOs) - If you are willing to write custom code you can define your own PropertyAccessor + If you are willing to write custom code you can define your own ``PropertyAccessor`` to teach filters how to work with your own data structures Filter @@ -132,7 +131,7 @@ only allows property values to be compared. FilterFactory ''''''''''''' -By using the FilterFactory you can create objects by hand. The FilterFactory interface is limited +By using the ``FilterFactory`` you can create objects by hand. The ``FilterFactory`` interface is limited to strict specification compliance.:: FilterFactory ff = CommonFactoryFinder.getFilterFactory( GeoTools.getDefaultHints() ); @@ -141,14 +140,14 @@ to strict specification compliance.:: FilterFactory2 '''''''''''''' -In the real world we need to go beyond the specification. FilterFactory2 will let you work with JTS +In the real world we need to go beyond the specification. ``FilterFactory2`` will let you work with JTS Geometry instances (the specification is only defined to work with ISO Geometry).:: FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2( GeoTools.getDefaultHints() ); Filter filter = ff.contains( ff.property( "THE_GEOM"), ff.literal( geometry ) ); -FilterFactory2 also let's you define your filters in a bit more of a free form manner. In the -specification all operations must have the PropertyName expression first. +``FilterFactory2`` also let's you define your filters in a bit more of a free form manner. In the +specification all operations must have the ``PropertyName`` expression first. XML ''' @@ -163,7 +162,7 @@ like this:: -To parse an xml stream:: +To parse an XML stream:: Configuration configuration = new org.geotools.filter.v1_0.OGCConfiguration(); Parser parser = new Parser( configuration ); @@ -226,11 +225,11 @@ Null vs Nil ''''''''''' A related topic to comparing a property value is testing to see if a property *has* a value -at all. In the simple case PropertyIsNull can be used to check that a property exists; and +at all. In the simple case ``PropertyIsNull`` can be used to check that a property exists; and that the value is empty. We also have the situation where a property is allowed to occur zero or many times; in this case -we want a nice clear way to check that a Property does not exsit at all (that is occur = zero). +we want a nice clear way to check that a Property does not exist at all (that is occur = zero). .. literalinclude:: /../src/main/java/org/geotools/opengis/FilterExamples.java :language: java @@ -248,24 +247,24 @@ when constructing your filter as shown below. :start-after: // caseSensitive start :end-before: // caseSensitive end -This capability was added by the Filter 1.1 specificaiton. +This capability was added by the Filter 1.1 specification. MatchAction ''''''''''' -All filters that implement the MultiValuedFilter interface, support filtering on operands that +All filters that implement the ``MultiValuedFilter`` interface, support filtering on operands that return multiple values on evaluation. The way these filters handle multiple values can be modified -through the 'MatchAction' property. +through the ``MatchAction`` property. The property can be retrieved through a simple getter:: filter.getMatchAction() -MatchAction has three possible values: +``MatchAction`` has three possible values: -* MatchAction.ANY +* ``MatchAction.ANY`` - When no MatchAction is specified, it is set to the default MatchAction.ANY. + When no ``MatchAction`` is specified, it is set to the default ``MatchAction.ANY``. Evaluates to true if any possible combinations of operands evaluates to true: @@ -274,7 +273,7 @@ MatchAction has three possible values: :start-after: // matchActionAny start :end-before: // matchActionAny end -* MatchAction.ALL +* ``MatchAction.ALL`` Evaluates to true if all possible combinations of operands evaluates to true.: @@ -283,7 +282,7 @@ MatchAction has three possible values: :start-after: // matchActionAll start :end-before: // matchActionAll end -* MatchAction.ONE +* ``MatchAction.ONE`` Evaluates to true if exactly one possible combination of values evaluates to true: @@ -294,7 +293,7 @@ MatchAction has three possible values: Multiple values are possible in a couple situations: when working with application schemas, or working directly with java objects. When an expression is evaluated against rich content -of this nature child references may return a multi-valued attribue. +of this nature child references may return a multi-valued attribute. As an example this filter tests whether all children are older than 12: @@ -329,7 +328,7 @@ about it. Don't include any content. Would return an empty Collection if used in a Query. These values are often used as default values in other data structures - for example the default -value for Query.getFilter() is Filter.INCLUDES. +value for ``Query.getFilter()`` is ``Filter.INCLUDES``. * These are static constants and do not require a constructor: @@ -338,7 +337,7 @@ value for Query.getFilter() is Filter.INCLUDES. :start-after: // includeExclude start :end-before: // includeExclude end -* You can check for these values when optimising:: +* You can check for these values when optimizing:: public void draw( Filter filter ){ if( filter == Filter.EXCLUDES ) return; // draw nothing @@ -354,15 +353,15 @@ value for Query.getFilter() is Filter.INCLUDES. System.out.println( "Selected "+ feature.getId(); } -Identifer -^^^^^^^^^ +Identifier +^^^^^^^^^^ The other interesting way to use a filter to more as a "selection" in the GIS sense. In this -case rather than evaluating the attributes we will directly match the FeatureId. +case rather than evaluating the attributes we will directly match the ``FeatureId``. .. image:: /images/filter_id.PNG -The most common test is against FeatureId: +The most common test is against ``FeatureId``: .. literalinclude:: /../src/main/java/org/geotools/opengis/FilterExamples.java :language: java @@ -372,7 +371,7 @@ The most common test is against FeatureId: Formally this style of Id matching is not supposed to be mixed with the traditional attribute based evaluation (such as a bounding box filter). -You can also use a Set: +You can also use a ``Set``: .. literalinclude:: /../src/main/java/org/geotools/opengis/FilterExamples.java :language: java @@ -380,9 +379,9 @@ You can also use a Set: :end-before: // idSet end The other place where identifiers are used are when working with versioned information. In this -case a ResourceId is used that consists of both a "fid" and a "rid". +case a ``ResourceId`` is used that consists of both a ``fid`` and a ``rid``. -ResourceId can be used to explore versioned information: +``ResourceId`` can be used to explore versioned information: .. literalinclude:: /../src/main/java/org/geotools/opengis/FilterExamples.java :language: java @@ -416,8 +415,8 @@ are a new addition for GeoTools 8.0. The gt-main module supplies some of the implementation classes we will need: -* DefaultIntant: this is an implementation of Instant used to represent a single point in time. -* DefaultPeriod: this is an implementation of Period used to reresent a range in time +* ``DefaultIntant``: this is an implementation of Instant used to represent a single point in time. +* ``DefaultPeriod``: this is an implementation of Period used to represent a range in time Here is an example illustrating their construction and use with temporal filters: @@ -440,7 +439,7 @@ You evaluate an expression against a feature:: Object value = expression.evaluate( feature ); -Or against a Java Bean, or even java.util.Map:: +Or against a Java Bean, or even ``java.util.Map``:: Object value = expression.evaluate( bean ); @@ -459,9 +458,9 @@ As an example of conversion here is an expression converting a String to a Color Expressions are so useful that you will see them pop up in many parts of GeoTools. They are used by styles to select which data for portrayal and so forth. -* PropertyName +* ``PropertyName`` - The PropertyName expression is used to extract information from your data model. + The ``PropertyName`` expression is used to extract information from your data model. The most common use is to access a Feature Property.:: @@ -489,11 +488,11 @@ by styles to select which data for portrayal and so forth. * X-Paths and Namespaces - It is possible to use X-Path expressions in filters. This is particularly useful for evaluating nested - properties against complex features. To evaluate X-path expressions, an - org.xml.sax.helpers.NamespaceSupport object is needed to associate prefixes with Namespace URI's. + It is possible to use XPath expressions in filters. This is particularly useful for evaluating nested + properties against complex features. To evaluate XPath expressions, an + ``org.xml.sax.helpers.NamespaceSupport`` object is needed to associate prefixes with namespace URI's. - FilterFactory2 supports the creation of PropertyName expression with associated Namespace context + ``FilterFactory2`` supports the creation of ``PropertyName`` expression with associated namespace context information.:: FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2( GeoTools.getDefaultHints() ); @@ -503,18 +502,18 @@ by styles to select which data for portrayal and so forth. Filter filter = ff.greater(ff.property("foo:city/foo:size",namespaceSupport),ff.literal(300000)); - Namespace context information can be retrieved from an existing PropertyName expression:: + Namespace context information can be retrieved from an existing ``PropertyName`` expression:: PropertyName propertyName = ff.property("foo:city/foo:size", namespaceSupport); NamespaceSupport namespaceSupport2 = propertyName.getNamespaceContext(); // now namespaceSupport2 == namespaceSupport ! - PropertyName.getNamespaceContext() will return null when the PropertyName expression does not + ``PropertyName.getNamespaceContext()`` will return null when the ``PropertyName`` expression does not contain or does not support Namespace context information. * Functions - You can create functions using FilterFactory2:: + You can create functions using ``FilterFactory2``:: FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2( GeoTools.getDefaultHints() ); @@ -534,22 +533,21 @@ by styles to select which data for portrayal and so forth. What can you do when a Function is not found - creating the Function will fail! - The Symbology Encoding 2.0 specification has the concept of a fallbackValue - while we have not - made it available via the factory yet you can use the FunctionFinder.:: + The Symbology Encoding 2.0 specification has the concept of a ``fallbackValue`` - while we have not + made it available via the factory yet you can use the ``FunctionFinder``.:: FunctionFinder finder = new FunctionFinder(null); finder.findFunction("pi", Collections.emptyList(), ff.literal(Math.PI)); - Please note that the literal value provided above is only used when the expression is evaluated - in context of a service that does not support the **pi()** function. + .. note:: that the literal value provided above is only used when the expression is evaluated in context of a service that does not support the ``pi()`` function. FilterVisitor ^^^^^^^^^^^^^ -FilterVisitor is used to traverse the filter data structure. Common uses include: +``FilterVisitor`` is used to traverse the filter data structure. Common uses include: * Asking questions about the content of a Filter -* Performing analysis and optimisations on a Filter (say replacing "1+1" with "2" ) +* Performing analysis and optimizations on a Filter (say replacing "1+1" with "2" ) * Transforming the filter (think search and replace) .. sidebar:: Visitor @@ -597,9 +595,9 @@ databases have different native capabilities. For any functionality that cannot natively GeoTools will perform the work locally in Java. Indeed for simple file formats almost everything occurs locally in Java. -The **FilterCapabilities** data structure is used to describe the native abilities of a -WebFeatureService. We also use this data structure to describe the abilities of the different -JDBC DataStores for working with Databases. Of special interest is the list of FunctionNames +The ``FilterCapabilities`` data structure is used to describe the native abilities of a +``WebFeatureService``. We also use this data structure to describe the abilities of the different +JDBC ``DataStores`` for working with Databases. Of special interest is the list of ``FunctionNames`` supported. .. image:: /images/filter_capabilities.PNG diff --git a/docs/user/library/opengis/geometry.rst b/docs/user/library/opengis/geometry.rst index df9fc9de562..77767eefa5d 100644 --- a/docs/user/library/opengis/geometry.rst +++ b/docs/user/library/opengis/geometry.rst @@ -11,9 +11,9 @@ classes in a casual use of GeoTools. That is it - just three of them: -* Envelope represents a an extent with an upper and lower bounds -* BoundingBox specifically represents a two dimensional extent -* DirectPosition is a location on the earth defined using a set of ordinates, and a CoordinateReferenceSystem so we can tell what the numbers mean +* ``Envelope`` represents an extent with an upper and lower bounds +* ``BoundingBox`` specifically represents a two dimensional extent +* ``DirectPosition`` is a location on the earth defined using a set of ordinates, and a ``CoordinateReferenceSystem`` so we can tell what the numbers mean ISO 19107 ^^^^^^^^^ @@ -24,24 +24,24 @@ isolate common qualities. * High Level "Geometry" classes - * Point - * Curve - * Surface + * ``Point`` + * ``Curve`` + * ``Surface`` * Composed of smaller segments or patches - * Point is defined by a single DirectPosition - * Curve is defined as a series of CurveSegment - * Surface is defined as a series of SurfacePatch + * ``Point`` is defined by a single ``DirectPosition`` + * ``Curve`` is defined as a series of ``CurveSegment`` + * ``Surface`` is defined as a series of ``SurfacePatch`` * There is a wide range of options when defining a segment or patch - * LineString - a simple list of LineSegments (just like we are used to) - * SplineCurve - a range of common splines such as BSpline - * Conic - very useful for great circles in GIS - * ArcString - common with CAD drawings + * ``LineString`` - a simple list of ``LineSegments`` (just like we are used to) + * ``SplineCurve`` - a range of common splines such as ``BSpline`` + * ``Conic`` - very useful for great circles in GIS + * ``ArcString`` - common with CAD drawings -Here is an example of the types defined around Geometry, see if you can spot Point, Curve and Surface mentioned above. +Here is an example of the types defined around ``Geometry``, see if you can spot ``Point``, ``Curve`` and ``Surface`` mentioned above. .. image:: /images/geometry_iso.PNG @@ -71,7 +71,7 @@ These interfaces are many, varied, and well documented. The problem is they are * Q: I need to represent Curves? - Have a look at our JTS utility class, there are methods that help you define a JTS LineString + Have a look at our JTS utility class, there are methods that help you define a JTS ``LineString`` based on a curve formula. * Q: Which implementation should I use? @@ -80,7 +80,7 @@ These interfaces are many, varied, and well documented. The problem is they are (because you are limiting your project to ISO19107 only interfaces) they are not recommended. - * The JTS-Wrapper implementation is field tested, but limited to + * The ``JTSWrapper`` implementation is field tested, but limited to constructs similar to JTS. On the bright side because it always uses the latest JTS the performance of this implementation has improved over time. diff --git a/docs/user/library/opengis/model.rst b/docs/user/library/opengis/model.rst index 4f2d246df65..03ffd7f42ed 100644 --- a/docs/user/library/opengis/model.rst +++ b/docs/user/library/opengis/model.rst @@ -3,9 +3,9 @@ Model GeoTools provides a clear separation between: -* data model - **feature** responsible for holding values -* query model - **filter** and **expression** used to select content and drill in and retrieve values -* metadata model - **feature type** describing contents in sufficient details for validation and query construction +* data model - ``feature`` responsible for holding values +* query model - ``filter`` and ``expression`` used to select content and drill in and retrieve values +* metadata model - ``feature type`` describing contents in sufficient details for validation and query construction References: @@ -16,24 +16,24 @@ References: Comparison to Java: -* The data structure Feature is used to hold information. Each Feature "belongs to" a FeatureType which is used to describe valid contents. This is a dynamic type system because FeatureType is a data structure we can define at runtime. +* The data structure Feature is used to hold information. Each Feature "belongs to" a ``FeatureType`` which is used to describe valid contents. This is a dynamic type system because ``FeatureType`` is a data structure we can define at runtime. * The data structure Object is used to hold information. Each Object "belongs to" a Class which is used to describe valid contents. This is a static type system because Class is a data structure we need to compile before the application is started. -========================= ============================================= ======================================= -Java Class System GeoTools Feature Model Java Beans System -========================= ============================================= ======================================= -static type system dynamic type system dynamic type system -Object SimpleFeature Object -(reflection) Attribute (reflection) -(reflection) GeometryAttribute (reflection) -Class SimpleFeatureType BeanInfo -Field AttributeDescriptor PropertyDescriptor -Field GeometryAttributeDescriptor PropertyDescriptor -Method OperationType MethodDescriptor -Field.getType() AttributeDescriptor.getType().getBinding() PropertyDescriptor.getPropertyType() -Field.getName() AttributeDescriptor.getName().getLocalName() PropertyDescriptor.getName() -Field.get( obj ) expression.evaulate( feature, Class ) descriptor.getReadMethod().invoke(obj) -========================= ============================================= ======================================= +========================= ================================================= =========================================== +Java Class System GeoTools Feature Model Java Beans System +========================= ================================================= =========================================== +static type system dynamic type system dynamic type system +``Object`` ``SimpleFeature`` Object +(reflection) ``Attribute`` (reflection) +(reflection) ``GeometryAttribute`` (reflection) +``Class`` ``SimpleFeatureType`` ``BeanInfo`` +``Field`` ``AttributeDescriptor`` ``PropertyDescriptor`` +``Field`` ``GeometryAttributeDescriptor`` ``PropertyDescriptor`` +``Method`` ``OperationType`` ``MethodDescriptor`` +``Field.getType()`` ``AttributeDescriptor.getType().getBinding()`` ``PropertyDescriptor.getPropertyType()`` +``Field.getName()`` ``AttributeDescriptor.getName().getLocalName()`` ``PropertyDescriptor.getName()`` +``Field.get(obj)`` ``expression.evaulate(feature,Class)`` ``descriptor.getReadMethod().invoke(obj)`` +========================= ================================================= =========================================== Java example: diff --git a/docs/user/library/opengis/progress.rst b/docs/user/library/opengis/progress.rst index ed735c6fafe..9c9be2c0f6f 100644 --- a/docs/user/library/opengis/progress.rst +++ b/docs/user/library/opengis/progress.rst @@ -1,21 +1,21 @@ Progress -------- -The callback object ProgressListener is used to report on long running operations and provide a chance for the end user to cancel them. +The callback object ``ProgressListener`` is used to report on long running operations and provide a chance for the end user to cancel them. There are several implementations available in GeoTools: -* ProgressWindow - provides a swing dialog showing operation progress -* ProgressPrinter - reports operation progress to standard out -* ProgressMailer - will email when the operation is completed +* ``ProgressWindow`` - provides a swing dialog showing operation progress +* ``ProgressPrinter`` - reports operation progress to standard out +* ``ProgressMailer`` - will email when the operation is completed -As you can see these really are intended for operations that may take minuets to complete. +As you can see these really are intended for operations that may take minutes to complete. -There are a couple implementations of direct interest to implementors: +There are a couple implementations of direct interest to implementers: -* NullProgressListener - null object to use when you are not interested -* SubProgressListener - used by implementors when delegating a portion of work to a sub operation -* DelegateProgressListener +* ``NullProgressListener`` - null object to use when you are not interested +* ``SubProgressListener`` - used by implementers when delegating a portion of work to a sub operation +* ``DelegateProgressListener`` Example use:: @@ -37,17 +37,17 @@ Example use:: This code could be called using: -* doSomething( new ProgressWindow( null ) ); // from a Swing Application -* doSomething( new ProgressMailer( mailserver, emailAddress ) ); // from a web application -* doSomething( new ProgressPrinter() ); // for a command line application -* doSomething( new NullProgressListener() ); // if you don't care +* ``doSomething( new ProgressWindow( null ) ); // from a Swing Application`` +* ``doSomething( new ProgressMailer( mailserver, emailAddress ) ); // from a web application`` +* ``doSomething( new ProgressPrinter() ); // for a command line application`` +* ``doSomething( new NullProgressListener() ); // if you don't care`` Additional adapters for SWT project are available in the uDig project. Using ProgressListener to Cancel ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The ProgressListener is a general user interface callback object; as such it allows the a user to cancel a long running operation.:: +The ``ProgressListener`` is a general user interface callback object; as such it allows a user to cancel a long running operation.:: final ProgressListener progress= new ProgressWindow( null ); Thread worker = new Thread( new Runnable(){ diff --git a/docs/user/library/opengis/se.rst b/docs/user/library/opengis/se.rst index 5aeeadd48e3..7569c259092 100644 --- a/docs/user/library/opengis/se.rst +++ b/docs/user/library/opengis/se.rst @@ -36,34 +36,34 @@ from the feature, and drawing using the information provided here. .. image:: /images/symbolizer.PNG -.. note:: The Symbology Encoding standard does its best to render something in all cases; thus a PointSymbolizer applied to a Polygon will draw a point in the centre, more interestingly a LineSymbolizer applied to a point will draw a small line (of a fixed size) at the indicated location. +.. note:: The Symbology Encoding standard does its best to render something in all cases; thus a PointSymbolizer applied to a Polygon will draw a point in the center, more interestingly a LineSymbolizer applied to a point will draw a small line (of a fixed size) at the indicated location. The available symbolizers are: -* TextSymbolizer +* ``TextSymbolizer`` - Used to control the labeling system; labels are generated by TextSymbolizers and + Used to control the labeling system; labels are generated by ``TextSymbolizers`` and thrown into the rendering engine which detect overlaps, sorts things out according to priorities you have defined and decides on a final label placement. -* LineSymbolizer +* ``LineSymbolizer`` Used to control how lines (or edges) are drawn. -* PolygonSymbolizer +* ``PolygonSymbolizer`` Used to control how solid shapes are drawn. -* PointSymbolizer +* ``PointSymbolizer`` Used to draw a point location, the actual graphic drawn is referred to as a Mark with the option to use some well known marks (circle, square etc..) or your own external graphics such as PNG icons. -* RasterSymbolizer +* ``RasterSymbolizer`` Used to control the rendering of raster data with full "color map" control. -Here is a quick example showing the creation of a PointSymbolizer: +Here is a quick example showing the creation of a ``PointSymbolizer``: .. literalinclude:: /../src/main/java/org/geotools/opengis/StyleExamples.java :language: java @@ -73,7 +73,7 @@ Here is a quick example showing the creation of a PointSymbolizer: Fill '''' -Fill is used both to fill a polygon, and also when creating greater control over Mark appearance (where it can be used to define the interior of a Mark). +``Fill`` is used both to fill a polygon, and also when creating greater control over Mark appearance (where it can be used to define the interior of a Mark). .. image:: /images/fill.PNG @@ -81,19 +81,19 @@ Fill is used both to fill a polygon, and also when creating greater control over Stroke '''''' -In a similar fashion Stroke is used to render edges (either polygon edges, linestrings or the outside edge of a Mark). +In a similar fashion ``Stroke`` is used to render edges (either polygon edges, lines or the outside edge of a Mark). .. image:: /images/stroke.PNG Graphic ''''''' -The idea of a Graphic is used in a number of contexts when drawing: +The idea of a ``Graphic`` is used in a number of contexts when drawing: -* Graphic: As an "icon" when rendering a point location -* GraphicFilter: As a pattern when filling an area -* GraphicStroke: As a pattern when drawing along a line -* GraphicLegend: As a an entry in a legend (GeoTools does not use this one yet) +* ``Graphic``: As an "icon" when rendering a point location +* ``GraphicFilter``: As a pattern when filling an area +* ``GraphicStroke``: As a pattern when drawing along a line +* ``GraphicLegend``: As an entry in a legend (GeoTools does not use this one yet) Although the symbology encoding specification defines the above distinct kinds of Graphic the GeoTools library does not distinguish between them at this time. @@ -101,21 +101,21 @@ library does not distinguish between them at this time. .. image:: /images/graphic.PNG -The interesting part is the list of **GraphicalSymbol**. This list is considered in order, with +The interesting part is the list of ``GraphicalSymbol``. This list is considered in order, with the rendering engine selecting the first format it is able to draw allowing you to order your highest quality -**ExternalGraphic** formats first (such as SVG or a true type font) and moving on to lower quality choices such as PNG files and -finally ending with a fallback **Mark**. +``ExternalGraphic`` formats first (such as SVG or a true type font) and moving on to lower quality choices such as PNG files and +finally ending with a fallback ``Mark``. -* ExternalGraphic +* ``ExternalGraphic`` - In addition to allowing you the use of svg and image formats there is the interesting use of *inline content* in the form of - a Java Icon allowing you greater control. You also have a chance to apply colour replacements (which cab be used to render a - black and white image into a set colour as needed. + In addition to allowing you the use of SVG and image formats there is the interesting use of *inline content* in the form of + a Java Icon allowing you greater control. You also have a chance to apply color replacements (which cab be used to render a + black and white image into a set color as needed. -* Mark +* ``Mark`` Check the javadocs for the list of well known names (such as "circle" or "square"). Of interest is the use of - an **ExternalMark** in which the mark index can be used to refer to a specific character entry in a true type font. + an ``ExternalMark`` in which the mark index can be used to refer to a specific character entry in a true type font. StyleVisitor ^^^^^^^^^^^^ @@ -126,7 +126,7 @@ A style visitor is defined allowing you to traverse the style data structure. Fo StyleFactory ^^^^^^^^^^^^ -Objects for symbology encoding are created using a StyleFactory:: +Objects for symbology encoding are created using a ``StyleFactory``:: org.opengis.style.StyleFactory sf = CommonFactoryFinder.getStyleFactory(null); FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null); diff --git a/docs/user/library/opengis/text.rst b/docs/user/library/opengis/text.rst index a9a2eb00cc8..cea5a1150d5 100644 --- a/docs/user/library/opengis/text.rst +++ b/docs/user/library/opengis/text.rst @@ -1,18 +1,18 @@ Text ---- -Many projects use Java String to represent text. This page goes over some of the String alternative used to text in a consistent manner. +Many projects use Java ``String`` to represent text. This page goes over some of the alternatives used to handle text in a consistent manner. -Enum -^^^^ +``Enum`` +^^^^^^^^^ -The first alternative is a normal Java 5 **enum**. We use enumerations to represent a frozen set of machine readable text. +The first alternative is a normal Java 5 ``Enum``. We use enumerations to represent a frozen set of machine readable text. The key idea here is: * this is machine readable; you don't need to show this to your end users * it is frozen; literally it is boiled into the jar you download and you cannot modify the list of defined codes in any way -* If you are reading any of the ISO specifications you will find this concept is called an **Enum** there as well, our use agrees with typical Java practice. +* If you are reading any of the ISO specifications you will find this concept is called an ``Enum`` there as well, our use agrees with typical Java practice. Here is an example for reference:: @@ -23,7 +23,7 @@ Here is an example for reference:: RANDOM } -As this set of text form directives to a rendering engine on handling overlapping images they are represented as an Enum. +As this set of text form directives to a rendering engine on handling overlapping images they are represented as an ``Enum``. * The "vocabulary" of allowed text values is fixed at compile time (and is well documented for those implementing a rendering engine). * As this text is intended to direct a rendering engine the entries are considered machine readable. @@ -33,13 +33,13 @@ An easy test to see if something is considered machine readable is to consider i CodeList ^^^^^^^^ -A CodeList is used to represent an extensible set of machine readable text. +A ``CodeList`` is used to represent an extensible set of machine readable text. -In pragmatic terms this is behaves just like a Java 5 Enum, except that you can add to it at runtime. +In pragmatic terms this is behaves just like a Java 5 ``Enum``, except that you can add to it at runtime. -The ISO specifications call this concept is a CodeList as well, +The ISO specifications call this concept is a ``CodeList`` as well, -Here is an example of a CodeList:: +Here is an example of a ``CodeList``:: public final class SortOrder extends CodeList { private static final long serialVersionUID = 7840334200112859571L; @@ -56,13 +56,13 @@ Here is an example of a CodeList:: } } -The above implementation is actually very similar to the definition of an Enum and can give you some insight into have Enums are represented as Objects by Java. +The above implementation is actually very similar to the definition of an ``Enum`` and can give you some insight into have ``Enum``\ s are represented as ``Object``\ s by Java. -The difference here is that your application can add additional SortOrders at runtime:: +The difference here is that your application can add additional ``SortOrder``\ s at runtime:: SortOrder order = SortOrder.valueOf( SortOrder.class, "NATURAL" ); -Once again a CodeList is considered: +Once again a ``CodeList`` is considered: * Machine Readable - the text values are intended for programs not people * Open ended, application code can add additional values to the "vocabulary" @@ -72,9 +72,9 @@ String String also has a place, in this case for free form machine readable text. Good examples are common query language "query" strings, or version numbers which change with each release. -Please note that we are not using Strings to communicate to the end user, we have a special class (InternationalString) to address Internationalization issues. +.. note:: We are not using ``Strings`` to communicate to the end user, we have a special class (``InternationalString``) to address internationalization issues. -The ISO specifications call this concept a **CharacterString**. However you have to be careful and read how they are using it on a case by case basis. Our use does not agree with typical Java practice; we are reserving the use of String for machine readable text. +The ISO specifications call this concept a ``CharacterString``. However you have to be careful and read how they are using it on a case by case basis. Our use does not agree with typical Java practice; we are reserving the use of String for machine readable text. Here is an example:: @@ -85,20 +85,20 @@ Here is an example:: With this in mind String is considered: * Machine readable (the values are not translated!) -* Freeform (i.e. does not belong to a set vocabulary of defined values) +* Free form (i.e. does not belong to a set vocabulary of defined values) InternationalString ^^^^^^^^^^^^^^^^^^^ -An **InternationalString** is used to represent free form human readable text. The InternationalString interface makes every translation of the text available through one class. +An ``InternationalString`` is used to represent free form human readable text. The ``InternationalString`` interface makes every translation of the text available through one class. -The ISO specifications call this concept a CharacterString, but once again you need to check how they are using it. +The ISO specifications call this concept a ``CharacterString``, but once again you need to check how they are using it. -To use an InternationalString with the current locale:: +To use an ``InternationalString`` with the current locale:: return title.toString(); -To use the InternationalString with a different locale:: +To use the ``InternationalString`` with a different locale:: return title.toString( locale ); @@ -109,4 +109,4 @@ With this in mind International String is considered: * Human Readable * Free form -We have a number of implementations available, backed on properties files and such like. \ No newline at end of file +We have a number of implementations available, backed on properties files and such like. diff --git a/docs/user/library/opengis/unit.rst b/docs/user/library/opengis/unit.rst index 4a403eb3044..b34e16db688 100644 --- a/docs/user/library/opengis/unit.rst +++ b/docs/user/library/opengis/unit.rst @@ -1,9 +1,9 @@ Unit ---- -GeoTools makes use of a formal Unit library in order to safely work with values, and minimise accidentally confusing distance with angle (for example). +GeoTools makes use of a formal Unit library in order to safely work with values, and minimize accidentally confusing distance with angle (for example). -GeoTools has patiently waited for the Java Community Process to agree on adding a Unit library into Java and has sat through. These efforts have stalled out repeatedly, but have produced working code - in part thanks to the excellent **JScience** project. +GeoTools has patiently waited for the Java Community Process to agree on adding a Unit library into Java and has sat through. These efforts have stalled out repeatedly, but have produced working code - in part thanks to the excellent ``JScience`` project. References: @@ -11,14 +11,14 @@ References: * JSR-108 Withdrawn 2004 (http://jcp.org/en/jsr/detail?id=108) * JSR-275 Rejected March 2010 (http://jcp.org/en/jsr/detail?id=275) -Here is a quick example using Système international d'unités (SI) commonly known as metric. +Here is a quick example using "Système International d'Unités" (SI) commonly known as metric.:: // let us work in km - we will adjust the base unit METER Unit km = SI.KILO(SI.METER); Quantity shortJog = Measure.valueOf( 5, km ); -We can also set out a distance in NonSI units:: +We can also set out a distance in ``NonSI`` units:: Quantity afternoonWalk = Measure.valueOf( 6, NonSI.MILE ); @@ -27,9 +27,9 @@ And safely grab values out (using a common unit):: double jog = shortJog.doubleValue( SI.METER ); double walk = afternoonWalk.doubleValue( SI.METER ); -Behind the scenes it obviously performs a conversion; we can do that ourself:: +Behind the scenes it obviously performs a conversion; we can do that ourselves:: UnitConverter mileToKm = NonSI.MILE.getConverterTo( SI.KILO(SI.METER) ); double kms = mileToKm.convert( miles ); -The library is powerful and supports currency and compound units. \ No newline at end of file +The library is powerful and supports currency and compound units. diff --git a/docs/user/library/referencing/3d.rst b/docs/user/library/referencing/3d.rst index 412918df8ec..baf37acd8d3 100644 --- a/docs/user/library/referencing/3d.rst +++ b/docs/user/library/referencing/3d.rst @@ -5,10 +5,10 @@ Experimental support for 3d referencing math transforms. **License** -The gt-referencing-3d module is disributed under the LGPL license (as described in :doc:`welcome `). +The ``gt-referencing-3d`` module is distributed under the LGPL license (as described in :doc:`welcome `). Some code and data in the gt-referencing-3d plugin are derived from NGA/NASA work available for unlimited distribution. References: -* http://earth-info.nima.mil/GandG/wgs84/gravitymod/. \ No newline at end of file +* http://earth-info.nima.mil/GandG/wgs84/gravitymod/. diff --git a/docs/user/library/referencing/axis.rst b/docs/user/library/referencing/axis.rst index 5e2b13e8371..496007c66b3 100644 --- a/docs/user/library/referencing/axis.rst +++ b/docs/user/library/referencing/axis.rst @@ -1,7 +1,7 @@ Axis ---- -A quick page to help take apart the CoordinateReferenceSystem object and figure out what the raw data is measuring. +A quick page to help take apart the ``CoordinateReferenceSystem`` object and figure out what the raw data is measuring. This is most often phrased as the question "What axis is X?" on our mailing list. @@ -16,18 +16,19 @@ World to Screen We want to set up the following: -* Create a "screen" CoordinateReferenceSystem using DISPLAY_X and DISPLAY_Y as axis -* Construct a MathTransform transforming from your Data's CoordinateReferenceSystem to the "screen" +* Create a "screen" ``CoordinateReferenceSystem`` using ``DISPLAY_X`` and ``DISPLAY_Y`` as axis +* Construct a ``MathTransform`` transforming from your data's ``CoordinateReferenceSystem`` to the "screen" It is often easier to treat the problem in two steps: 1. Make a "viewport" model recording the location on the world you are displaying, - For your first cut capture this "viewport" using DefaultGeographicCRS.WGS84:: + For your first cut capture this "viewport" using + ``DefaultGeographicCRS.WGS84``:: MathTransform data2world = CRS.findMathTransform( crs, DefaultGeographicCRS.WGS84 ); -2. Construct a MathTransform from your "viewport" CRS to the "screen" CRS.:: +2. Construct a ``MathTransform`` from your "viewport" CRS to the "screen" CRS.:: AffineTransform2D world2screen = new AffineTransform2D(); // start with identity transform world2screen.translate( viewport.minLong, viewport.maxLat ); // relocate to the viewport @@ -37,7 +38,7 @@ It is often easier to treat the problem in two steps: In the OGC Geographic Objects specification, the "viewport" CRS is named objective CRS and the "screen" CRS is named display CRS). -3. Combine the two MathTransforms:: +3. Combine the two ``MathTransforms``:: MathTransform transform = defaultMathTransformFactory.createConcatenatedTransform( data2world, world2screen ); @@ -45,7 +46,7 @@ It is often easier to treat the problem in two steps: Geometry screenGeometry = geometry.transform( screenCRS, transform ); -5. Draw with confidence knowing that you are using DISPLAY_X and DISPLAY_Y:: +5. Draw with confidence knowing that you are using ``DISPLAY_X`` and ``DISPLAY_Y``:: final int X = 0; final int Y = 1; @@ -56,13 +57,13 @@ It is often easier to treat the problem in two steps: } 6. As long as you do this correctly everything will work out, you will know what "X" is - (because you defined it) and you will have forced your data into DISPLAY_X and - DISPLAY_Y. + (because you defined it) and you will have forced your data into ``DISPLAY_X`` and + ``DISPLAY_Y``. Screen to World ''''''''''''''' -The above instructions seem to cause some confusion; it may be easier to take the inverse of your world2screen transform +The above instructions seem to cause some confusion; it may be easier to take the inverse of your ``world2screen`` transform (usually you have one around since you were using it for drawing).:: AffineTransform world2screen = @@ -75,12 +76,12 @@ The above instructions seem to cause some confusion; it may be easier to take th Avoid Assumptions ^^^^^^^^^^^^^^^^^ -This is a problem when you run into code that would like to assume that each DirectPosition contains data in (x,y) order +This is a problem when you run into code that would like to assume that each ``DirectPosition`` contains data in (x,y) order (i.e. matching the screen). There exist many methods that are almost helpful: -* getHorizontalCRS return the GeographicCRS or ProjectedCRS part, or a DerivedCRS based on the above, that applies to +* ``getHorizontalCRS`` return the ``GeographicCRS`` or ``ProjectedCRS`` part, or a ``DerivedCRS`` based on the above, that applies to the Earth's surface (i.e. real geophysical meaning - not the first two axis). * You would still need to account for axis direction and polar coordinates on your own time. @@ -99,7 +100,7 @@ This code can be improved in several ways: * "x" is assumed to be ordinate(0), "y" is assumed to be ordinate(1) * A complicated transform is being performed by hand, "y" is inverted to match screen orientation, a transform is - specified using dx and dy offsets and the entire result is scaled + specified using ``dx`` and ``dy`` offsets and the entire result is scaled This code will fail when presented with: @@ -107,7 +108,7 @@ This code will fail when presented with: * data in which the direction of the axis is not what was expected * data that was collected in polar coordinates -Please note that some GeoTools classes, such as CRSUtilities.getCRS2D, often make use of this assumption; blindly +Please note that some GeoTools classes, such as ``CRSUtilities.getCRS2D``, often make use of this assumption; blindly returning the first 2 dimensions no matter what they are. Quick Fix @@ -139,10 +140,10 @@ You will also need to provided a set of global hints:: ...application code... } -GeoTools will now do its best to create CoordinateReferenceSystem objects that agree with your assumptions: +GeoTools will now do its best to create ``CoordinateReferenceSystem`` objects that agree with your assumptions: * data is in (x,y) order -* data is collected in the expected direction (ie. EAST and WEST are the same) +* data is collected in the expected direction (i.e. EAST and WEST are the same) Lookup Axis ^^^^^^^^^^^ @@ -191,6 +192,6 @@ This code will fail when presented with: * data in which the direction of the axis is not what was expected * data that was collected in polar coordinates -Please note that you will still miss out on a lot of data, we have only looked for AxisDirection that match our +Please note that you will still miss out on a lot of data, we have only looked for ``AxisDirection`` that match our assumptions (i.e. that the data is across an increasing - such as EAST). We are missing out on other data that is obviously across but is decreasing - such as WEST. diff --git a/docs/user/library/referencing/compare.rst b/docs/user/library/referencing/compare.rst index 7413d93ab4b..54da277935c 100644 --- a/docs/user/library/referencing/compare.rst +++ b/docs/user/library/referencing/compare.rst @@ -10,9 +10,9 @@ Related: Compare Identifier ^^^^^^^^^^^^^^^^^^ -You can use the identifier name to compare two CoordinateReferenceSystem objects. +You can use the identifier name to compare two ``CoordinateReferenceSystem`` objects. -A ReferenceIdentifier is often composed of two parts: +A ``ReferenceIdentifier`` is often composed of two parts: * Authority: assigned by by an authority body such as the European Petroleum Standards Group * Code: uniquely identifiers the referencing object according to the authority body @@ -32,12 +32,12 @@ Here is what that looks like:: ... } -In this case you are only comparing the name (ie metadata) of the two objects. You are trusting that the two objects are the same, if they are called the same name. +In this case you are only comparing the name (i.e. metadata) of the two objects. You are trusting that the two objects are the same, if they are called the same name. Compare Equals ^^^^^^^^^^^^^^ -Equals comparison is used to check when a CoordinateReferenceSystem, and all its component parts such as Datum, are exactly equal.:: +Equals comparison is used to check when a ``CoordinateReferenceSystem``, and all its component parts such as ``Datum``, are exactly equal.:: CoordinateReferenceSystem crs1 = shapefile.getSchema().getDefaultGeometry().getCoordinateReferenceSystem(); CoordinateReferenceSystem crs2 = CRS.decode("EPSG:4326"); @@ -49,9 +49,9 @@ Equals comparison is used to check when a CoordinateReferenceSystem, and all its While the above makes sense, if it not often exactly what you want. -Often it does not matter what name (ie metadata) the data structure goes by, so far it numerically represents the same idea. +Often it does not matter what name (i.e. metadata) the data structure goes by, so far it numerically represents the same idea. -You can check if two objects are equal, while ignoring metadata (such as the exact name used for the CoordinateReferenceSystem). This technique compares significant values only, i.e. mostly (with a few exception) the ones that would changes the numerical results when transforming a position from one CRS to the other.:: +You can check if two objects are equal, while ignoring metadata (such as the exact name used for the ``CoordinateReferenceSystem``). This technique compares significant values only, i.e. mostly (with a few exception) the ones that would changes the numerical results when transforming a position from one CRS to the other.:: if( CRS.equalsIgnoreMetadata(crs1, crs2)){ @@ -59,20 +59,20 @@ You can check if two objects are equal, while ignoring metadata (such as the exa The name is usually ignored, with only 2 exceptions: -* Datum - The reason that we cannot ignore the name for a Datum is that it is the only +* Datum - The reason that we cannot ignore the name for a ``Datum`` is that it is the only way to differentiate between datum. We can have many datum using the same Ellipsoid and - PrimeMeridian, and still be different datum (because AbstractDatum do not stores all + ``PrimeMeridian``, and still be different datum (because ``AbstractDatum`` do not stores all the geodesy work behind the datum definition - it would be complex and out of ISO 19111 scope anyway). - In order to still allow a relaxed check we make use of a DatumAlias class, which help - the referencing engine to recognise for example that "WGS84" and "D_WGS84" are + In order to still allow a relaxed check we make use of a ``DatumAlias`` class, which help + the referencing engine to recognize for example that "WGS84" and "D_WGS84" are synonymous. -* CoordinateSystemAxis - CoordinateSystemAxis is clearly defined by ISO19111, but some - variation is still seen in the wild. The DefaultCoordinateSystemAxis implementation +* ``CoordinateSystemAxis`` - ``CoordinateSystemAxis`` is clearly defined by ISO19111, but some + variation is still seen in the wild. The ``DefaultCoordinateSystemAxis`` implementation handles a couple of alias as well (much less than Datum however). We have be unable to define an alias for "x" and "y" up to date, because "x" (for example) can means too many different things: "Easting" in a map projection, - "Geocentric X" in a GeocentricCRS, "Column" in an ImageCRS, etc... + "Geocentric X" in a ``GeocentricCRS``, "Column" in an ``ImageCRS``, etc... diff --git a/docs/user/library/referencing/crs.rst b/docs/user/library/referencing/crs.rst index 32e99ad2c43..6b447675c39 100644 --- a/docs/user/library/referencing/crs.rst +++ b/docs/user/library/referencing/crs.rst @@ -1,7 +1,7 @@ CRS --- -We have provided the **CRS** helper class as your first point of call when working with the referencing module. This class allows you to quickly accomplish the most common referencing tasks. +We have provided the ``CRS`` helper class as your first point of call when working with the referencing module. This class allows you to quickly accomplish the most common referencing tasks. References: @@ -9,11 +9,11 @@ References: *Before you Start* -The most conservative way to deal with the definition of a **CoordinateReferenceSystem** is not +The most conservative way to deal with the definition of a ``CoordinateReferenceSystem`` is not to. Instead make use of an authority that provides complete definitions defined by a simple code. -To hook this up make sure you have one of the **gt-epsg** plugins on your CLASSPATH. The -**gt-epsg-hsql** plugin is recommended. +To hook this up make sure you have one of the ``gt-epsg`` plugins on your CLASSPATH. The +``gt-epsg-hsql`` plugin is recommended. Defining a CoordinateReferenceSystem ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -24,7 +24,7 @@ This is easily the most common use for the CRS class:: CoordinateReferenceSystem sourceCRS = CRS.decode("EPSG:4326"); -The example above assumes you have **gt-epsg-hsql** jar on your CLASSPATH. +The example above assumes you have ``gt-epsg-hsql`` jar on your CLASSPATH. Depending on the jars you have on your CLASSPATH a range of authorities are available to define a coordinate reference system for you. @@ -40,9 +40,9 @@ Using the WMS AUTO2 syntax (which requires you pass in your current "position":: Well Known Text ''''''''''''''' -**CoordinateReferenceSystem** can also be defined by a text format ((called "Well Known Text" or WKT). This is a standard provided by the OGC and shows up in inside a shapefile "prj" file, or in a databases such as PostGIS and Oracle. +``CoordinateReferenceSystem`` can also be defined by a text format ((called "Well Known Text" or WKT). This is a standard provided by the OGC and shows up in inside a shapefile ``prj`` file, or in a databases such as PostGIS and Oracle. -To parse WKT please use the CRS.parseWKT( txt ) method:: +To parse WKT please use the ``CRS.parseWKT(txt)`` method:: String wkt = "GEOGCS[" + "\"WGS 84\"," + " DATUM[" + " \"WGS_1984\"," + " SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]]," @@ -54,7 +54,7 @@ To parse WKT please use the CRS.parseWKT( txt ) method:: CoordinateReferenceSystem crs = CRS.parseWKT(wkt); -The different organisations each have slightly different ideas on how some of the names work in +The different organizations each have slightly different ideas on how some of the names work in the WKT standard. GeoTools does a good job of listing common aliases in order to read WKT generated from a range of tools. @@ -140,9 +140,9 @@ To generate WKT: While not 1-1 equal, the datum, projection, projection parameters and units are spelled out the same. -.. note:: Formatable +.. note:: ``Formatable`` - The code above casted the CRS into a Formattable object, that gives the developer more + The code above cast the CRS into a ``Formattable`` object, that gives the developer more control on how things are converted in WKT, and then asked to generate the WKT using the ESRI aliases and 2 indentation when generating the output. @@ -154,7 +154,7 @@ Matching a CoordinateReferenceSystem You can actually search based on any metadata, not just name, the way you do it is you construct an example of what you are looking for - and than ask for the best match. -This functionality is especially useful when you have produced a CoordinateReferenceSystem by +This functionality is especially useful when you have produced a ``CoordinateReferenceSystem`` by parsing WKT and you would like to find the "official" code for it.:: String wkt = @@ -182,10 +182,10 @@ Here is a quick sample use of the CRS class:: MathTransform transform = CRS.findMathTransform(sourceCRS, targetCRS, true); -When using a CoordinateReferenceSystem that has been parsed from WKT you will -often need to "relax" the accuracy by setting the **lenient** parameter to true when searching with findMathTransform. +When using a ``CoordinateReferenceSystem`` that has been parsed from WKT you will +often need to "relax" the accuracy by setting the ``lenient`` parameter to true when searching with ``findMathTransform``. -The official CoordinateReferenceSystem definitions provided by the EPSG database have extra metadata (describing how to do Datum shifts for example), beyond what can be provided using WKT.:: +The official ``CoordinateReferenceSystem`` definitions provided by the EPSG database have extra metadata (describing how to do Datum shifts for example), beyond what can be provided using WKT.:: import org.geotools.referencing.CRS; @@ -219,8 +219,8 @@ The official CoordinateReferenceSystem definitions provided by the EPSG database Transforming a Geometry ^^^^^^^^^^^^^^^^^^^^^^^ -A **MathTransform**, as generated above, can be used by bashing away at the interface and feeding -it **DirectPosition** objects one at a time. +A ``MathTransform``, as generated above, can be used by bashing away at the interface and feeding +it ``DirectPosition`` objects one at a time. Or you could break out the JTS utility class where this work has been done for you:: @@ -247,7 +247,7 @@ method to quickly check what is going on.:: // lat lon } -Not all CoordinateReferenceSystems match a well defined axis order:: +Not all ``CoordinateReferenceSystems`` match a well defined axis order:: CoordinateReferenceSystem crs = CRS.getHorizontalCRS(DefaultEngineeringCRS.GENERIC_2D)); if( CRS.getAxisOrder(crs) == AxisOrder.INAPPLICABLE){ @@ -257,43 +257,43 @@ Not all CoordinateReferenceSystems match a well defined axis order:: CoordinateReferenceSystem ^^^^^^^^^^^^^^^^^^^^^^^^^ -The central user facing class for gt-referencing is **CoordinateReferenceSystem**. +The central user facing class for ``gt-referencing`` is ``CoordinateReferenceSystem``. Constants ''''''''' -Some CoordinateReferenceSystem instances are used so often it is worth making static final constants +Some ``CoordinateReferenceSystem`` instances are used so often it is worth making static final constants for them. GeoTools has done so in order to cover the most common cases encountered when programming. -Static final constant CoordinateReferenceSystem in GeoTools: +Static final constant ``CoordinateReferenceSystem`` in GeoTools: A coordinate reference system using the WGS84 datum as an approximation of the shape of the earth: -* DefaultGeographicCRS.WGS84 - this is the most commonly used default -* DefaultGeographicCRS.WGS84_3D +* ``DefaultGeographicCRS.WGS84`` - this is the most commonly used default +* ``DefaultGeographicCRS.WGS84_3D`` -A 3D coordinate reference system with the origin at the approximate centre of mass of the earth: +A 3D coordinate reference system with the origin at the approximate center of mass of the earth: -* DefaultGeocentricCRS.CARTESIAN -* DefaultGeocentricCRS.SPHERICAL +* ``DefaultGeocentricCRS.CARTESIAN`` +* ``DefaultGeocentricCRS.SPHERICAL`` A contextually local coordinate reference system (for construction projects or moving objects): -* DefaultEngineeringCRS.CARTESIAN_2D (see the next section for a discussion of this value) -* DefaultEngineeringCRS.CARTESIAN_3D -* DefaultEngineeringCRS.GENERIC_2D -* DefaultEngineeringCRS.GENERIC_3D +* ``DefaultEngineeringCRS.CARTESIAN_2D`` (see the next section for a discussion of this value) +* ``DefaultEngineeringCRS.CARTESIAN_3D`` +* ``DefaultEngineeringCRS.GENERIC_2D`` +* ``DefaultEngineeringCRS.GENERIC_3D`` A 1D coordinate reference system used for recording heights or depth relative to the ellipsoidal datum: -* DefaultVirticalCRS.ELLIPSOIDAL_HEIGHT +* ``DefaultVirticalCRS.ELLIPSOIDAL_HEIGHT`` .. note:: For those into the details; these static final constant CoordinateReferenceSystem cite "GeoTools" as the authority responsible for the definition. This is in marked contrast with the - **CoordinateReferenceSystem** instances produced by an AuthorityFactory (those instances will - credit a specific organisation like "EPSG"). + ``CoordinateReferenceSystem`` instances produced by an AuthorityFactory (those instances will + credit a specific organization like "EPSG"). Examples: @@ -313,23 +313,23 @@ GENERIC_2D '''''''''' One constant deserves special mention as it is used as a "wild card" placeholder for when you -are unsure of your data. The concept of a "Generic 2D" CoordinateReferenceSystem is formally +are unsure of your data. The concept of a "Generic 2D" ``CoordinateReferenceSystem`` is formally intended for working with things like CAD drawings where the results are measured in meters. -When considered in the context of GIS we treat it as a "wildcard" allowing you to get a visual +When considered in the context of GIS we treat it as a "wild card" allowing you to get a visual of some sort. Formally this is expressed by the `DefaultEngineeringCRS.GENERIC_2D javadocs `_ as: - A two-dimensional wildcard coordinate system with x, y axis in metres. At the difference of - CARTESIAN_2D, this coordinate system is treated specially by the default coordinate operation + A two-dimensional wild card coordinate system with x, y axis in metres. At the difference of + ``CARTESIAN_2D``, this coordinate system is treated specially by the default coordinate operation factory with loose transformation rules: if no transformation path were found (for example through a derived CRS), then the transformation from this CRS to any CRS with a compatible number of dimensions is assumed to be the identity transform. This CRS is useful as a - kind of wildcard when no CRS were explicitly specified. + kind of wild card when no CRS were explicitly specified. The concept is available two ways: -* DefaultEngineeringCRS.GENERIC_2D +* ``DefaultEngineeringCRS.GENERIC_2D`` This option lacks an EPSG identifier hindering interoperability with external systems. @@ -337,14 +337,14 @@ The concept is available two ways: CoordinateReferenceSystem generic = CRS.decode("EPSG:404000"); - This value the same as DefaultEngineeringCRS.GENERIC_2D (with a epsg identifier and description). + This value the same as ``DefaultEngineeringCRS.GENERIC_2D`` (with a EPSG identifier and description). Since only this descriptive information is different *equals ignores metadata* will return true. The same value is also provided as a static constant:: CartesianAuthoryFactory.GENERIC_2D - This is the preferred way to represent an unknown CoordinateReferenceSystem in GeoTools. + This is the preferred way to represent an unknown ``CoordinateReferenceSystem`` in GeoTools. Google Maps ''''''''''' @@ -363,7 +363,7 @@ References: * http://johndeck.blogspot.com/2005/09/overlaying-mercator-projected-wms.html * http://trac.openlayers.org/wiki/SphericalMercator -Using an EPSG code to look up the CoordinateReferenceSystem:: +Using an EPSG code to look up the ``CoordinateReferenceSystem``:: CoordinateReferenceSystem sphericalMercator = CRS.decode("EPSG:3857"); diff --git a/docs/user/library/referencing/epsg.rst b/docs/user/library/referencing/epsg.rst index bc8e96301ba..b134c1611c5 100644 --- a/docs/user/library/referencing/epsg.rst +++ b/docs/user/library/referencing/epsg.rst @@ -9,7 +9,7 @@ values - at least references to where such parameters can be found. This databas GeoTools and GeoTiff and its related projects. Since some members of the EPSG also worked on the OGC CTS specifications, the OGC CTS API closely -maches the EPSG database schema. +matches the EPSG database schema. This database has a high value for the GIS community for the following reasons: @@ -21,7 +21,7 @@ This database has a high value for the GIS community for the following reasons: is v6.5. EPSG puts a lot of effort into ensuring downward compatibility. For example, one code will never change its meaning or parameters. If errors are found, the code gets deprecated and the object gets assigned a new code if necessary. However, there are still major structural changes ongoing - - together with a increase in the number of objects catalogued and some objects being deprecated. + together with a increase in the number of objects cataloged and some objects being deprecated. EPSG, therefore, is far from being considered "final" or "nearly final". Still, this database can be considered unavoidable when working with and exchanging geographic information. @@ -32,7 +32,7 @@ structural comparison of coordinate system concepts. You can download the database (in MS Access 97 and SQL scripts) from http://www.epsg.org. For Windows installation HowTo's see their documentation and for Linux see our documentation for the -**gt-epsh-postgres** plugin. +``gt-epsh-postgres`` plugin. EPSG also maintains some "Guidance notes" on coordinate references systems, map design naming and similar topics. @@ -41,32 +41,32 @@ GeoTools ^^^^^^^^ GeoTools follows OpenGIS specifications. This applies particularly to the -org.geotools.referencing package and +``org.geotools.referencing`` package and our coordinate transformation services. Since these specifications are very flexible, so are the GeoTools implementations. For example GeoTools can handle: -* geographic coordinate systems that use {lat; lon} as well as {lon; lat}; -* geographic CoordainteSystems whose axes increase to the west and south; and -* CoordainteSystems of every possible unit of measure: degree, radians, grad, meter, inch, feet, and +* Geographic coordinate systems that use ``(lat, lon)`` as well as ``(lon, lat)``; +* Geographic coordinate systems whose axes increase to the west and south; and +* Coordinate systems of every possible unit of measure: degree, radians, grad, meter, inch, feet, and all other more uncommon units used in certain countries. -However this means that it cannot be assumed by the user that a geographic CRS is always {lat; lon} +However this means that it cannot be assumed by the user that a geographic CRS is always ``(lat, lon)`` with degrees and axes increasing to north and east although this is mostly the case in North America and Europe. It it always necessary to verify and respect the coordinate system properties, that the specific coordinate system object provides! There exists a WGS84 constant which defines the commonly used geographic CRS. It is defined as being -{lon; lat}, using degrees, having axes increasing to north and east and using the WGS84 geodetic -datum - which itself is defined as a constant in GeoTools. Since many Bursa-Wolf paremeters define +``(lon, lat)``, using degrees, having axes increasing to north and east and using the WGS84 geodetic +datum - which itself is defined as a constant in GeoTools. Since many Bursa-Wolf parameters define a transformation between a geographic CRS and WGS84, a transformation between two geographic CRS would (only using Bursa-Wolf transformations), for example, work as follows: User selected input geographic CRS -> WGS84 (constant) -> user selected output geographic CRS. * GeoTools version 2.0 followed the OpenGIS specification 01-009 (Coordinate Transformation Services (CT)). -* Geotools 2.1 and latter use the more recent coordinate system concepts described in the OpenGIS +* GeoTools 2.1 and latter use the more recent coordinate system concepts described in the OpenGIS abstract specification 03-073r1 (Spatial Referencing by Coordinates). Although the EPSG database already contains the new structures described therein, the database v6.x @@ -84,10 +84,10 @@ parts as, for example, geodetic datums and ellipsoids. In order to gain a better understanding, it is recommended that you have the EPSG database installed. Choose a database viewer and have a look at the database. -Note: Just in case you don't have a good viewer at hand, OpenOffice does a good job of viewing the -database. You will have to register the database under Extras->Data sources as an ODBC database. -Then, in any document, press F4 to open the database window. Now you can easily browse the -database's tables. +.. note:: Just in case you don't have a good viewer at hand, OpenOffice does a good job of viewing the + database. You will have to register the database under Extras->Data sources as an ODBC database. + Then, in any document, press F4 to open the database window. Now you can easily browse the + database's tables. You should see a structure like the one in the following screenshot: @@ -96,7 +96,7 @@ You should see a structure like the one in the following screenshot: You will soon see that the database (v6.x) has a hierarchical structure that is equal to the new OpenGIS abstract specification Spatial Referencing by Coordinates. The "old" OpenGIS specification Coordinate Transformation Services (CT) had a slightly different structure - as had the "old" EPSG -datbases v5.x. The following paragraphs give a simplified overview of these hierarchies. +databases v5.x. The following paragraphs give a simplified overview of these hierarchies. EPSG6.x ''''''' diff --git a/docs/user/library/referencing/extension.rst b/docs/user/library/referencing/extension.rst index 7f5b87bc06b..06f04d233e5 100644 --- a/docs/user/library/referencing/extension.rst +++ b/docs/user/library/referencing/extension.rst @@ -6,9 +6,10 @@ codes into the mix. Internally it uses the same java property file as the :doc:` This plugin is compatible with a restricted environment and does not require disk access. -The Plugin will work out of the box, inlcude it in your CLASSPATH path. +The Plugin will work out of the box, just include it in your CLASSPATH path. -**References** +References +''''''''''' * `esri.properties `_ Additional ESRI Compatibility Codes * `unnamed.properties `_ Additional EPSG Codes diff --git a/docs/user/library/referencing/faq.rst b/docs/user/library/referencing/faq.rst index ef3f330958b..a03f2d9e635 100644 --- a/docs/user/library/referencing/faq.rst +++ b/docs/user/library/referencing/faq.rst @@ -1,11 +1,11 @@ Referencing FAQ --------------- -Q: Why can't I display shapefile over a WMS layer? -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Q: Why can't I display a shapefile over a WMS layer? +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -This can happen when the axis definition (ie. which way is X ?) differs between the coordinate reference system used by -the shapefile and that used by the WMS layer. It can be fixed by requesting GeoTools to enforce lon - lat axis order by +This can happen when the axis definition (i.e. which way is X ?) differs between the coordinate reference system used by +the shapefile and that used by the WMS layer. It can be fixed by requesting GeoTools to enforce longitude - latitude axis order by including this statement in your code prior to displaying layers... .. sourcecode:: java @@ -29,26 +29,26 @@ Q: How to choose an EPSG Authority? The referencing module does not do very much out of the box - it needs someone to tell it what all the funny codes mean (such as "EPSG:4326"). -You need to choose a single "epsg" jar to have on your classpath; if you have -several epsg jars on your classpath you will get a FactoryException. +You need to choose a single EPSG jar to have on your classpath; if you have +several EPSG jars on your classpath you will get a FactoryException. -For most needs just use the **gt-epsg-hsql** plugin: +For most needs just use the ``gt-epsg-hsql`` plugin: -* **gt-epsgh-hsql**: will unpack an hsql database containing the official epsg +* ``gt-epsgh-hsql``: will unpack an HSQL database containing the official EPSG database into a temp directory, a great solution for desktop applications. There are several alternatives: -* **gt-epsg-wkt**: uses an internal property file and is lightweight rather than +* ``gt-epsg-wkt``: uses an internal property file and is lightweight rather than official and correct. A great solution for applets -* **gt-epsg-postgres**: uses the official epsg database which you have to load +* ``gt-epsg-postgres``: uses the official EPSG database which you have to load into PostgreSQL yourself. A great solution for Java EE applications. -* **gt-epsg-access**: irectly use an the official epsg database as distributed. +* ``gt-epsg-access``: directly use an the official EPSG database as distributed. A great solution for windows users that need the latest official database. Unsupported: -* **gt-epsg-oracle**: Load the official epsg database into oracle to use this plugin +* ``gt-epsg-oracle``: Load the official EPSG database into oracle to use this plugin * **gt-epsgh-h2**: use this popular pure java database Q: Are other authorities other than EPSG supported? @@ -60,7 +60,7 @@ inspired ideas. Q: What Jars does gt-referencing need? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -As an example to use **gt-epsg-hsql** you will need:: +As an example to use ``gt-epsg-hsql`` you will need:: C:\geotools\trunk\modules\plugin\epsg-hsql>mvn dependency:tree ... @@ -108,16 +108,16 @@ the same datum it was collected in. * A: Match your PRJ file Usually this occurs when you have loaded a CoordinateReferenceSystem from a - "prj" file included with your shapefile. + ``prj`` file included with your shapefile. To fix look up the complete definition in the EPSG database using the CRS utility class. The EPSG database contains more information than can be - Expressed in your "prj" file. + Expressed in your ``prj`` file. * A: Datum shift by Grid Finally in the rare case of a Datum shift backed by grids are only partially - implemented. Rueben Shulz has implemented data shift backed by grids for + implemented. Reuben Schulz has implemented data shift backed by grids for NADCON with the following limitations: * Use of NADCON grids has not been integrated with @@ -131,7 +131,7 @@ Q: What does gt-referencing do? You will eventually care about this as it defines how 2D data actually means 3D data. -You can take a measurement (ie a coordinate) plus a coordinate reference system (the +You can take a measurement (i.e. a coordinate) plus a coordinate reference system (the meaning) and figure out where a position on the earth is in 3D space. It is easy to assume that Coordinates are recorded in double[] as repeating x/y values @@ -151,14 +151,14 @@ We will get into this again when you actually have some data - the CoordinateRef Q: Can I just use Referencing without the rest of GeoTools? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Yes, you will need to use the metadata module, and one of the epsg modules. Along with +Yes, you will need to use the metadata module, and one of the EPSG modules. Along with their dependencies such as units. Q: I cannot find an EPSG Code? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -You need to have one, and only one, of the epsg plugins on your CLASSPATH. We -recommend epsg-hsql for most uses. +You need to have one, and only one, of the EPSG plugins on your CLASSPATH. We +recommend ``epsg-hsql`` for most uses. Q: I cannot re-project my shapefile (missing "Bursa wolf parameters")? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -169,17 +169,17 @@ reference system:: MathTransform transform = CRS.findMathTransform(DefaultGeographicCRS.WGS84, moroccoCRS); This problem often occurs when working with a custom coordinate reference system, if -you look in your shapefile's prj file you will see that the contents is normal "well +you look in your shapefile's PRJ file you will see that the contents is normal "well known text". The "Bursa-Wolf parameters" define the relationship (and a transformation) between the spheroid being used by your shapefile and the normal WGS84 spheroid. -The opengis javadocs has some help for you here: +The ``opengis`` javadocs has some help for you here: * http://docs.geotools.org/stable/javadocs/org/opengis/referencing/doc-files/WKT.html#TOWGS84 -Your best bet is to look up the normal EPSG code for your area; and update your "prj" +Your best bet is to look up the normal EPSG code for your area; and update your ``prj`` file to include the official definition. Q: How do I Transform? @@ -230,23 +230,23 @@ the system. This is often used by those working with a national standards body that maintains its own set of official codes. -You can use the **gt-epsg-wkt** plugin as an example of the following options: +You can use the ``gt-epsg-wkt`` plugin as an example of the following options: -* Through a property file and programatic registration of the factory +* Through a property file and programmatic registration of the factory You can create a file with your CRS in the WKT format, instantiate a PropertyAuthorityFactory with that CRS: 1. Create a property file with your CRS definitions in Well-Known Text (WKT) format. - 2. Each line of the file should be "someUniqueCodeValue = crsInWKT". + 2. Each line of the file should be ``someUniqueCodeValue = crsInWKT`` . 3. Place that file as a resource available from your code at run time - 4. Create a org.geotools.referencing.factory.PropertyAuthorityFactory with a custom + 4. Create a ``org.geotools.referencing.factory.PropertyAuthorityFactory`` with a custom code for the authority such as "CUSTOM" and a URI to your file - 5. Register your factory with the ReferencingFactoryFinder.addAuthorityFactory(..) + 5. Register your factory with the ``ReferencingFactoryFinder.addAuthorityFactory(..)`` method - After that, the desired CRS can be invoked as "CUSTOM:someUniqueCodeValue" so, for - example, a CRS object can be created using the CRS.decode(..) method with the string + After that, the desired CRS can be invoked as ``CUSTOM:someUniqueCodeValue`` so, for + example, a CRS object can be created using the ``CRS.decode(..)`` method with the string nomenclature of authority-colon-code. The CRS's defined in this way will also be taken into consideration by the rest of the referencing subsystem. @@ -260,12 +260,12 @@ You can use the **gt-epsg-wkt** plugin as an example of the following options: Q: How to I add my own EPSG Codes? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The gt-epsg-wkt plugin is intended to be used on its own and should not be combined -with any of the other gt-epsg-h2, or gt-epsg-hsql plugins as they will end up in +The ``gt-epsg-wkt`` plugin is intended to be used on its own and should not be combined +with any of the other ``gt-epsg-h2`` or ``gt-epsg-hsql`` plugins as they will end up in conflict. If you want to add a few more definitions over and above those provided by the -official database (ie epsg-hsql or epsg-h2) please use the following (taken from the +official database (i.e. ``gt-epsg-hsql`` or ``gt-epsg-h2``) please use the following (taken from the uDig application):: URL url = new URL(url, "epsg.properties"); diff --git a/docs/user/library/referencing/h2.rst b/docs/user/library/referencing/h2.rst index b0a209f2166..ae2e9a6898a 100644 --- a/docs/user/library/referencing/h2.rst +++ b/docs/user/library/referencing/h2.rst @@ -3,6 +3,6 @@ EPSG H2 Plugin This plugin works out of the box (as a pure java database with its own copy of the EPSG database included). -To use place the gt-epsg-h2 jar on your CLASSPATH. +To use place the ``gt-epsg-h2`` jar on your CLASSPATH. -Although this plugin is not supported, it is a drop in replacement for the gt-epsg-hsql plugin and is well suited if you are already using h2 and do not want a second pure java database dependency in your application. \ No newline at end of file +Although this plugin is not supported, it is a drop in replacement for the ``gt-epsg-hsql`` plugin and is well suited if you are already using H2 and do not want a second pure java database dependency in your application. diff --git a/docs/user/library/referencing/hsql.rst b/docs/user/library/referencing/hsql.rst index 5cfea5ca061..851c5678362 100644 --- a/docs/user/library/referencing/hsql.rst +++ b/docs/user/library/referencing/hsql.rst @@ -14,7 +14,7 @@ The Plugin will unpack the database somewhere on your machine, usually where tem On my Windows XP machine it is located here: -* C:\Documents and Settings\Jody\Local Settings\Temp\Geotools\Databases\HSQL +* C:\Documents and Settings\Jody\Local Settings\Temp\GeoTools\Databases\HSQL The following contents are usually in this folder:: diff --git a/docs/user/library/referencing/index.rst b/docs/user/library/referencing/index.rst index d0a67994ad8..58c7a14545b 100644 --- a/docs/user/library/referencing/index.rst +++ b/docs/user/library/referencing/index.rst @@ -2,32 +2,36 @@ Referencing =========== Used to interpret referencing information allowing the determination of a location given a set of -coordinates. Includes implementation of CoordinateReferenceSystem (CRS), conversion and +coordinates. Includes implementation of ``CoordinateReferenceSystem`` (CRS), conversion and transformation services. .. image:: /images/gt-referencing.png The gt-referencing module is our first example that makes use of the plugin system provided by :doc:`gt-metadata <../metadata/index>`. It does require a little bit of care when configuring -the module with appropriate epsg authority. +the module with appropriate EPSG authority. -The gt-referencing module is responsible for: +The ``gt-referencing`` module is responsible for: * Implementation of the referencing interfaces from :doc:`gt-opengis <../opengis/index>` such - as CoordinateReferenceSystem and MathTransform + as ``CoordinateReferenceSystem`` and ``MathTransform`` * Providing a definition for common spatial reference system codes using plugins available on the CLASSPATH -This module is basically care and feeding for the CoordinateReferenceSystem class - and enough +This module is basically care and feeding for the ``CoordinateReferenceSystem`` class - and enough math to make it useful. Before you get too worried it is easy to use (There is a class called CRS that has helper methods for reprojection and stuff). -**References** +References +'''''''''' * http://www.epsg-registry.org/ -**Maven**:: - +Maven +''''' + +.. code-block:: xml + org.geotools gt-referencing @@ -44,7 +48,8 @@ CRS that has helper methods for reprojection and stuff). ${geotools.version} -**Contents** +Contents +-------- .. sidebar:: Details @@ -91,4 +96,4 @@ Unsupported plugins: :maxdepth: 1 h2 - oracle \ No newline at end of file + oracle diff --git a/docs/user/library/referencing/internal.rst b/docs/user/library/referencing/internal.rst index 3b461eb638b..15da5671770 100644 --- a/docs/user/library/referencing/internal.rst +++ b/docs/user/library/referencing/internal.rst @@ -4,18 +4,18 @@ Internal Please note that this page is optional and only for the curious. It covers some of the implementation classes. -A **CoordinateReferenceSystem** is a **gt-opengis** interface describing how a set of -ordinates is to be interpreted as a three dimensional point. This definition is standardised, +A ``CoordinateReferenceSystem`` is a ``gt-opengis`` interface describing how a set of +ordinates is to be interpreted as a three dimensional point. This definition is standardized, mathematical and generally not of interest unless something goes wrong. -CoordinateReferenceSystem -^^^^^^^^^^^^^^^^^^^^^^^^^ +``CoordinateReferenceSystem`` +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -For most cases you are only interested in using a CoordinateReferenceSystem as a parameter to a +For most cases you are only interested in using a ``CoordinateReferenceSystem`` as a parameter to a mathematical calculation (distance along the surface of the earth and "re-projection" being the most common). -Creating a CoordinateReferenceSystem: +Creating a ``CoordinateReferenceSystem``: .. literalinclude:: /../src/main/java/org/geotools/referencing/ReferencingExamples.java :language: java @@ -23,12 +23,12 @@ Creating a CoordinateReferenceSystem: :end-before: // createFromEPSGCode end You will need to ensure GeoTools is configured with an appropriate plugin for this example to work. -This plugin will provide an CRSAuthorityFactory registered for "EPSG" codes. +This plugin will provide an ``CRSAuthorityFactory`` registered for "EPSG" codes. -CRSAuthorityFactory -^^^^^^^^^^^^^^^^^^^ +``CRSAuthorityFactory`` +^^^^^^^^^^^^^^^^^^^^^^^ -Internally the **CRS** class makes use of a **CRSAuthorityFactory** to provide the definition for +Internally the ``CRS`` class makes use of a ``CRSAuthorityFactory`` to provide the definition for the indicated code. If you wish you can make use of the same facilities directly: .. literalinclude:: /../src/main/java/org/geotools/referencing/ReferencingExamples.java @@ -65,7 +65,7 @@ Creating a CoordinateReferenceSystem You can use factories defined by the referencing system to create things by hand using java code. -This example shows the creation of a WGS84 / UTM 10N CoordinateReferenceSystem: +This example shows the creation of a WGS84 / UTM 10N ``CoordinateReferenceSystem``: .. literalinclude:: /../src/main/java/org/geotools/referencing/ReferencingExamples.java :language: java @@ -75,8 +75,8 @@ This example shows the creation of a WGS84 / UTM 10N CoordinateReferenceSystem: The next example shows NAD 27 geographic CRS being defined, with a couple of interesting things to note: * The datum factory automatically adds alias names to the datum. - (The DatumAliasesTable.txt file inside gt-referencing has an entry for "North American Datum 1927"). -* The toWGS84 information being supplied for use in a datum transform is added to the Datum + (The ``DatumAliasesTable.txt`` file inside ``gt-referencing`` has an entry for "North American Datum 1927"). +* The ``toWGS84`` information being supplied for use in a datum transform is added to the Datum Here is the example: @@ -85,9 +85,9 @@ Here is the example: :start-after: // createCRSByHand2 start :end-before: // createCRSByHand2 end -Finally, here is no-holds-barred creation of a CoordinateReferenceSystem with all the usual helper classes +Finally, here is no-holds-barred creation of a ``CoordinateReferenceSystem`` with all the usual helper classes stripped away. It does not use any of the static objects available in GeoTools. The following example -creates a CoordinateReferenceSystem to represent WGS84. +creates a ``CoordinateReferenceSystem`` to represent WGS84. .. literalinclude:: /../src/main/java/org/geotools/referencing/ReferencingExamples.java :language: java @@ -97,42 +97,42 @@ creates a CoordinateReferenceSystem to represent WGS84. Referencing Factories ^^^^^^^^^^^^^^^^^^^^^ -These are the "real" factories - interfaces that actually create stuff. All are gt-opengis interfaces, so you will need -to use ReferencingFactoryFinder to get started: +These are the "real" factories - interfaces that actually create stuff. All are ``gt-opengis`` interfaces, so you will need +to use ``ReferencingFactoryFinder`` to get started: -* DatumFactory: +* ``DatumFactory``: Makes datums! -* CSFactory - Makes CoordinateSystem instances, and many more -* CRSFactory - Makes CoordinateReferenceSystem instances, and many more -* MathTransformFactory - Makes MathTransform instances, and many more +* ``CSFactory`` + Makes ``CoordinateSystem`` instances, and many more +* ``CRSFactory`` + Makes ``CoordinateReferenceSystem`` instances, and many more +* ``MathTransformFactory`` + Makes ``MathTransform`` instances, and many more -You can quickly grab all four factories at once using **ReferencingFactoryContainer**: +You can quickly grab all four factories at once using ``ReferencingFactoryContainer``: .. literalinclude:: /../src/main/java/org/geotools/referencing/ReferencingExamples.java :language: java :start-after: // factories start :end-before: // factories end -* ReferencingFactoryFinder +* ``ReferencingFactoryFinder`` - As is custom we have included a "FactoryFinder" so you can look up a good + As is custom we have included a ``FactoryFinder`` so you can look up a good implementation on the CLASSPATH:: DatumFactory datumFactory = ReferencingFactoryFinder.getDatumFactory(null); - The ReferencingFactoryFinder returns a couple of GeoTools implementations right now, in - the future we hope to replace these defaults with an implementation from JScience. + The ``ReferencingFactoryFinder`` returns a couple of GeoTools implementations right now, in + the future we hope to replace these defaults with an implementation from ``JScience``. -* ReferencingFactoryContainer +* ``ReferencingFactoryContainer`` You may have noticed that to actually do anything you need several factories. We have gathered these together into a "container" for you. The container also adds a few more methods which use a couple of factories to gang up on a problem - You can set up ReferencingFactoryContainer to use your own custom factory using hints as shown + You can set up ``ReferencingFactoryContainer`` to use your own custom factory using hints as shown below: .. literalinclude:: /../src/main/java/org/geotools/referencing/ReferencingExamples.java @@ -152,38 +152,38 @@ Referencing Authority Factories ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Deep behind that CRS utility class is an amazing constellation of "factories" used to define what a -CoordinateReferenceSystem is, actually create the parts, and finally stitch them all together in a +``CoordinateReferenceSystem`` is, actually create the parts, and finally stitch them all together in a unified whole. These things are factories in name only; their real job is to supply the definitions (in pattern speak they would be called *builders*). -* DatumAuthorityFactory: +* ``DatumAuthorityFactory``: Defines a Datum using a code provided by a authority such as EPSG -* CSAuthorityFactory: - Defines a CoordinateSystem using a code provided by an authority such as EPSG -* CRSAuthorityFactory: - Defines a CoordinateReferenceSystem for a given authority (such as EPSG) -* CoordinateOperationAuthorityFactory: +* ``CSAuthorityFactory``: + Defines a ``CoordinateSystem`` using a code provided by an authority such as EPSG +* ``CRSAuthorityFactory``: + Defines a ``CoordinateReferenceSystem`` for a given authority (such as EPSG) +* ``CoordinateOperationAuthorityFactory``: Defines coordinate operations from codes, backed by math transforms -To actually perform their function these authorities acquire a definition internally and then call a "real" factory class from ReferencingFactoryContainer. +To actually perform their function these authorities acquire a definition internally and then call a "real" factory class from ``ReferencingFactoryContainer``. -* Getting the EPSG AuthorityFactory +* Getting the EPSG ``AuthorityFactory`` - You can make direct use of the CRSAuthorityFactory configured to handle "EPSG" codes:: + You can make direct use of the ``CRSAuthorityFactory`` configured to handle "EPSG" codes:: CRSAuthorityFactory factory = ReferencingFactoryFinder.getCRSAuthorityFactory("EPSG", null); CoordinateReferenceSystem crs = factory.createCoordinateReferenceSystem("4326"); -You will need to make sure that one of the **epsg** plugins is on your CLASSPATH (such as epsg-hsql). +You will need to make sure that one of the **epsg** plugins is on your CLASSPATH (such as ``epsg-hsql``). * Finding the available EPSG Codes:: CRSAuthorityFactory factory = ReferencingFactoryFinder.getCRSAuthorityFactory("EPSG", null); Set authorityCodes = factory.getAuthorityCodes(CoordinateReferenceSystem.class); -* Getting Other AuthorityFactory Instances +* Getting Other ``AuthorityFactory`` Instances Here are several more examples that are understood by GeoTools:: @@ -192,9 +192,9 @@ You will need to make sure that one of the **epsg** plugins is on your CLASSPATH CRSAuthorityFactory wms2Authority = ReferencingFactoryFinder.getCRSAuthorityFactory("AUTO", hints); CRSAuthorityFactory wms3Authority = ReferencingFactoryFinder.getCRSAuthorityFactory("AUTO2", hints); -* IdentifiedObject Finder for Controlled Searching +* ``IdentifiedObject`` Finder for Controlled Searching - One bit of functionality that is not available via the CRSAuthority interfaces directly + One bit of functionality that is not available via the ``CRSAuthority`` interfaces directly is the ability to carefully search through all the available definitions.:: CRSAuthorityFactory factory = ReferencingFactoryFinder.getCRSAuthorityFactory("EPSG", null); @@ -209,6 +209,6 @@ You will need to make sure that one of the **epsg** plugins is on your CLASSPATH IdentifiedObject find = finder.find(crs); As shown above this is additional functionality made available through - AbstractAuthorityFactory - it is not part of the normal gt-opengis interfaces. + ``AbstractAuthorityFactory`` - it is not part of the normal ``gt-opengis`` interfaces. -You can construct finders to search through other categories of referencing Objects (like Datum and ReferencingSystem). +You can construct finders to search through other categories of referencing Objects (like ``Datum`` and ``ReferencingSystem``). diff --git a/docs/user/library/referencing/oracle.rst b/docs/user/library/referencing/oracle.rst index c3aa2f6d2e2..461bb274cbc 100644 --- a/docs/user/library/referencing/oracle.rst +++ b/docs/user/library/referencing/oracle.rst @@ -1,11 +1,11 @@ EPSG Oracle Plugin ------------------ -The gt-epsg-oracle module makes available to your application a CRSAuthority implementation that is backed by an Oracle database. You will need to load your oracle database with the tables distributed by the www.epsg.org. +The ``gt-epsg-oracle`` module makes available to your application a ``CRSAuthority`` implementation that is backed by an Oracle database. You will need to load your Oracle database with the tables distributed by the ``www.epsg.org``. Notes: -* The gt-epsg-oracle module is unsupported: +* The ``gt-epsg-oracle`` module is unsupported: * There is no module maintainer available for assistance (please use the user list for any problem discussions) * It is not subject to GeoTools quality assurance standards prior to release @@ -20,25 +20,25 @@ You can now directly download the EPSG database in oracle form (previously you h 1. Go to: http://www.epsg.org/CurrentDB.html 2. Go down to the shipping List and find a file similar to the following: - * Version 6.12: epsg-v6_12sql-Oracle.zip + * Version 6.12: ``epsg-v6_12sql-Oracle.zip`` -3. Use the EPSG_v6_12.mdb_Tables_Oracle.sql file to SQL CREATE all the tables -4. Use the EPSG_v6_12.mdb_Data_Oracle.sql file to SQL INSERT all the data -5. Use the EPSG_v6_12.mdb_FKeys_Oracle.sql file to SQL ALTER get all the keys straightened out +3. Use the ``EPSG_v6_12.mdb_Tables_Oracle.sql`` file to SQL CREATE all the tables +4. Use the ``EPSG_v6_12.mdb_Data_Oracle.sql`` file to SQL INSERT all the data +5. Use the ``EPSG_v6_12.mdb_FKeys_Oracle.sql`` file to SQL ALTER get all the keys straightened out Configuration ^^^^^^^^^^^^^^ -The gt-epsg-oracle module is set up to use a DataSource that you provide.:: +The ``gt-epsg-oracle`` module is set up to use a DataSource that you provide.:: ReferencingFactoryContainer container = new ReferencingFactoryContainer( hints ); **Oracle DataSource** -The first example is the use of **OracleDataSource** - the one provided by your oracle driver. +The first example is the use of ``OracleDataSource`` - the one provided by your oracle driver. -Direct use of OracleDataSource:: +Direct use of ``OracleDataSource``:: OracleDataSource source = new OracleDataSource(); source.setUser( user ); @@ -47,48 +47,48 @@ Direct use of OracleDataSource:: Hints hints = new Hints( Hints.EPSG_DATA_SOURCE, source ); -Although the above example shows creating an OracleDataSource; usually the instance is configured by your application container and needs to be obtained using a JNDI lookup. +Although the above example shows creating an ``OracleDataSource``; usually the instance is configured by your application container and needs to be obtained using a JNDI lookup. **BasicDataSource** -The next example is the use of BasicDataSource as provided as part of the commons dbcp project. This is a great choice when using a desktop application. +The next example is the use of ``BasicDataSource`` as provided as part of the commons DBCP project. This is a great choice when using a desktop application. The following connection management facilities are provided: - Hints.EPSG_DATA_SOURCE + ``Hints.EPSG_DATA_SOURCE`` A DataSource instance, or JNDI name - Hints.AUTHORITY_MAX_ACTIVE + ``Hints.AUTHORITY_MAX_ACTIVE`` Maximum number of connections used - Controls the number of database connections the **gt-epsg-module** will use at one time. + Controls the number of database connections the ``gt-epsg-module`` will use at one time. - Hints.AUTHORITY_MAX_IDLE + ``Hints.AUTHORITY_MAX_IDLE`` Max number of connection at rest - Hints.AUTHORITY_MIN_EVICT_IDLETIME + ``Hints.AUTHORITY_MIN_EVICT_IDLETIME`` How long before to wait before reclaiming an unused connection - Hints.AUTHORITY_TIME_BETWEEN_EVICTION_RUNS + ``Hints.AUTHORITY_TIME_BETWEEN_EVICTION_RUNS`` How often we check for idle connections **Reserved Connections** - Hints.AUTHORITY_MIN_IDLE + ``Hints.AUTHORITY_MIN_IDLE`` Minimum number of connection at rest - Hints.AUTHORITY_SOFTMIN_EVICT_IDLETIME + ``Hints.AUTHORITY_SOFTMIN_EVICT_IDLETIME`` How do we ensure we have this many connections **Cache Control** - Hints.CACHE_POLICY + ``Hints.CACHE_POLICY`` Use "weak", "all", "fixed" or "none" - Hints.CACHE_LIMIT + ``Hints.CACHE_LIMIT`` Limit on the number of cached results -Example using the popular commons-dbcp implementation of DataSource:: +Example using the popular ``commons-dbcp`` implementation of DataSource:: BasicDataSource source = new BasicDataSource(); source.setDriverClassName("oracle.jdbc.driver.OracleDriver"); @@ -105,9 +105,9 @@ Example using the popular commons-dbcp implementation of DataSource:: config.put( Hints.AUTHORITY_MIN_IDLE, Integer.valueOf( 0 )); -Please be careful can configure your BasicDataSource to provide more connections then the gt-epsg-oracle module will ask for.: +Please be careful can configure your ``BasicDataSource`` to provide more connections then the ``gt-epsg-oracle`` module will ask for.: -* Number of available connections: source.setMaxActive(10) +* Number of available connections: ``source.setMaxActive(10)`` * Number of connections used:: new Hints(Hints.AUTHORITY_MAX_ACTIVE, Integer.valueOf(3) ); @@ -116,13 +116,13 @@ Please be careful can configure your BasicDataSource to provide more connections Hints.AUTHORITY_MIN_IDLE, Integer.valueOf( 0 ); -* If you do not do this the gt-epsg-oracle module will encounter problems of the following form. +* If you do not do this the ``gt-epsg-oracle`` module will encounter problems of the following form.:: Database failure while creating a 'CoordinateReferenceSystem' object for code "4326" **JNDI** -If you are working in an JNDI environment (like a J2EE application) you can specify the name used to lookup the DataSource.:: +If you are working in an JNDI environment (like a J2EE application) you can specify the name used to lookup the ``DataSource``.:: Hints hints = new Hints( Hints.EPSG_DATA_SOURCE, "jdbc/EPSG" ); @@ -134,7 +134,7 @@ You may want to be careful and use a proper JNDI Name:: Performance ^^^^^^^^^^^ -The following hints effect the performance of epsg-oracle plugin and may be used for performance tuning. +The following hints effect the performance of ``epsg-oracle`` plugin and may be used for performance tuning. * Desktop @@ -161,8 +161,8 @@ The following hints effect the performance of epsg-oracle plugin and may be used hurry. A single client is not going to need many connections at once - and after a while the cache gradually take over and prevent us using the database at all. - The cache policy of all does have the risk of using up a lot of memory (MathTransforms and so on are cached as you use - CoordinateReferenceSystems and so on). + The cache policy of all does have the risk of using up a lot of memory (``MathTransforms`` and so on are cached as you use + ``CoordinateReferenceSystems`` and so on). * Server @@ -188,7 +188,7 @@ The following hints effect the performance of epsg-oracle plugin and may be used We are using a "weak" cache that will return memory used by coordinate reference systems objects when they are no longer in use by any thread. For this server we are expecting only 100 coordinate reference systems to be used (WSG84 - and the UTM zones), but we have chosen a CACHE_LIMIT of 1000 in order to account for all the MathTransforms between + and the UTM zones), but we have chosen a CACHE_LIMIT of 1000 in order to account for all the ``MathTransforms`` between these projections. * Memory @@ -213,7 +213,7 @@ The following hints effect the performance of epsg-oracle plugin and may be used Hints hints = new Hints( config ); Because we are always going to get a cache miss we are going to hold at least one connection open in order to respond - quickly to requests. When working with an open connection the OracleDialectEPSGFactory is quite quick. Please note + quickly to requests. When working with an open connection the ``OracleDialectEPSGFactory`` is quite quick. Please note that we are only retrieving the definitions from the database, the referencing subsystem will still "intern" - CoordinateReferenceSystem objects (it remembers what objects are in use so that it can prevent the creation of + ``CoordinateReferenceSystem`` objects (it remembers what objects are in use so that it can prevent the creation of duplicates). diff --git a/docs/user/library/referencing/order.rst b/docs/user/library/referencing/order.rst index ff0b62cc282..cb0beb7a578 100644 --- a/docs/user/library/referencing/order.rst +++ b/docs/user/library/referencing/order.rst @@ -17,7 +17,7 @@ Now that your program is working you can read the rest of this page. History ^^^^^^^ -When the OGC defined the WMS specification, they were very much focused on making things simple for web developers. So they basically decided that all images would appear "correctly" as far as appearance on the screen was concerned. Computer guys understand that to be x first, and then y (the same assumption is used by the JTS geometries in Geotools). The geographically empowered understand this to be easting and then northing. +When the OGC defined the WMS specification, they were very much focused on making things simple for web developers. So they basically decided that all images would appear "correctly" as far as appearance on the screen was concerned. Computer guys understand that to be x first, and then y (the same assumption is used by the JTS geometries in GeoTools). The geographically empowered understand this to be easting and then northing. This was a great idea in the short term, WMS is a great success. However this was not a good idea as we moved over to working with data. How should things appear when we are looking at Antarctica? Which way is north? More specifically we have problem with the most common data latitude and longitude. The screen order would be (east, north) axis order, but the geographers would expect it the other way around. @@ -41,12 +41,12 @@ Starting in WMS 1.1, the specification actually explicitly states that the EPSG The GeoTools referencing module can not guess by itself when to returns a coordinate reference system (CRS) exactly as specified in the EPSG database, and when to returns a CRS with axis order forced to (longitude, latitude) no matter what the database said. The decision is left to the users or to the DataStore implementers. The choice may changes among different versions of the same standard. -Because GeoTools is designed for handling data from different sources, users need to choose between "strict EPSG axis order" and "modified axis order" on a case-by-case basis. A consequence is that a running Java Virtual Machine may contains two different instances of a CRS, one with (latitude, longitude) axis order and the other one with (longitude, latitude) axis order, and both claiming to be EPSG:4326. Experience has show that the coexistence of such conflicting CRS in the same application can lead to some error like StackOverflowError in non-cautious code. +Because GeoTools is designed for handling data from different sources, users need to choose between "strict EPSG axis order" and "modified axis order" on a case-by-case basis. A consequence is that a running Java Virtual Machine may contains two different instances of a CRS, one with (latitude, longitude) axis order and the other one with (longitude, latitude) axis order, and both claiming to be EPSG:4326. Experience has show that the coexistence of such conflicting CRS in the same application can lead to some error like ``StackOverflowError`` in non-cautious code. GeoTools Solution ^^^^^^^^^^^^^^^^^ -This problem do not requires any change in opengis interfaces or with usage of CoordinateReferenceSystem or CoordinateOperationFactory classes in client code. The problem can be seen as strictly limited to using the right instance of CRSAuthorityFactory by DataStores. For the GeoTools referencing module however, it has the following implications: +This problem does not require any change in OpenGis interfaces or with usage of ``CoordinateReferenceSystem`` or ``CoordinateOperationFactory`` classes in client code. The problem can be seen as strictly limited to using the right instance of ``CRSAuthorityFactory`` by ``DataStores``. For the GeoTools referencing module however, it has the following implications: * GeoTools must be robust to the coexistence of different CRS with the same authority code (e.g. EPSG:4326) but different axis order. In other words, GeoTools must not trust blindly the authority code and performs paranoiac checks when possible. * GeoTools must be able to force the axis order from an arbitrary authority factory to the (longitude, latitude) axis order on user's request. @@ -58,7 +58,7 @@ Example of using Hints:: CRSAuthorityFactory factory = ReferencingFactoryFinder.getCRSAuthorityFactory("EPSG", hints); CoordinateReferenceSystem crs = factory.createCoordinateReferenceSystem("EPSG:4326"); -If the FORCE_LONGITUDE_FIRST_AXIS_ORDER hint is not provided, then the default value is FALSE. The simple CRS class can also be used to specify an authority factory with (longitude, latitude) axis order, with the CRS.getAuthorityFactory(boolean longitudeFirst): +If the ``FORCE_LONGITUDE_FIRST_AXIS_ORDER`` hint is not provided, then the default value is FALSE. The simple ``CRS`` class can also be used to specify an authority factory with (longitude, latitude) axis order, with the ``CRS.getAuthorityFactory(boolean longitudeFirst)``: CRS class example:: @@ -71,14 +71,14 @@ Setting the system-wide default at startup time:: System.setProperty("org.geotools.referencing.forceXY", "true"); -If the application code can't be modified, an alternative is to specify this property when invoking java on the command line. The first example below displays all registered referencing factories. Note the "CRSAuthorityFactory" box: its content has a different order when the system property is set to true. The second command line demonstrates that the EPSG:4326 is really forced to (longitude, latitude) axis order when this property is set. +If the application code can't be modified, an alternative is to specify this property when invoking java on the command line. The first example below displays all registered referencing factories. Note the ``CRSAuthorityFactory`` box: its content has a different order when the system property is set to true. The second command line demonstrates that the ``EPSG:4326`` is really forced to (longitude, latitude) axis order when this property is set. Setting the system-wide default from the command line:: java -Dorg.geotools.referencing.forceXY=true org.geotools.referencing.FactoryFinder java -Dorg.geotools.referencing.forceXY=true org.geotools.referencing.factory.epsg.DefaultFactory 4326 -Note that the FORCE_LONGITUDE_FIRST_AXIS_ORDER hint has precedence over the org.geotools.referencing.forceXY system property. This means that if the hint is provided with value FALSE, then (latitude, longitude) axis order will be used even if the system property was set to true. This allow axis order control on particular well-known CRS authority factories, and keep the system-wide property as the default value only for cases where axis order is unspecified. +Note that the ``FORCE_LONGITUDE_FIRST_AXIS_ORDER`` hint has precedence over the ``org.geotools.referencing.forceXY`` system property. This means that if the hint is provided with value FALSE, then (latitude, longitude) axis order will be used even if the system property was set to true. This allow axis order control on particular well-known CRS authority factories, and keep the system-wide property as the default value only for cases where axis order is unspecified. Writing Code ^^^^^^^^^^^^ @@ -88,31 +88,31 @@ and let your application make decisions based on your knowledge of your users. Guidelines for CRS handling in GeoTools: -* Work with CoordinateReferenceSystem objects when defining an API (not magic strings). -* Believe the CoordinateReferenceSystem your user gave you! Trust them, they may built it by hand. +* Work with ``CoordinateReferenceSystem`` objects when defining an API (not magic strings). +* Believe the ``CoordinateReferenceSystem`` your user gave you! Trust them, they may built it by hand. In turn here is what we would like you to do when writing your application. -* Please provide us with a CRS that correctly represents your data: +* Please provide us with a ``CRS`` that correctly represents your data: * If you are in charge of your own data collection, please follow the EPSG database directly. * If using (longitude, latitude) ordered data all the time, then: - * Geotools 2.2: use the epsg-wkt plugin to the referencing system. - * Geotools 2.3: use the epsg-hsql plugin and set the org.geotools.referencing.forceXY system property to true. + * GeoTools 2.2: use the ``epsg-wkt`` plugin to the referencing system. + * GeoTools 2.3: use the ``epsg-hsql`` plugin and set the ``org.geotools.referencing.forceXY`` system property to true. -* If using (latitude,longitude) ordered data all the time, then use the epsg-hsql plugin to the referencing system. -* If using mixed data, then please configure the CRSAuthorityFactory used by your DataStore with assumptions matching your data requirements. The CRS - factory can be configured using the FORCE_LONGITUDE_FIRST_AXIS_ORDER hint on a feature source basis. Note that it may not be necessary to pass a fully - constructed CRSAuthorityFactory object; the above-cited hint will suffise in some cases (depending on DataStore implementation). +* If using (latitude,longitude) ordered data all the time, then use the ``epsg-hsql`` plugin to the referencing system. +* If using mixed data, then please configure the ``CRSAuthorityFactory`` used by your ``DataStore`` with assumptions matching your data requirements. The CRS + factory can be configured using the ``FORCE_LONGITUDE_FIRST_AXIS_ORDER`` hint on a feature source basis. Note that it may not be necessary to pass a fully + constructed ``CRSAuthorityFactory`` object; the above-cited hint will suffice in some cases (depending on ``DataStore`` implementation). - The last recommendation applies especially to DataStore implementers. We recommend to set the FORCE_LONGITUDE_FIRST_AXIS_ORDER hint every time the axis + The last recommendation applies especially to ``DataStore`` implementers. We recommend to set the ``FORCE_LONGITUDE_FIRST_AXIS_ORDER`` hint every time the axis order is well known, even if the value is FALSE. Do not rely on the default value since it may be system-wide settings dependent. URN Syntax ^^^^^^^^^^ -You can make use of the OGC supplied urn syntax (ie urn:x-ogc:def:crs:EPSG::) rather than just an EPSG code:: +You can make use of the OGC supplied URN syntax (i.e. ``urn:x-ogc:def:crs:EPSG::``) rather than just an EPSG code:: CoordinateReferenceSystem crs = factory.createCoordinateReferenceSystem("urn:x-ogc:def:crs:EPSG:4326"); -If possible use the URI authority syntax where possible, as it does not suffer from the axis order problem. +If possible use the URN authority syntax where possible, as it does not suffer from the axis order problem. diff --git a/docs/user/library/referencing/parameter.rst b/docs/user/library/referencing/parameter.rst index 4f5be45e15f..9d84f1643c7 100644 --- a/docs/user/library/referencing/parameter.rst +++ b/docs/user/library/referencing/parameter.rst @@ -1,13 +1,13 @@ Parameter --------- -The **gt-referencing** module is the first one to use the **Parameter** and **ParameterGroup** data structure defined by **gt-opengis**. +The ``gt-referencing`` module is the first one to use the ``Parameter`` and ``ParameterGroup`` data structure defined by ``gt-opengis``. These Parameters are a bit odd for Java developers: * They are actually a dynamic type system (you need to inspect the values at runtime in order to learn what values are acceptable) * They are based an ISO Standard, rather than Java Beans -* They are strongly typed (you need a ParameterDescriptor in place to create a ParameterValue) +* They are strongly typed (you need a ``ParameterDescriptor`` in place to create a ``ParameterValue``) * They allow multiplicity, the same parameter can be repeated multiple times if needed. Very similar to how XML elements are allowed to repeat * They allow parameters to be "grouped", similar to how XML supports elements in a sequence @@ -17,7 +17,7 @@ ParameterDescriptor and Parameter .. image:: /images/parameter.PNG -A ParameterDescriptor is used to advertise what values are acceptable, the quickest way to show this is to create one.:: +A ``ParameterDescriptor`` is used to advertise what values are acceptable, the quickest way to show this is to create one.:: final DefaultParameterDescriptor RANGE = new DefaultParameterDescriptor("Range", 15.0, -30.0, +40.0, null) @@ -32,12 +32,12 @@ Please note that metadata classes such as Identifier are used here:: Identifier name = RANGE.getName(); System.out.println( name ); -A ParameterValue is used to hold a single value, within the limits of the ParameterDescriptor.:: +A ``ParameterValue`` is used to hold a single value, within the limits of the ``ParameterDescriptor``.:: ParameterValue value = (ParameterValue) RANGE.createValue(); value.setValue( 2.0 ); -You are kind of on the honour system here:: +You are kind of on the honor system here:: value.setValue( 20.0 ); // out of RANGE value.setValue( 2 ); // wrong type @@ -49,7 +49,7 @@ You can actually get very specific with the use of units:: Citations.GEOTOOLS, "Limit", Double.class, null, null, null. null, SI.METER.divide(SI.SECOND), true); -You can indicate a set of valid values with a "CodeList" (like a Java 1.4 enum, but allows more values at runtime):: +You can indicate a set of valid values with a ``CodeList`` (like a Java 1.4 ``enum``, but allows more values at runtime):: final DefaultParameterDescriptor STATUS = new DefaultParameterDescriptor("Status",Status.GOOD ); @@ -77,7 +77,7 @@ ParameterDescriptorGroup and ParameterGroup .. image:: /images/parametergroup.PNG -You can also have groups of parameters (that may repeat if needed as indicated by minOccurs and maxOccurs). Here is a simple example with associating prefix with URI.:: +You can also have groups of parameters (that may repeat if needed as indicated by ``minOccurs`` and ``maxOccurs``). Here is a simple example with associating prefix with URI.:: final DefaultParameterDescriptor PREFIX = new DefaultParameterDescriptor( @@ -108,4 +108,5 @@ You can use a Map to quickly create a citation, in case a constant does not suit new DefaultParameterDescriptor[]{PREFIX,NAMESPACE} ); -The above example also has the References2 group being optional (minOccurs == 0), and any number of references are allowed (maxOccurs == Integer.MAX_VALUE ). +The above example also has the ``References2`` group being optional (``minOccurs == 0``), and any number of references are allowed +(``maxOccurs == Integer.MAX_VALUE``). diff --git a/docs/user/library/referencing/postgresql.rst b/docs/user/library/referencing/postgresql.rst index a17ea488360..1f86204948f 100644 --- a/docs/user/library/referencing/postgresql.rst +++ b/docs/user/library/referencing/postgresql.rst @@ -1,13 +1,13 @@ EPSG PostgreSQL Plugin ---------------------- -GeoTools Coordinate Transformation Services can use the EPSG Geodesy Parameters database (http://www.epsg.org) to provide CoordinateReferenceSystem definitions for authority codes. +GeoTools Coordinate Transformation Services can use the EPSG Geodesy Parameters database (http://www.epsg.org) to provide ``CoordinateReferenceSystem`` definitions for authority codes. -Note: GeoTools 2.5.1 does not support Postgresql version 8.3 with this class/jar. You must be using Postgresql 8.2 or less: Postgresql 8.3 will not work. +Note: GeoTools 2.5.1 does not support PostgreSQL version 8.3 with this class/jar. You must be using PostgreSQL 8.2 or less: PostgreSQL 8.3 will not work. -The following document describes how to set the version 6.5 database up on Linux. The original version of this document was written by Richard Didier and is attached at the end. The modified SQL scripts are also attached as EPSG_v65.mdb-sql.zip. +The following document describes how to set the version 6.5 database up on Linux. The original version of this document was written by Richard Didier and is attached at the end. The modified SQL scripts are also attached as ``EPSG_v65.mdb-sql.zip``. -To use the gt-epsg-postgres: +To use the ``gt-epsg-postgres``: 1. Place the jar on your CLASSPATH 2. Supply global hints or system property @@ -21,19 +21,19 @@ These instructions assume the following: * OS Linux (installed, working) * Standard Mandrake installation of PostgreSQL. -* PostGIS installed in contrib pgsql (/usr/lib/pgsql). +* PostGIS installed in ``/usr/lib/pgsql/contrib``. * SQL scripts provided by the EPSG: - 1. EPSG_v65.mdb_DDL.sql (table definitions); - 2. EPSG_v65.mdb_DML.sql (data). + 1. ``EPSG_v65.mdb_DDL.sql`` (table definitions); + 2. ``EPSG_v65.mdb_DML.sql`` (data). -* Modified SQL scripts - attached as EPSG_v65.mdb-sql.zip +* Modified SQL scripts - attached as ``EPSG_v65.mdb-sql.zip`` * Privileges needed: 1. System administrator (SA); - 2. PostgreSQL administrator: usually launches the postgreSQL server (it + 2. PostgreSQL administrator: usually launches the PostgreSQL server (it is normally not able to log onto the system); - 3. a Unix user (epsg_reader), to administrate the epsg database (US). + 3. a Unix user (``epsg_reader``), to administrate the EPSG database (US). These instructions use the following files: @@ -43,80 +43,81 @@ The EPSG SQL DDL and DML scripts have lots of Windows carriage returns, as well EPSG_v65.mdb_DDL.sql: -* #302, lacks a comma between the parameter_code and coord_op_method_code +* #302, lacks a comma between the ``parameter_code`` and ``coord_op_method_code`` * you should add a BEGIN; and a COMMIT; to the DDL (beginning and end) -* the (ALTER TABLE) constraints were moved to EPSG_v65.mdb_DDL2.sql +* the (ALTER TABLE) constraints were moved to ``EPSG_v65.mdb_DDL2.sql`` EPSG_v65.mdb_DML.sql: * you should add a BEGIN; and a COMMIT; to the DML (beginning and end) * the order of the tables does not conform with the integrity constraints, a better order is: - * epsg_namingsystem - * epsg_alias - * epsg_area - * epsg_change - * epsg_deprecation - * epsg_coordinateaxisname - * epsg_coordinatesystem - * epsg_unitofmeasure - * epsg_coordinateaxis - * epsg_ellipsoid - * epsg_primemeridian - * epsg_datum - * epsg_coordinatereferencesystem - * epsg_coordoperationmethod - * epsg_coordoperation - * epsg_coordoperationpath - * epsg_coordoperationparam - * epsg_coordoperationparamusage - * epsg_coordoperationparamvalue - * epsg_versionhistory + * ``epsg_namingsystem`` + * ``epsg_alias`` + * ``epsg_area`` + * ``epsg_change`` + * ``epsg_deprecation`` + * ``epsg_coordinateaxisname`` + * ``epsg_coordinatesystem`` + * ``epsg_unitofmeasure`` + * ``epsg_coordinateaxis`` + * ``epsg_ellipsoid`` + * ``epsg_primemeridian`` + * ``epsg_datum`` + * ``epsg_coordinatereferencesystem`` + * ``epsg_coordoperationmethod`` + * ``epsg_coordoperation`` + * ``epsg_coordoperationpath`` + * ``epsg_coordoperationparam`` + * ``epsg_coordoperationparamusage`` + * ``epsg_coordoperationparamvalue`` + * ``epsg_versionhistory`` Notes about Richard's SQL scripts -* Because of the problems with the integrity constraints, modified SQL DDL and DML files were created (attached as EPSG_v65.mdb-sql.zip). +* Because of the problems with the integrity constraints, modified SQL DDL and DML files were created (attached as ``EPSG_v65.mdb-sql.zip``). * These allow the integrity constraints to be added to the tables after the records are inserted. * These new files are: * EPSG_v65.mdb_DDL.sql - table definitions * EPSG_v65.mdb_DDL2.sql - integrity constraints (ALTER TABLE) - * EPSG_v65.mdb_DDL3.sql - drop table statements to DELETE all the epsg tables in the database + * EPSG_v65.mdb_DDL3.sql - drop table statements to DELETE all the ``epsg`` tables in the database * EPSG_v65.mdb_DML.sql - database records to insert Here are the instructions: 1. Open access to the new database (SA): - Geotools CTS will need to access the database through a JDBC driver. + GeoTools CTS will need to access the database through a JDBC driver. Modify the access configuration file - var/lib/pgsql/data/hb_pga.conf/ (SA) add:: + ``var/lib/pgsql/data/hb_pga.conf/`` (SA) add:: ... host epsg 127.0.0.1 255.255.255.255 password web host epsg 192.168.0.0 255.255.255.0 password web - This indicates that the database 'epsg' is accessible locally or via the machine + This indicates that the database ``epsg`` is accessible locally or via the machine with the IP address 192.168.0.0, requires a password, and is restricted to users - whose name exists in the file /var/lib/pgsql/data/web:: + whose name exists in the file ``/var/lib/pgsql/data/web``:: ... epsg_reader - (SA) now restart the postgreSQL server:: + (SA) now restart the PostgreSQL server:: $ service postgresql restart Arrêt de postgresql [ OK ] Démarrage de postgresql [ OK ] -2. Create the administrator of the new epsg database (SA): +2. Create the administrator of the new ``epsg`` database (SA): - Create the administrative user of the new epsg database. This can be done by the - system administrator (SA) if the postgres user has no right to log onto linux - system (his login shell does not belong to /etc/shells like /bin/false). + Create the administrative user of the new ``epsg`` database. This can be done by the + system administrator (SA) if the ``postgres`` user has no right to log onto Linux + system (his login shell does not belong to ``/etc/shells`` like + ``/bin/false``). - The createuser can be carried out as the postgres user directly, if this user has + The ``createuser`` can be carried out as the ``postgres`` user directly, if this user has permission to log onto the system.:: $ su - postgres -c "createuser --createdb --adduser --pwprompt --echo epsg_reader" @@ -127,7 +128,7 @@ Here are the instructions: 3. Create the database (US) - The following steps describe how to create the epsg database and turn this into a + The following steps describe how to create the ``epsg`` database and turn this into a PostGIS spatial database. Note: @@ -137,9 +138,9 @@ Here are the instructions: it graphically! * Installing PostGIS (and some of the following steps) are not necessary to use the - EPSG database with Geotools. + EPSG database with GeoTools. - The user (administrator) begins by creating a new postgreSQL database:: + The user (administrator) begins by creating a new PostgreSQL database:: $ createdb -U epsg_reader -h localhost -E LATIN9 -e epsg "EPSG sous postgreSQL" Password: @@ -149,7 +150,7 @@ Here are the instructions: COMMENT ON DATABASE "epsg" IS 'EPSG sous postgreSQL' COMMENT - Then the database administrator creates the PL/pgSQL language for PostGIS in + Then the database administrator creates the ``PL/pgSQL`` language for PostGIS in the database:: $ createlang -U epsg_reader -h localhost plpgsql epsg @@ -171,7 +172,7 @@ Here are the instructions: ... COMMIT - Lastly, grant the epsg_reader user permission to read the PostGIS tables:: + Lastly, grant the ``epsg_reader`` user permission to read the PostGIS tables:: $ psql -U epsg_reader -h localhost -c "grant select on geometry_columns, spatial_ref_sys to epsg_reader;" epsg Password: @@ -182,7 +183,8 @@ Here are the instructions: Note: * If errors occur, the following SQL command must be issued to - clean the posgreSQL database before restarting the creation/import process:: + clean the PostgreSQL database before restarting the creation/import process:: + $ psql -U epsg_reader -h localhost -f /path/2/EPSG_v65.mdb_DDL3.sql epsg @@ -203,7 +205,7 @@ Here are the instructions: $ psql -U epsg_reader -h localhost -f /path/2/EPSG_v65.mdb_DDL2.sql epsg ... - Finally, vacuume analyze the new database:: + Finally, vacuum analyze the new database:: $ vacuumdb -U epsg_reader -h localhost -z epsg ... @@ -252,14 +254,14 @@ Here are the instructions: 6. Provides connection parameters - Create a EPSG-DataSource.properties file in the user home directory with the following content: + Create a EPSG-DataSource.properties file in the user home directory with the following content:: - * serverName = myserver.foo.com - * databaseName = mydatabase - * user = ... - * password = ... + serverName = myserver.foo.com + databaseName = mydatabase + user = ... + password = ... - If the Geotools libraries are installed, a better test will be:: + If the GeoTools libraries are installed, a better test will be:: $ java -cp gt-epsg-postgresql-2.5.1.jar org.geotools.referencing.CRS EPSG:4326 EPSG:2154 EPSG:7412 @@ -333,4 +335,4 @@ Here are the instructions: AUTHORITY["EPSG","5719"]], AUTHORITY["EPSG","7412"]] - For more information please see Referencing Configuration and Tool. \ No newline at end of file + For more information please see Referencing Configuration and Tool. diff --git a/docs/user/library/referencing/transform.rst b/docs/user/library/referencing/transform.rst index 9fd5be46890..26ba593391b 100644 --- a/docs/user/library/referencing/transform.rst +++ b/docs/user/library/referencing/transform.rst @@ -1,12 +1,12 @@ Transform --------- -The following is a list of the projection parameters used in the Geotools referencing module. These try to follow the OGC Coordinate Transformation Services specification (OGC 01-009), but this document only specified the parameters for a few projections. When in doubt we have followed the EPSG Guidance Note Number 7 and suggestions from the Projections Transform List. +The following is a list of the projection parameters used in the GeoTools referencing module. These try to follow the OGC Coordinate Transformation Services specification (OGC 01-009), but this document only specified the parameters for a few projections. When in doubt we have followed the EPSG Guidance Note Number 7 and suggestions from the Projections Transform List. Parameter Names ^^^^^^^^^^^^^^^ -Parameters can have more than one name, and are recognised by all the names known to the MathTransformFactory. Many classification and parameter names in GeoTools come from the legacy OGC 01-009 document. But what about other standards for classification names (e.g., "Transverse_Mercator" and "Orthogonal") and parameter names (e.g., "semi_major")? +Parameters can have more than one name, and are recognized by all the names known to the ``MathTransformFactory``. Many classification and parameter names in GeoTools come from the legacy OGC 01-009 document. But what about other standards for classification names (e.g., "Transverse_Mercator" and "Orthogonal") and parameter names (e.g., "semi_major")? **GeoTIFF parameter names** @@ -14,7 +14,7 @@ In addition to OGC 01-009, we used an other source of very valuable references f http://www.remotesensing.org/geotiff/proj_list/ -This list provides both GeoTIFF and OGC classification and parameter names. This web site was actually one of our main sources for classification and parameter names in Geotools. The "Mercator (1SP)" projection in this list provides the "latitude_of_origin" and similar parameters. +This list provides both GeoTIFF and OGC classification and parameter names. This web site was actually one of our main sources for classification and parameter names in GeoTools. The "Mercator (1SP)" projection in this list provides the "latitude_of_origin" and similar parameters. **Custom parameter names** @@ -22,9 +22,9 @@ But let's say I'm a developer and I want to develop something that has no "offic **Authorities for Parameter and Classification Names** -However, each name is always associated to an authority (or a "scope" in the context of scoped names). Thats said, the full name of "semi_major" is actually "OGC:semi_major", where "semi_major" is the LocalName (from the org.opengis.util package) and "OGC" is the scope. The mechanism is similar to fully qualified names in Java packages. +However, each name is always associated to an authority (or a "scope" in the context of scoped names). That said, the full name of "semi_major" is actually "OGC:semi_major", where "semi_major" is the ``LocalName`` (from the ``org.opengis.util`` package) and "OGC" is the scope. The mechanism is similar to fully qualified names in Java packages. -It should always be possible to know if a particular name is an OGC's name or a GeoTIFF one: just look at the scope. For our own transformation, we use "Geotools:" scope. If we find an official name from OGC later, we will add that "OGC:" scoped name. +It should always be possible to know if a particular name is an OGC name or a GeoTIFF one: just look at the scope. For our own transformation, we use "GeoTools:" scope. If we find an official name from OGC later, we will add that "OGC:" scoped name. **Multiple names for Parameters** @@ -32,25 +32,25 @@ A single physical parameter can have more than one name. Each classification/par java org.geotools.referencing.operation.DefaultMathTransformFactory Mercator_1SP -Geotools will tells you that it know all of the above names for this transformation: +GeoTools will tells you that it know all of the above names for this transformation: * OGC:Mercator_1SP * EPSG:Mercator (1SP) * EPSG:9804 * GeoTIFF:CT_Mercator -* Geotools:Projection Mercator cylindrique +* GeoTools:Projection Mercator cylindrical -Note the Geotools name is localised, so it may appears in another language depending on how you have your machine set up. +Note the GeoTools name is localized, so it may appears in another language depending on how you have your machine set up. -One can use any of those names. Geotools will recognizes "CT_Mercator" as well as "Mercator_1SP". However, if one wants to be sure that he is looking for a GeoTIFF name and not an OGC name, we can always use the fully qualified name. +One can use any of those names. GeoTools will recognizes "CT_Mercator" as well as "Mercator_1SP". However, if one wants to be sure that he is looking for a GeoTIFF name and not an OGC name, we can always use the fully qualified name. For example GeoTools: * GeoTIFF:CT_Mercator - will accept this name -* OGC:CT_Mercator - but won't recognise this one -* OGC:Mercator_1SP - recognised +* OGC:CT_Mercator - but won't recognize this one +* OGC:Mercator_1SP - recognized -One can use DefaultMathTransformFactory in order to experiment the names from the command line. +One can use ``DefaultMathTransformFactory`` in order to experiment the names from the command line. Map Projection Parameters ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -63,7 +63,7 @@ All projections have the following default parameters: * false_easting - easting value assigned to the natural origin (added to all x coordinates) * false_northing - northing value assigned to the natural origin (added to all y coordinates) -The "semi_major" and "semi_minor" parameters do not need to be specified in the projection section of WKT strings, since this information can be obtained from the GEOGCS. +The "semi_major" and "semi_minor" parameters do not need to be specified in the projection section of WKT strings, since this information can be obtained from the ``GEOGCS``. Additional parameters are shown in the following table. Note that "latitude_of_origin" and "scale_factor" are usually default parameters, except in the Mercator and some conic projections. @@ -151,26 +151,26 @@ Additional parameters are shown in the following table. Note that "latitude_of_o - - -latitude_of_origin +Latitude_of_origin latitude of the natural origin (for rectangular coordinates) -scale_factor +Scale_factor scale factor at the natural origin (along a parallel of latitude) -standard_parallel_1 +Standard_parallel_1 latitude of first standard parallel (true to scale) -standard_parallel_2 +Standard_parallel_2 latitude of second standard parallel (true to scale) -latitude_true_scale +Latitude_true_scale latitude (parallel) where the scale will equal the scale factor Notes * For the "Lambert_Conformal_Conic_1SP", the standard parallel is equal to the latitude of origin. * The "latitude_true_scale" parameter of the "Polar_Stereographic" is not a standard EPSG parameter. "Polar_Stereographic_Series" uses the correct EPSG parameters (but a non-standard name). -* For more information, see the javadocs for the projection classes in Geotools. +* For more information, see the javadocs for the projection classes in GeoTools. Notes about projections in ESRI's ArcGIS 8.x @@ -183,22 +183,22 @@ Other Math Transform Parameters "Affine" -* num_row - number of rows in matrix -* num_col - number of columns in matrix -* elt__ - element of matrix (where r is from 0 to (num_row - 1) and c is from 0 to (num_col - 1) +* ``num_row`` - number of rows in matrix +* ``num_col`` - number of columns in matrix +* ``elt__`` - element of matrix (where ``r`` is from 0 to ``(num_row - 1)`` and ``c`` is from 0 to ``(num_col - 1)`` "Geocentric_To_Ellipsoid" and "Ellipsoid_To_Geocentric" -* semi_major - equatorial radius of the ellipsoid of reference -* semi_minor - polar radius of the ellipsoid of reference +* ``semi_major`` - equatorial radius of the ellipsoid of reference +* ``semi_minor`` - polar radius of the ellipsoid of reference "Molodenski" and "Abridged_Molodenski" -* dim - dimension of points (2 or 3) -* dx - x shift (m) -* dy - y shift (m) +* ``dim`` - dimension of points (2 or 3) +* ``dx`` - x shift (m) +* ``dy`` - y shift (m) * dz - z shift (m) -* src_semi_major - source equatorial radius (m) -* src_semi_minor - source polar radius (m) -* tgt_semi_major - target equatorial radius (m) -* tgt_semi_minor - target polar radius (m) +* ``src_semi_major`` - source equatorial radius (m) +* ``src_semi_minor`` - source polar radius (m) +* ``tgt_semi_major`` - target equatorial radius (m) +* ``tgt_semi_minor`` - target polar radius (m) diff --git a/docs/user/library/referencing/wkt.rst b/docs/user/library/referencing/wkt.rst index a8ead3c915d..10703e287df 100644 --- a/docs/user/library/referencing/wkt.rst +++ b/docs/user/library/referencing/wkt.rst @@ -1,11 +1,11 @@ EPSG WKT Plugin ^^^^^^^^^^^^^^^ -The plugin provides an Coordinate Reference System Authority based on a text file (actually a Java **epsg.properties** file). +The plugin provides an Coordinate Reference System Authority based on a text file (actually a Java ``epsg.properties`` file). -This epsg plugin is well suited for use in situations where your application does not have write access to the filesystem (and thus gt-epsh-hsql is not available). + This EPSG plugin is well suited for use in situations where your application does not have write access to the file system (and thus ``gt-epsh-hsql`` is not available). -It is not quite as good as the official epsg database; as the codes represented here do not express the full range of bursa wolf parameters available in the official epsg database. Some liberty has also been taken with axis order with the contents often presented is "x/y" order as expected by a simple drawing application. +It is not quite as good as the official EPSG database; as the codes represented here do not express the full range of bursa wolf parameters available in the official EPSG database. Some liberty has also been taken with axis order with the contents often presented is "x/y" order as expected by a simple drawing application. This plugin is well suited for use in a Java Applet or other restricted environment. @@ -20,7 +20,7 @@ The Plugin will work out of the box, include it in your CLASSPATH. Beyond EPSG Database '''''''''''''''''''' -The **epsg.properties** file does contain definitions that go beyond those defined by the EPSG database. Traditionally this has been limited to those needed to work by the module maintainer for the Canadian Region; and a few donated on the mailing list for areas like New Zealand. +The ``epsg.properties`` file does contain definitions that go beyond those defined by the EPSG database. Traditionally this has been limited to those needed to work by the module maintainer for the Canadian Region; and a few donated on the mailing list for areas like New Zealand. If you have any additions or corrections please raise a bug report. diff --git a/docs/user/library/render/faq.rst b/docs/user/library/render/faq.rst index ee206983b7f..0707e1efd31 100644 --- a/docs/user/library/render/faq.rst +++ b/docs/user/library/render/faq.rst @@ -13,7 +13,7 @@ Style Layer Descriptor Specification (SLD) is an OGC standard defining styles used when drawing maps. Think of it as CSS for maps. GeoTools rendering is based around the Style Layer Descriptor standard, -for details please see the gt-opengis module. +for details please see the ``gt-opengis`` module. This standard is divided into two parts: @@ -29,10 +29,10 @@ Q: What is a MapContent? A MapContent object holds one or more Layers which are rendered in the order that they were added. -This is not part of the formal gt-opengis module because it is not +This is not part of the formal ``gt-opengis`` module because it is not considered finished, done, or complete. The GeoTools community is actively looking to collaborate with other projects (such as OpenJUMP, -uDig and deegree) in order to collaborate on these ideas. If open +uDig and Deegree) in order to collaborate on these ideas. If open source collaboration fails we will look to traditional collaboration with a standards body in the form of the the OGC working group on "Open Web Context" documents. @@ -44,20 +44,20 @@ This module only draws into a Graphics2D context (so printer or image buffer). You can use this functionality in your own Swing widget in order to draw something on screen. -* gt-swing +* ````gt-swing```` GeoTools does not provide comprehensive GUI components but there is a - basic Swing widget JMapFrame in the **gt-swing** module which is used + basic Swing widget JMapFrame in the ````gt-swing```` module which is used in GeoTools example code. This can be used directly in your applications or it could form the starting point for writing your own Swing components. See JMapFrame for more details. -* gt-swt +* ``gt-swt`` - The gt-swing JMapFrame has been ported to an SWT widget as an + The ``gt-swing`` JMapFrame has been ported to an SWT widget as an unsupported module. -* udig +* uDig uDig is an application and SDK built around the Eclipse platform, please consider this a real world solution suitable for desktop @@ -68,10 +68,11 @@ order to draw something on screen. Q: What about Raster Advanced Projection Handling? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Advanced Projection Handling is a feature provided by the GridCoverageRenderer class +Advanced Projection Handling is a feature provided by the +``GridCoverageRenderer`` class for handling Raster reprojection. It is especially useful when trying to -read a GridCoverage with a BoundingBox crossing the DateLine: the final image -is not cut on the DateLine but it is replicated as many times as the DateLine +read a ``GridCoverage`` with a ``BoundingBox`` crossing the Date Line: the final image +is not cut on the Date Line but it is replicated as many times as the Date Line is crossed. This feature can be enabled/disabled using the related method @@ -80,7 +81,7 @@ This feature can be enabled/disabled using the related method Q: Why does my SVG external graphic display as a gray square? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -GeoTools uses a plugable External Graphics factory system to render an icon +GeoTools uses a pluggable External Graphics factory system to render an icon (see :doc:`/library/render/icon` for more details) onto the screen. To render SVG files as icons it needs access to the SVGExternalGraphics factory which is included in the :doc:`/library/render/svg`. diff --git a/docs/user/library/render/gtrenderer.rst b/docs/user/library/render/gtrenderer.rst index b04eec10a60..5f4f20225b4 100644 --- a/docs/user/library/render/gtrenderer.rst +++ b/docs/user/library/render/gtrenderer.rst @@ -1,28 +1,28 @@ -GTRenderer to draw maps ------------------------ +``GTRenderer`` to draw maps +--------------------------- -GTRenderer renderer is the reason why you signed up for this whole GeoTools experience; you want to see a Map. +``GTRenderer`` renderer is the reason why you signed up for this whole GeoTools experience; you want to see a Map. -GTRenderer is actually an interface; currently there are two implementations: +``GTRenderer`` is actually an interface; currently there are two implementations: -* StreamingRenderer - a great implementation that does not cache anything. This decision makes it easier to understand and allows it to tackle that large datasets without running out of memory. -* ShapefileRenderer - (unsupported) restricted to shapefiles as a playground for trying out speed improvements. However all the good optimisations have been picked up by StreamingRenderer. +* ``StreamingRenderer`` - a great implementation that does not cache anything. This decision makes it easier to understand and allows it to tackle that large data sets without running out of memory. +* ``ShapefileRenderer`` - (unsupported) restricted to shapefiles as a playground for trying out speed improvements. However all the good optimizations have been picked up by ``StreamingRenderer``. .. image:: /images/GTRenderer.PNG -Here is how to drawn an outputArea rectangle:: +Here is how to drawn an ``outputArea`` rectangle:: GTRenderer draw = new StreamingRenderer(); draw.setMapContent(map); draw.paint(g2d, outputArea, map.getLayerBounds() ); -If you have completed the Quickstart, this is the approach used by the JMapPane class we use in a +If you have completed the quick start, this is the approach used by the ``JMapPane`` class we use in a lot of our tutorials. -The important part of the above example is that GTRenderer works on the Java2D class -**Graphics2D**. You can find many implementations of Graphics2D allowing GeoTools to work with a +The important part of the above example is that ``GTRenderer`` works on the Java2D class +``Graphics2D``. You can find many implementations of ``Graphics2D`` allowing GeoTools to work with a range of graphics systems beyond the screen. Swing @@ -30,9 +30,9 @@ Swing You can create a swing control to render the image interactively; we -provide an example JMapPane for use in our tutorials. +provide an example ``JMapPane`` for use in our tutorials. -GTRenderer is just a rendering engine - in your own application you may +``GTRenderer`` is just a rendering engine - in your own application you may consider the following ideas: * Experiment with different Java 2D graphics settings such as @@ -46,7 +46,7 @@ consider the following ideas: A Google summer of code student put together and example of rendering into a texture buffers and using OpenGL to handle panning and zooming. -Personally I would look for an Graphics2D implementation that was +Personally I would look for an ``Graphics2D`` implementation that was backed by OpenGL commands and use GeoTools to render out into the scene graph. @@ -56,8 +56,8 @@ If you are interested in the students code it is currently in the Printing ^^^^^^^^ -The Java2D library is also used for Java printing. You can print using StreamingRenderer, the code works like normal just -use the Graphics2D object from your Printer. +The Java2D library is also used for Java printing. You can print using ``StreamingRenderer``, the code works like normal just +use the ``Graphics2D`` object from your Printer. uDig uses this facility to allow for printing maps directly to the printer. @@ -65,8 +65,8 @@ printer. PDF ^^^ -We have also had success using GTRenderer and Batik for the generation -of PDF output (they provide a Graphics2D object). +We have also had success using ``GTRenderer`` and Batik for the generation +of PDF output (they provide a ``Graphics2D`` object). You can see this functionality in uDig and GeoServer. @@ -117,7 +117,7 @@ Thanks to James Macgill for the following code example: Image ^^^^^ -You can also ask Java to make you a Graphics2D for a BufferedImage in memory. After drawing into this +You can also ask Java to make you a ``Graphics2D`` for a ``BufferedImage`` in memory. After drawing into this image you can write it out to disk. Here is an example from Oliver on the email list (modified slightly to use current GeoTools classes):: diff --git a/docs/user/library/render/icon.rst b/docs/user/library/render/icon.rst index dc3b48a9e27..5b26ef67b87 100644 --- a/docs/user/library/render/icon.rst +++ b/docs/user/library/render/icon.rst @@ -22,8 +22,8 @@ To use this class we are going to need to define a style that refers to this new To register your class you will need to: -1. Create the following folder: META_INF/services/ -2. In this folder create a file: org.geotools.renderer.style.MarkFactory +1. Create the following folder: ``META_INF/services/`` +2. In this folder create a file: ``org.geotools.renderer.style.MarkFactory`` The contents of this file should list your implementation:: @@ -45,5 +45,5 @@ This class is responsible for: Your implementation can: -* implement a dynamic Icon directly (useful for symbols that need to be composed based on feature attributes) -* or as simple as a straight SwingIcon backed by a PNG file contained in your jar. +* implement a dynamic ``Icon`` directly (useful for symbols that need to be composed based on feature attributes) +* or as simple as a straight ``SwingIcon`` backed by a PNG file contained in your jar. diff --git a/docs/user/library/render/map.rst b/docs/user/library/render/map.rst index 92fa07082da..db7b2603cda 100644 --- a/docs/user/library/render/map.rst +++ b/docs/user/library/render/map.rst @@ -1,24 +1,24 @@ Map data and display classes ---------------------------- -The gt-render module defines a new data structure to represent the contents of a map. MapContent +The ``gt-render`` module defines a new data structure to represent the contents of a map. ``MapContent`` defines a map as a series of layers (which are drawn in order). This is not part of the formal -gt-opengis module because it is not based on a standard. +``gt-opengis`` module because it is not based on a standard. MapContent ^^^^^^^^^^ -MapContent is used to capture the contents of a map for rendering. +``MapContent`` is used to capture the contents of a map for rendering. .. image:: /images/map_content.PNG These ideas are broken down into the following three classes: -* **MapContent** +* ``MapContent`` The contents of a map to be drawn. -* **MapViewport** +* ``MapViewport`` Represents the area of the map to drawn. The viewport stores: @@ -26,14 +26,14 @@ These ideas are broken down into the following three classes: * the screen, image or device bounds to draw into; * the coordinate transforms used to convert between world and screen positions. - In practice, you provide the world and screen bounds to a MapViewport object and + In practice, you provide the world and screen bounds to a ``MapViewport`` object and it calculates the coordinate transforms for you (see :ref:`aspect-ratio` for more details). Potentially, a viewport could also work with parameters other than horizontal spatial extent when - defining the map data to be drawn such as height or time. The MapViewport class does not presently + defining the map data to be drawn such as height or time. The ``MapViewport`` class does not presently support such usage but you could derive a sub-class for this purpose. -* **Layer** - represents a layer of content to be drawn; layers are held in a list and are drawn in +* ``Layer`` - represents a layer of content to be drawn; layers are held in a list and are drawn in order. Examples: @@ -74,12 +74,12 @@ Aspect-ratio of map and screen bounds ''''''''''''''''''''''''''''''''''''' Very often, the aspect ratio (ratio of width to height) of the world and screen bounds will differ. -By default, MapViewport does not make any correction for this (this behaviour accords with the OGC -WMS specification which states that a map server should honour the bounds provided by the user +By default, ``MapViewport`` does not make any correction for this (this behavior accords with the OGC +WMS specification which states that a map server should honor the bounds provided by the user regardless of any distortion which results). -In many cases, it is preferable to have MapViewport automatically correct for differing aspect -ratios, thereby avoiding distortion in the map display. You can request this behaviour as follows:: +In many cases, it is preferable to have ``MapViewport`` automatically correct for differing aspect +ratios, thereby avoiding distortion in the map display. You can request this behavior as follows:: MapViewport vp = myMapContent.getViewport(); vp.setMatchingAspectRatio( true ); @@ -92,27 +92,27 @@ user. Layer ^^^^^ -We have different subclasses of of Layer each specifically made for working with different kinds +We have different subclasses of of ``Layer`` each specifically made for working with different kinds of content. .. image:: /images/layer.PNG -The important information each Layer implementation must provided is: +The important information each ``Layer`` implementation must provided is: -* Layer.getTitle() -* Layer.setTitle( String ) +* ``Layer.getTitle()`` +* ``Layer.setTitle( String )`` Used in a legend to display to the user -* Layer.isVisible() -* Layer.setVisible( boolean ) -* Layer.getuserData() +* ``Layer.isVisible()`` +* ``Layer.setVisible( boolean )`` +* ``Layer.getuserData()`` A general purpose map used by applications to hold information. This - approach was preferred as an alternative to loading up Layer with additional methods to + approach was preferred as an alternative to loading up ``Layer`` with additional methods to handle selection, error feedback and so forth. -* Layer.getBounds() - the extent of the data being rendered by the Layer -* Layer.addMapLayerListener() -* Layer.removeMapLayerListener() +* ``Layer.getBounds()`` - the extent of the data being rendered by the ``Layer`` +* ``Layer.addMapLayerListener()`` +* ``Layer.removeMapLayerListener()`` Used to notify the renderer of any changes when used in an interactive setting. @@ -122,49 +122,49 @@ to a map: FeatureLayer '''''''''''' -Feature layer is set up to render information from a FeatureSource. +``FeatureLayer`` is set up to render information from a ``FeatureSource``. .. image:: /images/feature_layer.PNG -You can use the various method of the DataUtilities class to convert your information into -a FeatureSource if it happens to be in another format. This is what the constructor that -takes a FeatureCollection does internally. +You can use the various method of the ``DataUtilities`` class to convert your information into +a ``FeatureSource`` if it happens to be in another format. This is what the constructor that +takes a ``FeatureCollection`` does internally. GridCoverageLayer ''''''''''''''''' -Used to render a GridCoverage. +Used to render a ``GridCoverage``. .. image:: /images/gridcoverage_layer.PNG -Note that direct use of a GridCoverage in this fashion is generally not as efficient -as using GridReaderLayer below. +Note that direct use of a ``GridCoverage`` in this fashion is generally not as efficient +as using ``GridReaderLayer`` below. GridReaderLayer ''''''''''''''' -Used to render raster information on the fly directly from a GridCoverageReader. +Used to render raster information on the fly directly from a ``GridCoverageReader``. .. image:: /images/gridreader_layer.PNG -This is an efficient solution (much like FeatureSource) in that for many cases the correct visual +This is an efficient solution (much like ``FeatureSource``) in that for many cases the correct visual can be determined without reading all of the raster into memory: * When zoomed in the amount of the file read can be limited when working with common formats - such as geotiff. Other formats such as JPEG require that the entire image be loaded each time. -* When zoomed out information from a raster overlay can be used (if avaialble) to avoid reading the + such as GeoTiff. Other formats such as JPEG require that the entire image be loaded each time. +* When zoomed out information from a raster overlay can be used (if available) to avoid reading the entire file. -The performance of GridReaderLayer is dependent on how you have tuned your Java Advanced Imaging -"TileCache" and on the amount of work you have put into preparing your data for display. +The performance of ``GridReaderLayer`` is dependent on how you have tuned your Java Advanced Imaging +``TileCache`` and on the amount of work you have put into preparing your data for display. -This class has been extended by gt-wms for the rendering of WMS information. +This class has been extended by ``gt-wms`` for the rendering of WMS information. DirectLayer ''''''''''' -*Experimental*: DirectLayer is used fill in your own custom renderer (primarily intended for -drawing scalebars, north arrows and grids to decorate the map). +*Experimental*: ``DirectLayer`` is used fill in your own custom renderer (primarily intended for +drawing scale bars, north arrows and grids to decorate the map). .. image:: /images/direct_layer.PNG @@ -179,7 +179,7 @@ An earlier draft of these ideas is based on initial OGC discussion papers: * Open Web Service Context (OWS Context) The GeoTools community actively looking to collaborate with other projects (such as OpenJUMP, -uDig and deegree) in order to collaborate on these ideas. If open source collaboration fails +uDig and Deegree) in order to collaborate on these ideas. If open source collaboration fails we will look to traditional collaboration with a standards body in the form of the OGC working group on "Open Web Context" documents. @@ -188,7 +188,7 @@ References: * http://www.opengeospatial.org/standards/wmc * http://www.opengeospatial.org/projects/groups/owscontextswg -These initial concepts are preserved with the following extensions to MapContent. +These initial concepts are preserved with the following extensions to ``MapContent``. .. image:: /images/map_context.PNG @@ -206,7 +206,7 @@ kind of content is in use). etc...). In the event client code is expecting a MapLayer; this wrapper is recreated as needed and - returned from getLayer( int ) method. + returned from ``getLayer(int)`` method. In a similar fashion the various methods for managing the area of interest delegate to MapViewport. diff --git a/docs/user/library/render/shapefile.rst b/docs/user/library/render/shapefile.rst index 7a62362bdbe..ac87859209b 100644 --- a/docs/user/library/render/shapefile.rst +++ b/docs/user/library/render/shapefile.rst @@ -1,11 +1,11 @@ Shapefile Renderer ------------------ -An implementation of GTRender that has been extened with shapefile specific opimisations. It -will call GTRender for any layers that are not a shapefile. +An implementation of ``GTRender`` that has been extended with shapefile specific optimizations. It +will call ``GTRender`` for any layers that are not a shapefile. -Most of the optimizations that were prototyped in gt-shapefile have been brought back -into gt-render. +Most of the optimizations that were prototyped in ``gt-shapefile`` have been brought back +into ``gt-render``. As such this module is no longer under development. @@ -15,4 +15,4 @@ As such this module is no longer under development. org.geotools gt-shapefile-renderer ${geotools.version} - \ No newline at end of file + diff --git a/docs/user/library/render/style.rst b/docs/user/library/render/style.rst index 7ed6232a1df..cd5381b1010 100644 --- a/docs/user/library/render/style.rst +++ b/docs/user/library/render/style.rst @@ -20,84 +20,84 @@ StyleFactory We have three style factories offering various levels of standards compliance vs pragmatism. -========== ================ ================ ======== ======================================= -Module Class Capability Scope Description -========== ================ ================ ======== ======================================= -gt-opengis StyleFactory get se Strictly limited to the SE standard -gt-main StyleFactory get/set se / sld Supports GeoTools vendor extensions -gt-main StyleFactory2 get/set se / sld Supports text label graphics -gt-main StyleBuilder get/set/defaults se / sld Shorter methods, does not do everything -========== ================ ================ ======== ======================================= +============== ==================== ================ ======== ======================================= +Module Class Capability Scope Description +============== ==================== ================ ======== ======================================= +``gt-opengis`` ``StyleFactory`` get SE Strictly limited to the SE standard +``gt-main`` ``StyleFactory`` get/set SE / SLD Supports GeoTools vendor extensions +``gt-main`` ``StyleFactory2`` get/set SE / SLD Supports text label graphics +``gt-main`` ``StyleBuilder`` get/set/defaults SE / SLD Shorter methods, does not do everything +============== ==================== ================ ======== ======================================= Here are some examples of these classes in action: -* StyleFactory +* ``StyleFactory`` - The gt-opengis StyleFactory allows you to create read-only instances. + The ``gt-opengis`` ``StyleFactory`` allows you to create read-only instances. - Here is a quick example showing the creation of a PointSymbolizer: + Here is a quick example showing the creation of a ``PointSymbolizer``: .. literalinclude:: /../src/main/java/org/geotools/opengis/StyleExamples.java :language: java :start-after: // styleFactoryExample start :end-before: // styleFactoryExample end -* StyleFactory2 +* ``StyleFactory2`` - This gt-main interface allows one additional non standard trick; it allows us to place + This ``gt-main`` interface allows one additional non standard trick; it allows us to place an icon behind text labels. This is a popular technique used for example to place a "label shield" behind hi-way signs. -* StyleFactory +* ``StyleFactory`` - This gt-main interface allows access to all the GeoTools vendor specific options. + This ``gt-main`` interface allows access to all the GeoTools vendor specific options. It has a slightly different style of programming where mutable instances are creating allowing you to call both get and set methods. - You are of course not advised to udpate a style while it is being used to draw. + You are of course not advised to update a style while it is being used to draw. .. literalinclude:: /../src/main/java/org/geotools/render/StyleExamples.java :language: java :start-after: // styleFactoryExample start :end-before: // styleFactoryExample end -* StyleBuilder +* ``StyleBuilder`` - Since a Style is composed of a complex set of objects, a StyleBuilder object is provided for + Since a ``Style`` is composed of a complex set of objects, a ``StyleBuilder`` object is provided for you to conveniently build simple styles without the need to build all of the style elements by hand. - For example, you can create a PolygonSymbolizer and then create a Style out of it with a - single method call: the builder will generate a default FeatureTypeStyle and the Rule for you. + For example, you can create a ``PolygonSymbolizer`` and then create a ``Style`` out of it with a + single method call: the builder will generate a default ``FeatureTypeStyle`` and the ``Rule`` for you. .. literalinclude:: /../src/main/java/org/geotools/render/StyleExamples.java :language: java :start-after: // styleBuilderExample start :end-before: // styleBuilderExample end - StlyeBuilder also helps by filling in many defaults values. The use of defaults is + ``StyleBuilder`` also helps by filling in many defaults values. The use of defaults is less of an issue now as the rendering system is able to correctly handle null as a default for many cases such as default symbol size. **What to use** -For working with symbology encoding StyleFactory is recommended as it defines a small +For working with symbology encoding ``StyleFactory`` is recommended as it defines a small number of easy to use methods. There are however no helpful methods and shortcuts but you have the advantage of less methods to trip over). Since everything is in plain sight you may discover some tricky advanced abilities that may not obvious using -StyleBuilder. +``StyleBuilder``. -For working with style layer descriptor use StyleBuilder to quickly create objects +For working with style layer descriptor use ``StyleBuilder`` to quickly create objects with their default values filled in; and then configure them as needed using setters. Internally we have: -* StyleFactoryImpl2 that creates the raw objects; this is an implementation - of the simple **gt-opengis** StyleFactory. -* StyleFactoryImpl makes use of a aelegate to create the objects; and then allows for a wider - range of create methods defined by **gt-main** StyleFactory -* StyleBuilder which as expected uses a FilterFactory and a StyleFactory in order to get the job done. +* ``StyleFactoryImpl2`` that creates the raw objects; this is an implementation + of the simple ``gt-opengis`` ``StyleFactory``. +* ``StyleFactoryImpl`` makes use of a delegate to create the objects; and then allows for a wider + range of create methods defined by ``gt-main`` ``StyleFactory`` +* ``StyleBuilder`` which as expected uses a ``FilterFactory`` and a ``StyleFactory`` in order to get the job done. Style Layer Descriptor ^^^^^^^^^^^^^^^^^^^^^^ @@ -106,32 +106,32 @@ GeoTools styling is built on the style layer descriptor data model shown below ( .. image:: /images/sld.PNG -GeoTools rendering tends to focus the "User Style" which we represent **Style** to let you control how +GeoTools rendering tends to focus the "User Style" which we represent ``Style`` to let you control how your Map is rendered. -* Style +* ``Style`` - The Style interface matches up with the "Style Layer Descriptor" 1.0 specification + The ``Style`` interface matches up with the "Style Layer Descriptor" 1.0 specification (so if you need explanations or examples please review the OGC documentation for more information). Create '''''' -To create a StyleLayerDescriptor object using a StyleFactory: +To create a ``StyleLayerDescriptor`` object using a ``StyleFactory``: .. literalinclude:: /../src/main/java/org/geotools/render/StyleExamples.java :language: java :start-after: // sldExample start :end-before: // sldExample end -This is the last time we will talk about StyleLayerDescriptor object - it is not really that useful in +This is the last time we will talk about ``StyleLayerDescriptor`` object - it is not really that useful in controlling the rendering process. Access '''''' -To go from a StyleLayerDescriptor object to something useful:: +To go from a ``StyleLayerDescriptor`` object to something useful:: FeatureTypeStyle useful[] = SLD.featureTypeStyles( sld ); @@ -144,18 +144,19 @@ Document The Styled Layer Descriptor Reference Document OpenGIS standard defines an XML document we use to persist our GeoTools Style objects. This standard is the authoritative definition as far as functionally goes, if you find any place where we are out of line please send us a bug report. -How to parse an SLD: +How to parse an SLD file +------------------------- -* You can create a Style using an SLD document (an XML file format defined by the Style Layer Descriptor 1.0 specification): +* You can create a ``Style`` using an SLD document (an XML file format defined by the Style Layer Descriptor 1.0 specification): .. literalinclude:: /../src/main/java/org/geotools/render/StyleExamples.java :language: java :start-after: // parseSLD start :end-before: // parseSLD end -* SAX StyleReader +* SAX ``StyleReader`` - A SAX based StyleReader is also available for GeoTools 2.2 code:: + A SAX based ``StyleReader`` is also available for GeoTools 2.2 code:: private Style loadStyleFromXml() throws Exception { java.net.URL base = getClass().getResource("rs-testData"); @@ -170,7 +171,8 @@ How to parse an SLD: return style[0]; } -How to write a SLD File: +How to write a SLD file +------------------------ * GeoTools has an XML Transfer written up allowing you to generate an SLD file:: @@ -179,9 +181,9 @@ How to write a SLD File: * How to write an SLD file using only a Style - The above code example requires a complete StyleLayerDescriptor document in order to make a valid sld file. + The above code example requires a complete ``StyleLayerDescriptor`` document in order to make a valid SLD file. - Here is how you can wrap up your Style object for output:: + Here is how you can wrap up your ``Style`` object for output:: StyledLayerDescriptor sld = styleFactory.createStyledLayerDescriptor(); UserLayer layer = styleFactory.createUserLayer(); @@ -199,7 +201,7 @@ XML: .. literalinclude:: /../../modules/library/xml/src/test/resources/org/geotools/xml/styling/test-data/markTest.sld -* The same style can be created using the StyleBuilder: +* The same style can be created using the ``StyleBuilder``: .. literalinclude:: /../src/main/java/org/geotools/render/StyleExamples.java :language: java @@ -216,53 +218,53 @@ The feature type style data model captures the symbology encoding information de FeatureTypeStyle '''''''''''''''' -A FeatureTypeStyle declares a part of a style that is specifically geared toward a FeatureType, -that is, features will be rendered according to this FeatureTypeStyle only if their FeatureType -is the same as the FeatureType declared in the FeatureTypeStyle or a descendent. +A ``FeatureTypeStyle`` declares a part of a style that is specifically geared toward a ``FeatureType``, +that is, features will be rendered according to this ``FeatureTypeStyle`` only if their ``FeatureType`` +is the same as the ``FeatureType`` declared in the ``FeatureTypeStyle`` or a descendant. -When defining a Style you will spend the majority of time working with FeatureTypeStyle. A FeatureTypeStyle is specifically geared toward drawing features. +When defining a Style you will spend the majority of time working with ``FeatureTypeStyle``. A ``FeatureTypeStyle`` is specifically geared toward drawing features. -The level of detail is similar to CSS in that you need to define some Rules saying when to draw, and some symbolizers saying how to draw it. Individual symbolizers will use expressions to access feature content (as an example TextSymbolizer will use an expression you provide to construct the text to display). +The level of detail is similar to CSS in that you need to define some Rules saying when to draw, and some symbolizers saying how to draw it. Individual symbolizers will use expressions to access feature content (as an example ``TextSymbolizer`` will use an expression you provide to construct the text to display). -* FeatureTypeStyle.getName(): machine readable name -* FeatureTypeStyle.getDescriptor(): human readable title and description -* FeatureTypeStyle.featureTypeNames(): the Name here is important; it must match the Features you want to draw. +* ``FeatureTypeStyle.getName()``\ : machine readable name +* ``FeatureTypeStyle.getDescriptor()``\ : human readable title and description +* ``FeatureTypeStyle.featureTypeNames()``\ : the Name here is important; it must match the Features you want to draw. - Features will be rendered according a FeatureTypeStyle only if their - FeatureType name matches what is recorded in the FeatureTypeStyle or a + ``Features`` will be rendered according a ``FeatureTypeStyle`` only if their + ``FeatureType`` name matches what is recorded in the ``FeatureTypeStyle`` or a descendant. - For most practical purposes you will set featureTypeName to be "Feature" to act as a wild card. + For most practical purposes you will set ``featureTypeName`` to be "Feature" to act as a wild card. -* FeatureTypeStyle.semanticTypeIdentifiers(): used to quickly limit based on the kind of vector data (point, line or polygon) +* ``FeatureTypeStyle.semanticTypeIdentifiers()``\ : used to quickly limit based on the kind of vector data (point, line or polygon) -Here is a quick example that will draw any "Feature" using a PointSymbolizer: +Here is a quick example that will draw any "Feature" using a ``PointSymbolizer``: .. literalinclude:: /../src/main/java/org/geotools/render/StyleExamples.java :language: java :start-after: // featureTypeStyleExample start :end-before: // featureTypeStyleExample end -Of note is how the PointSymbolizer will first try and use C:\images\house.gif (ie an external graphic) and if that fails it will use a circle (ie a mark). +.. note:: how the ``PointSymbolizer`` will first try and use ``C:\images\house.gif`` (i.e. an external graphic) and if that fails it will use a circle (i.e. a mark). Notes on handling of features: -* Each FeatureTypeStyle that applies is used. That means, the layer will be drawn multiple times if the styles - contain more than one FeatureTypeStyle that matches the FeatureType of the features in the layer. -* FeatureTypeStyles are painted in order: a FeatureTypeStyle is painted only once the previous one in the list +* Each ``FeatureTypeStyle`` that applies is used. That means, the layer will be drawn multiple times if the styles + contain more than one ``FeatureTypeStyle`` that matches the ``FeatureType`` of the features in the layer. +* ``FeatureTypeStyles`` are painted in order: a ``FeatureTypeStyle`` is painted only once the previous one in the list has been completely painted * Each feature is then passed to the rules and their list of symbolizers * This means that a single feature can be painted more than once, if more than one rule matches it, or if the rules contain more than one symbolizer. -* The full set of rules and symbolizers in the current FeatureTypeStyle +* The full set of rules and symbolizers in the current ``FeatureTypeStyle`` is applied to the current Feature before considering the next one. The last consideration is important when you need to draw, for example, roads with a double line - such as a wide black line below a thin white line. This is possible using two FeatureTypeStyles, + such as a wide black line below a thin white line. This is possible using two ``FeatureTypeStyles``, since using a Rule with a couple of symbolizers will generate a map that doesn't look good at road intersections. - Example of style with two FeatureTypeStyles: + Example of style with two ``FeatureTypeStyles``: .. literalinclude:: /../src/main/java/org/geotools/render/StyleExamples.java :language: java @@ -271,26 +273,26 @@ Notes on handling of features: * For an in depth discussion of the rendering process please refer to * :doc:`style ` (tutorial) -FeatureTypeStyle includes vendor options specific to the GeoTools rendering engine: +``FeatureTypeStyle`` includes vendor options specific to the GeoTools rendering engine: -* composite (source-over): allows control of color blending (using copy destination, source-over, destination-over, source-in, destination-in, source-out, destination-out source-atop, destination-atop, xor, multiply, screen, overlay, darken, lighten, color-dodge, color-burn, hard-light, soft-light, difference, exclusion). +* ``composite`` (source-over): allows control of color blending (using copy destination, source-over, destination-over, source-in, destination-in, source-out, destination-out source-atop, destination-atop, xor, multiply, screen, overlay, darken, lighten, color-dodge, color-burn, hard-light, soft-light, difference, exclusion). -* composite-base (false): definition of composition groups +* ``composite``-base (false): definition of composition groups - .. code-block:: java + .. code-block:: java + + // multiply buffer from feature type style 0, onto composite-base provided by feature type style 1 + style.featureTypeStyles().get(0).getOptions().put("composite","multiply, 0.5"); + style.featureTypeStyles().get(1).getOptions().put("composite-base", "true"); - // multiply buffer from feature type style 0, onto composite-base provided by feature type style 1 - style.featureTypeStyles().get(0).getOptions().put("composite","multiply, 0.5"); - style.featureTypeStyles().get(1).getOptions().put("composite-base", "true"); - -* firstMatch: stops rule evaluation after the first match (making it easier to work with datasets where content is classified by distinct attribute values) +* ``firstMatch``: stops rule evaluation after the first match (making it easier to work with data sets where content is classified by distinct attribute values) .. code-block:: java - + // exit rules on first match, like a switch statement fts.getOptions().put("ruleEvaluation", "first"); -* sortBy: Control order features are retrieved, controlling drawing order. +* ``sortBy``: Control order features are retrieved, controlling drawing order. The syntax is `Attribute1 {A|D},Attribute2 {A|D}...` where `A` is ascending, `D` is descending. The sorting direction is optional and defaults to ascending if not specified. @@ -301,7 +303,7 @@ FeatureTypeStyle includes vendor options specific to the GeoTools rendering engi Rule '''' -A FeatureTypeStyle contains one or more rules, these rules are considered in order with the possibility of an "else" Rule being +A ``FeatureTypeStyle`` contains one or more rules, these rules are considered in order with the possibility of an "else" Rule being used to render any remaining features. A rule is based on the following: @@ -313,7 +315,7 @@ A rule is based on the following: As an alternative, the rule can have an "else filter". This special kind of filter catches all of the features that still haven't been symbolized by previous rules with a regular filter. -FeatureTypeStyle used **featureTypename** to sort out what kind of features we are dealing with. Rules are used to refine this contents, possibly filtering according to feature attributes or scale, to determine specifically what we are going to draw. +``FeatureTypeStyle`` used ``featureTypename`` to sort out what kind of features we are dealing with. ``Rules`` are used to refine this contents, possibly filtering according to feature attributes or scale, to determine specifically what we are going to draw. Pay Attention to: @@ -321,32 +323,32 @@ Pay Attention to: * Filter that is used to select features to draw, only the features matching the filter will be painted * A rule can have an "else filter". This special kind of filter catches all of the features that still haven't been symbolized by previous rules with a regular filter). -Once FeatureTypeStyle and Rules have determined that a Feature is going to be drawn; the Rule makes use of a list of of Symbolizers to define how the content is painted: +Once ``FeatureTypeStyle`` and ``Rules`` have determined that a ``Feature`` is going to be drawn; the ``Rule`` makes use of a list of of ``Symbolizers`` to define how the content is painted: -* A Symbolizer describes how to represent a feature on the screen based on the feature contents (geometry and attributes). -* Each rule can have a list of Symbolizer attached to it. -* symbolizers are used like a display language to produce pixels on the display device. +* A ``Symbolizer`` describes how to represent a feature on the screen based on the feature contents (geometry and attributes). +* Each ``Rule`` can have a list of ``Symbolizer`` attached to it. +* ``Symbolizer``\ s are used like a display language to produce pixels on the display device. Symbolizer '''''''''' -A symbolizer describes how a feature should appear on a map. Each rule has a list of symbolizers which it applies in order. +A ``Symbolizer`` describes how a ``Feature`` should appear on a map. Each ``Rule`` has a list of ``Symbolizer``\ s which it applies in order. .. image:: /images/symbolizer3.PNG As you can see, there are many kind of symbolizers, for points, lines, polygons, labels and raster data. -You don't need to match the symbolizer with the specific geometry contained in the feature, the renderer will try to do the most appropriate thing on a case by case basis. For example, TextSymbolizer applies to all kinds of geometries, and will generate labels on the map. If you apply a PolygonSymbolizer to a line, the line will be closed to form a polygon, and then the polygon symbolizer will be applied. +You don't need to match the symbolizer with the specific geometry contained in the feature, the renderer will try to do the most appropriate thing on a case by case basis. For example, ``TextSymbolizer`` applies to all kinds of geometries, and will generate labels on the map. If you apply a ``PolygonSymbolizer`` to a line, the line will be closed to form a polygon, and then the polygon symbolizer will be applied. .. image:: /images/symbolizer2.PNG -The GeoTools Symbolizer interface offers a couple of advantages over the base standard: +The GeoTools ``Symbolizer`` interface offers a couple of advantages over the base standard: -* getGeometry() -* setGeometry( Expression ) +* ``getGeometry()`` +* ``setGeometry( Expression )`` - The ability to define a geometry using an expression allows the use of a function to "preprocess" your geometry + The ability to define a geometry using an expression allows the use of a function to pre-process your geometry prior to it being considered for rendering. This is a little bit tricky (as functions like buffer will make your geometry bigger) but the result is worthwhile @@ -355,7 +357,7 @@ The GeoTools Symbolizer interface offers a couple of advantages over the base st Notes on the use of symbolizers: * The symbolizer describes not just the shape that should appear but also such graphical properties as color and opacity -* Symbolizers do have a default behaviour, after creating a Symbolizer you should supplying parameters to overide the default settings +* Symbolizers do have a default behavior, after creating a Symbolizer you should supplying parameters to override the default settings * The original details of this object are taken from the OGC Styled-Layer Descriptor Report (OGC 01-077) version 0.7.2. * Renderers can use this information when displaying styled features. Though it must be remembered that not all renderers will be able to fully represent @@ -372,7 +374,7 @@ Notes on the use of symbolizers: Thus, you have two ways to symbolize different features with different styles: * By using more than one rule with different filters, and then building symbolizers with literal expressions. - This is a good way to create a classified map, in which colours, line styles and so on depend on the range the attribute value + This is a good way to create a classified map, in which colors, line styles and so on depend on the range the attribute value falls into. * By directly linking a symbolizer property to an attribute value; @@ -388,11 +390,9 @@ some well known marks (circle, square etc..) or your own external graphics such Examples: -* GeoServer SLD cookbook - - :geoserver:`Points ` +* `GeoServer SLD cookbook points ` -* Quick example creating a PointSymbolizer using StyleBuilder: +* Quick example creating a ``PointSymbolizer`` using ``StyleBuilder``: .. literalinclude:: /../src/main/java/org/geotools/render/StyleExamples.java :language: java @@ -417,9 +417,9 @@ Examples: -Point symbolizers supported vendorOptions: +Point symbolizers support ``VendorOptions``: -* labelObstacle(true/false): No labels should overlap this feature, used to ensure point graphics are clearly visible and not obscured by text. +* ``labelObstacle(true/false)``\ : No labels should overlap this feature, used to ensure point graphics are clearly visible and not obscured by text. LineSymbolizer '''''''''''''' @@ -428,9 +428,7 @@ Used to control how lines (or edges) are drawn. Examples: -* GeoServer SLD cookbook - - :geoserver:`Lines ` + * `GeoServer SLD cookbook Lines ` PolygonSymbolizer ''''''''''''''''' @@ -439,11 +437,9 @@ Used to control how solid shapes are drawn. Examples: -* GeoServer SLD cookbook +* `GeoServer SLD cookbook Polygons ` - :geoserver:`Polygons ` - -* Quick example using StyleBuilder to create a PolygonSymbolizer: +* Quick example using ``StyleBuilder`` to create a ``PolygonSymbolizer``: .. literalinclude:: /../src/main/java/org/geotools/render/StyleExamples.java :language: java @@ -453,11 +449,11 @@ Examples: TextSymbolizer '''''''''''''' -Used to control the labelling system; labels are generated by TextSymbolizers and +Used to control the labeling system; labels are generated by ``TextSymbolizers`` and thrown into the rendering engine which detect overlaps, sorts things out according to priorities you have defined and decides on a final label placement. -This mays TextSymbolizer a little bit odd in that it does not get the final say on how labels are rendered on a pixel by pixel basis. +This makes ``TextSymbolizer`` a little bit odd in that it does not always get the final say on how labels are rendered on a pixel by pixel basis. Examples: @@ -467,7 +463,7 @@ Examples: * :geoserver:`Line Labels ` * :geoserver:`Polygon Labels ` -* Here is a quick example of creating a TextSymbolizer with StyleBuilder: +* Here is a quick example of creating a ``TextSymbolizer`` with ``StyleBuilder``: .. literalinclude:: /../src/main/java/org/geotools/render/StyleExamples.java :language: java @@ -512,53 +508,53 @@ Examples: -Considerable vendor options are provided for working with TextSymbolizers: +Considerable vendor options are provided for working with ``TextSymbolizers``: -* allowOverruns (false): When false does not allow labels on lines to get beyond the beginning/end of the line. By default a partial overrun is tolerated, set to false to disallow it. +* ``allowOverruns(false)``\ : When false does not allow labels on lines to get beyond the beginning/end of the line. By default a partial overrun is tolerated, set to false to disallow it. -* autoWrap(400): Number of pixels are which a long label should be split into multiple lines. Works on all geometries, on lines it is mutually exclusive with the followLine option +* ``autoWrap(400)``\ : Number of pixels are which a long label should be split into multiple lines. Works on all geometries, on lines it is mutually exclusive with the ``followLine`` option -* conflictResolution(true) Enables conflict resolution (default, true) meaning no two labels will be allowed to overlap. Symbolizers with conflict resolution off are considered outside of the conflict resolution game, they don't reserve area and can overlap with other labels. +* ``conflictResolution(true)``\ : Enables conflict resolution (default, true) meaning no two labels will be allowed to overlap. Symbolizers with conflict resolution off are considered outside of the conflict resolution game, they don't reserve area and can overlap with other labels. -* followLine(true): When true activates curved labels on linear geometries. The label will follow the shape of the current line, as opposed to being drawn a tangent straight line +* ``followLine(true)``\ : When true activates curved labels on linear geometries. The label will follow the shape of the current line, as opposed to being drawn a tangent straight line -* forceLeftToRight(true): When true forces labels to a readable orientation, when false they make follow the line orientation even if that means the label will look upside down (useful when using TTF symbol fonts to add direction markers along a line) +* ``forceLeftToRight(true)``\ : When true forces labels to a readable orientation, when false they make follow the line orientation even if that means the label will look upside down (useful when using TTF symbol fonts to add direction markers along a line) -* goodnessOfFit(90): Sets the percentage of the label that must sit inside the geometry to allow drawing the label. Works only on polygons. +* ``goodnessOfFit(90)``\ : Sets the percentage of the label that must sit inside the geometry to allow drawing the label. Works only on polygons. -* graphic-margin (10) Pixels between the stretched graphic and the text, applies when graphic stretching is in use +* ``graphic-margin(10)``\ : Pixels between the stretched graphic and the text, applies when graphic stretching is in use -* graphic-resize(true): Stretches the graphic below a label to fit the label size. Possible values are 'stretch', 'proportional'. +* ``graphic-resize(true)``\ : Stretches the graphic below a label to fit the label size. Possible values are 'stretch', 'proportional'. -* group (false) If true, geometries with the same labels are grouped and considered a single entity to be labelled. This allows to avoid or control repeated labels +* ``group(false)``\ : If true, geometries with the same labels are grouped and considered a single entity to be labeled. This allows to avoid or control repeated labels -* labelAllGroup(false) When false, only the biggest geometry in a group is labelled (the biggest is obtained by merging, when possible, the original geometries). When true, also the smaller items in the group are labeled. Works only on lines at the moment. +* ``labelAllGroup(false)``\ : When false, only the biggest geometry in a group is labeled (the biggest is obtained by merging, when possible, the original geometries). When true, also the smaller items in the group are labeled. Works only on lines at the moment. -* repeat (0) When positive it's the desired distance between two subsequent labels on a "big" geometry. Works only on lines at the moment. If zero only one label is drawn no matter how big the geometry is +* ``repeat(0)``\ : When positive it's the desired distance between two subsequent labels on a "big" geometry. Works only on lines at the moment. If zero only one label is drawn no matter how big the geometry is -* maxAngleDelta (90) When drawing curved labels, max allowed angle between two subsequent characters. Higher angles may cause disconnected words or overlapping characters +* ``maxAngleDelta(90)``\ : When drawing curved labels, max allowed angle between two subsequent characters. Higher angles may cause disconnected words or overlapping characters -* maxDisplacement (0) The distance, in pixel, a label can be displaced from its natural position in an attempt to find a position that does not conflict with already drawn labels. +* ``maxDisplacement(0)``\ : The distance, in pixel, a label can be displaced from its natural position in an attempt to find a position that does not conflict with already drawn labels. -* minGroupDistance (3) Minimum distance between two labels in the same label group. To be used when both displacement and repeat are used to avoid having two labels too close to each other +* ``minGroupDistance(3)``\ : Minimum distance between two labels in the same label group. To be used when both displacement and repeat are used to avoid having two labels too close to each other -* partials(true): Option to truncate labels placed on the border of the displayArea (display partial labels) +* ``partials(true)``\ : Option to truncate labels placed on the border of the ``displayArea`` (display partial labels) -* polygonAlign(true): Option overriding manual rotation to align label rotation automatically for polygons. +* ``polygonAlign(true)``\ : Option overriding manual rotation to align label rotation automatically for polygons. -* spaceAround(50) The minimum distance between two labels, in pixels +* ``spaceAround(50)``\ : The minimum distance between two labels, in pixels -* charSpacing(0) The extra space between characters, in pixels. Can be negative. +* ``charSpacing(0)``\ : The extra space between characters, in pixels. Can be negative. -* wordSpacing(0) The extra space between words, in pixels. Must be zero or positive. +* ``wordSpacing(0)``\ : The extra space between words, in pixels. Must be zero or positive. -* underlineText(true): When true instructs the renderer to underline labels +* ``underlineText(true)``\ : When true instructs the renderer to underline labels -* strikethroughText(true): When true instructs the renderer to strikethrough labels +* ``strikethroughText(true)``\ : When true instructs the renderer to ``strikethrough`` labels -* kerning(true): When true enables text kerning (adjustment of space between characters to get a more compact and readable layout) +* ``kerning(true)``\ : When true enables text kerning (adjustment of space between characters to get a more compact and readable layout) -* displacementMode: Comma separated list of label displacement directions for point/polygon labels (used along with maxDisplacement). The indicated directions will be tried in turn. +* ``displacementMode``\ : Comma separated list of label displacement directions for point/polygon labels (used along with ``maxDisplacement``). The indicated directions will be tried in turn. Valid values are cardinal directions abbreviations, in particular, N, W, E, S, NW, NE, SW, SE. Raster Symbolizer @@ -566,36 +562,34 @@ Raster Symbolizer Used to control the rendering of raster data with full "color map" control. -* GeoServer SLD cookbook - - * :geoserver:`Rasters ` +* GeoServer SLD cookbook :geoserver:`Rasters ` StyleVisitor ^^^^^^^^^^^^ -Just like with the FilterVisitor interface we are going to use these implementation to navigate over a nested data structure and either copy what we see, or modify it as we go. +Just like with the ``FilterVisitor`` interface we are going to use these implementation to navigate over a nested data structure and either copy what we see, or modify it as we go. -While the StyleVisitor interface will let modify a style in place we have never found that to be a good idea (at best opening your code up to magic threading issues with what is probably a very active rendering thread). +While the ``StyleVisitor`` interface will let modify a style in place we have never found that to be a good idea (at best opening your code up to magic threading issues with what is probably a very active rendering thread). -The generic StyleVisitor interface is everything you would expect from the Gang of Four Visitor pattern, it has a visit methods one for each significant interface in a Style object. +The generic ``StyleVisitor`` interface is everything you would expect from the Gang of Four ``Visitor`` pattern, it has a visit methods one for each significant interface in a ``Style`` object. -To use a StyleVisitor pass it to a Style (or any style object) using the accepts method:: +To use a ``StyleVisitor`` pass it to a ``Style`` (or any style object) using the accepts method:: style.accepts( styleVisitor ); -You will find that not all Style objects accept a StyleVisitor; as an example Font does not. This is not really a problem - but it is something to keep in mind when writing your own visitor. +You will find that not all ``Style`` objects accept a ``StyleVisitor``; as an example ``Font`` does not. This is not really a problem - but it is something to keep in mind when writing your own visitor. **Ready to Use Implementations** There are a number of ready to use implementations; while we have provided some examples on this page please explore what is available in the library - you can do this quickly by checking the javadocs. -* StyleAttributeExtractor - return all the attributes mentioned by this style; used by the renderer when constructing a Query -* DuplicatingStyleVisitor - return a copy of the style -* RescaleStyleVisitor - return a copy of the style modified for display at a different scale. +* ``StyleAttributeExtractor`` - return all the attributes mentioned by this style; used by the renderer when constructing a Query +* ``DuplicatingStyleVisitor`` - return a copy of the style +* ``RescaleStyleVisitor`` - return a copy of the style modified for display at a different scale. **Implementation Tips** -If you are used to simple visitors on list like data structures you are in for a surprise - StyleVisitor does not navigate the Style object structure on its own you are going to have to do the work.:: +If you are used to simple visitors on list like data structures you are in for a surprise - ``StyleVisitor`` does not navigate the ``Style`` object structure on its own you are going to have to do the work.:: class YourStyleVisitor implements StyleVisitor { ... @@ -609,12 +603,12 @@ If you are used to simple visitors on list like data structures you are in for a ... } -We should have an AbstractStyleVisitor for you to start from; perhaps you would like to write it for us? +We should have an ``AbstractStyleVisitor`` for you to start from; perhaps you would like to write it for us? DuplicatingStyleVisitor ''''''''''''''''''''''' -DuplicatingStyleVisitor will copy any style object; it keeps track of what is copied using an internal stack (this means it is not thread safe!).:: +``DuplicatingStyleVisitor`` will copy any style object; it keeps track of what is copied using an internal stack (this means it is not thread safe!).:: DuplicatingStyleVisitor xerox = new DuplicatingStyleVisitor(); style.accepts( xerox ); @@ -629,7 +623,7 @@ Please note this works for everything:: RescaleStyleVisitor ''''''''''''''''''' -RescaleStyleVisitor can be used to scale up a provided style; something that is useful when printing. The SLD specification is pretty careful about working with pixels at all times (this is annoying when you switch to 300 DPI).:: +``RescaleStyleVisitor`` can be used to scale up a provided style; something that is useful when printing. The SLD specification is pretty careful about working with pixels at all times (this is annoying when you switch to 300 DPI).:: RescaleStyleVisitor scale = new RescaleStyleVisitor(5.0); style.accepts( scale ); diff --git a/docs/user/library/render/svg.rst b/docs/user/library/render/svg.rst index dc31e81e1e8..d5197770ec6 100644 --- a/docs/user/library/render/svg.rst +++ b/docs/user/library/render/svg.rst @@ -1,7 +1,7 @@ SVG Plugin ---------- -The **gt-svg** plugin uses the Batik library to support the use of SVG graphics. +The ``gt-svg`` plugin uses the Batik library to support the use of SVG graphics. **Maven**:: @@ -20,7 +20,7 @@ as is, with the original colors): * :download:`house.svg ` * :download:`fillHouse.sld ` -Here is the example fillHouse.sld: +Here is the example ``fillHouse.sld``: .. literalinclude:: /../../modules/plugin/svg/src/test/resources/org/geotools/renderer/lite/test-data/fillHouse.sld :language: xml @@ -34,7 +34,7 @@ of the SVG but allowing to assign fill and stroke in SLD: * :download:`house.svg ` * :download:`fillHouse.sld ` -Here is the example convenience.sld: +Here is the example ``convenience.sld``: .. literalinclude:: /../../modules/plugin/svg/src/test/resources/org/geotools/renderer/lite/test-data/convenience.sld :language: xml @@ -46,7 +46,7 @@ Parameter extension The plug-in can handle a basic support for parametric styling based on the `SVG Parameters 1.0 specification `_ The support is limited to attribute values, as the underlying library (Batik) cannot perform parameter expansion on its own. -This is good enough to work again QGis own SVG library, here is a simple excerpt from the square symbol, notice the ``param(paramName)`` calls making the style parametric:: +This is good enough to work again QGIS own SVG library, here is a simple excerpt from the square symbol, notice the ``param(paramName)`` calls making the style parametric:: diff --git a/docs/user/library/render/wkt.rst b/docs/user/library/render/wkt.rst index 0c28529fbc6..00b56ad330d 100644 --- a/docs/user/library/render/wkt.rst +++ b/docs/user/library/render/wkt.rst @@ -1,9 +1,9 @@ WKT Marks --------- -The use of WKT marks (prefiex with "wkt://" in your SLD) allows an easy way to add complex symbols to the rendering process. +The use of WKT marks (prefix with ``wkt://`` in your SLD) allows an easy way to add complex symbols to the rendering process. Also there is the option of rendering marks built from WKT geometries; moreover, some Java-generated -shapes can be used to draw meteorological symbols... hope the weathermen will find this useful. +shapes can be used to draw meteorological symbols. We hope the weathermen will find this useful. Examples: @@ -66,13 +66,13 @@ Property File Configuration WKT shapes may be pooled in properties files (this file must be packed in the same JAR of this module) and re-used across SLD files, becoming libraries of symbols. -For instance the WKT marks defined in this properties files (wkt.properties):: +For instance the WKT marks defined in this properties files (``wkt.properties``):: ls=LINESTRING(0.0 0.25, 0.25 0.25, 0.5 0.75, 0.75 0.25, 1.00 0.25) ... -To reference the above property file in your SLD, prefixed like this (note the protocol changed to "wktlib://"):: +To reference the above property file in your SLD, prefixed like this (note the protocol changed to ``wktlib://``):: wktlib://wkt.properties#ls @@ -81,37 +81,37 @@ The location of the property file is either to be provided as an absolute path, Weather symbols ^^^^^^^^^^^^^^^ -The weather symbols, which are create using Java code, should be prefixed by the "extshape://" protocol in the SLD, are, for the time being, limited to the following +The weather symbols, which are create using Java code, should be prefixed by the ``extshape://`` protocol in the SLD, are, for the time being, limited to the following -* Triangle:: +* ``Triangle``:: extshape://triangle Produces: .. image:: /images/triangle.png -* Emicircle:: +* ``Emicircle``:: extshape://emicircle Produces: .. image:: /images/emicircle.png -* Triangle Emicircle:: +* ``Triangle Emicircle``:: extshape://triangleemicircle Produces: .. image:: /images/triangleemicircle.png -* North Arrow:: +* ``North Arrow``:: extshape://narrow Produces: .. image:: /images/narrow.png -* South Arrow:: +* ``South Arrow``:: extshape://sarrow @@ -123,9 +123,9 @@ The weather symbols, which are create using Java code, should be prefixed by the A customizable arrow shape is also available, that can generate different arrows based on different values of three optional parameters: - * t: thickness of the arrow base, between 0 and 1, default is 0.2 - * hr: height over width ratio, a positive number, default is 2 - * ab: arrow head base ration, between 0 and 1, default is 0.5 + * ``t``: thickness of the arrow base, between 0 and 1, default is 0.2 + * ``hr``: height over width ratio, a positive number, default is 2 + * ``ab``: arrow head base ration, between 0 and 1, default is 0.5 The general syntax is:: @@ -146,7 +146,7 @@ Finally, changing the arrow base between 0 and 1 generates: All of the above pictures have been taken using an anchor point of (0.5,0), that is, anchoring the arrow to its base, instead of its center, which would be its natural position. -More complex symbols like Wind Barbs can be created with the **windbarbs://** prefix. This is an example:: +More complex symbols like Wind Barbs can be created with the ``windbarbs://`` prefix. This is an example:: windbarbs://default(15)[kts] @@ -154,4 +154,4 @@ Where *15* indicates the wind intensity and *[kts]* indicates its unit of measur And it produces: - .. image:: /images/barbs.png \ No newline at end of file + .. image:: /images/barbs.png diff --git a/docs/user/library/xml/faq.rst b/docs/user/library/xml/faq.rst index 9b8749b650a..ba118594670 100644 --- a/docs/user/library/xml/faq.rst +++ b/docs/user/library/xml/faq.rst @@ -74,7 +74,7 @@ to call you. * Reuse of a SAX parser is possible, but is very tricky to reuse As a result SAX parsers are rather "brittle" and difficult to maintain -are currently hardcoded to pass control between themselves, making support for +are currently hard coded to pass control between themselves, making support for new specifications tricky. Example: while parsing a Filter control will be need to be handed over to @@ -123,7 +123,7 @@ Yes we did. This idea of "Schema Assisted" parsers is a GeoTools specific piece of technology. Then general idea is to makes use of XML Schema information to -minimise the amount of code you need to write. +minimize the amount of code you need to write. A parser is supplied a configuration of bindings; each binding maps an XML elements or XML attributes to Java class. @@ -180,7 +180,7 @@ Q: For WFS why does Parser return a Map? This shows up as the following error: -* ClassCastException "java.util.HashMap cannot be cast to FeatureCollection". +* ``ClassCastException java.util.HashMap cannot be cast to FeatureCollection`` To understand this error please remember that the GML returned by a WFS GetFeatures @@ -190,7 +190,7 @@ For a WFS GetFeature response the schema reference is usually a DescribeFeatureT an XML Schema. If this schema is incorrectly configured (common with MapServer) or cannot be reached (common with restricted -environments) our Parser will give up guessing what is a Feature and just return the values in a HashMap. +environments) our parser will give up guessing what is a Feature and just return the values in a ``HashMap`` . .. note:: @@ -204,28 +204,29 @@ environments) our Parser will give up guessing what is a Feature and just return This is similar to the approach taken by OGR; OGR figures out where the "geometry" is; and then goes up two levels and assumes those things are features. - Both of these approaches are strictly a work around for a common problem of misconfigured WFS servers. + Both of these approaches are strictly a work around for a common problem of + misconfigured WFS servers. Here is how to review the configuration of your WFS Server: -1. If you are having a problem with a HashMap being returned when you expect a Feature, you should check +1. If you are having a problem with a ``HashMap`` being returned when you expect a Feature, you should check GetCapabilities responses for remote server e.g. with browser:: http://{URL}?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetCapabilities -2. After that, ensure that elements contain urls that actually work +2. After that, ensure that ```` elements contain URLs that actually work -3. In particular check that DescribeFeatureType responds with the expected XML Schema +3. In particular check that ``DescribeFeatureType`` responds with the expected XML Schema Q: I am in a restricted environment, how to configure SchemaLocator? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -You can configure the Parser with a SchemaLocator (we use this internally to force the parser +You can configure the Parser with a ``SchemaLocator`` (we use this internally to force the parser to a copy of the GML schema included in the GeoTools jars; rather than force the Parser to download the GML schema each time). -1. To customise how XML Schemas are located in a restricted environment (such as web portal for multiple +1. To customize how XML Schemas are located in a restricted environment (such as web portal for multiple WFS services that require authorization, or require the use of an HTTP proxy for schema requests). 2. Create custom SchemaLocator we start with configuration like so:: diff --git a/docs/user/library/xml/filter.rst b/docs/user/library/xml/filter.rst index b557679e111..606d788de9c 100644 --- a/docs/user/library/xml/filter.rst +++ b/docs/user/library/xml/filter.rst @@ -3,11 +3,11 @@ Filter No utility class, this time out we will be making direct use of the three available GTXML configurations: -* org.geotools.filter.v1_0.OGCConfiguration -* org.geotools.filter.v1_1.OGCConfiguration -* org.geotools.filter.v2_0.FESConfiguration +* ``org.geotools.filter.v1_0.OGCConfiguration`` +* ``org.geotools.filter.v1_1.OGCConfiguration`` +* ``org.geotools.filter.v2_0.FESConfiguration`` -The definition of *filter* is considered part of the ogc schema, hence the use of OGCConfiguration above. +The definition of *filter* is considered part of the OGC schema, hence the use of ``OGCConfiguration`` above. Filter1 ^^^^^^^ @@ -25,7 +25,7 @@ To encode a filter:: org.geotools.xsd.Encoder encoder = new org.geotools.xsd.Encoder( configuration ); encoder.encode( filter, org.geotools.filter.v1_0.OGC.FILTER, outputStream ); -This configurations bring in the correct GML2 version of GMLConfiguration to handle any geometry mentioned in your Filter. +This configurations bring in the correct GML2 version of ``GMLConfiguration`` to handle any geometry mentioned in your Filter. Consider the following filter:: @@ -85,7 +85,7 @@ FilterFilter (SAX) An alternative to using a GTXML configuration is to directly handle the SAX events yourself. -As mentioned n the previous page on :doc:`geometry page ` sax events involve defining a callback class that can be invoked as each Filter is recognised. +As mentioned n the previous page on :doc:`geometry page ` sax events involve defining a callback class that can be invoked as each Filter is recognized. Here is a quick example: @@ -132,12 +132,12 @@ You can use the DOM parser to parse individual filter nodes:: Filter 1.1 ^^^^^^^^^^ -The Filter 1.1 specification is provided by v1_1 OGCConfiguration. +The Filter 1.1 specification is provided by ``v1_1.OGCConfiguration``. -.. note:: Filter 1.1 uses GML3 to represent Geometry as required by the specification. +.. note:: Filter 1.1 uses GML3 to represent ``Geometry`` as required by the specification. -Ecode -''''' +Encode +'''''' To encode a filter:: @@ -158,7 +158,7 @@ To parse a filter:: Filter2 ^^^^^^^ -The Filter 2.0 specification is provided by v2_0 FESConfiguration. +The Filter 2.0 specification is provided by ``v2_0.FESConfiguration``. Parse ''''' diff --git a/docs/user/library/xml/geometry.rst b/docs/user/library/xml/geometry.rst index fbb87c188dc..bfbfa363160 100644 --- a/docs/user/library/xml/geometry.rst +++ b/docs/user/library/xml/geometry.rst @@ -1,7 +1,7 @@ Geometry -------- -XML Documents come in two parts an XSD file representing the FeatureType; and an XML file with the actual features. +XML Documents come in two parts an XSD file representing the ``FeatureType``; and an XML file with the actual features. Here is what that looks like with a simple example: @@ -26,10 +26,10 @@ While the GML utility class is useful; you may find the need to go under the hoo As indicated the utility class is set up to work with the following versions: -* GML_2 -* GML_3 -* WFS1_0 -* WFS1_1 +* ``GML_2`` +* ``GML_3`` +* ``WFS1_0`` +* ``WFS1_1`` The examples on this page will start off with the use of the GML class where appropriate. @@ -39,7 +39,7 @@ GML2 Encoding Schema '''''' -Encoding FeatureType into an XSD file:: +Encoding ``FeatureType`` into an XSD file:: SimpleFeatureType TYPE = DataUtilities.createType("Location", "geom:Point,name:String"); @@ -47,20 +47,21 @@ Encoding FeatureType into an XSD file:: encode.setBaseURL(new URL("http://localhost/")); encode.encode(out, TYPE); -This writes out an XSD file for the FeatureType and can be combined with the WFS 1.0 XSD file when writing feature collections. +This writes out an XSD file for the ``FeatureType`` and can be combined with the WFS 1.0 XSD file when writing feature collections. FeatureCollection ''''''''''''''''' -To write out a SimpleFeatureCollection to match:: +To write out a ``SimpleFeatureCollection`` +to match:: GML encode = new GML(Version.WFS1_0); encode.setNamespace("geotools", "http://geotools.org"); encode.encode(out, featureCollection); -The namespace refers to the XSD file generated earlier (or any other XSD file you happen to have). The contents of the FeatureCollection are written out as is; and you may get a failure if their name does not match up with the XSD file. +The namespace refers to the XSD file generated earlier (or any other XSD file you happen to have). The contents of the ``FeatureCollection`` are written out as is; and you may get a failure if their name does not match up with the XSD file. -In this case we needed to use WFS1_1 when writing out our features (as GML2 does not provide the concept of a feature collection on its own). If you have your own custom schema that extends GML2 AbstractFeatureCollection you can use the parser technologies directly in order to read/write the content (it is not something we have added to this GML utility class yet). +In this case we needed to use ``WFS1_1`` when writing out our features (as ``GML2`` does not provide the concept of a feature collection on its own). If you have your own custom schema that extends ``GML2`` ``AbstractFeatureCollection`` you can use the parser technologies directly in order to read/write the content (it is not something we have added to this GML utility class yet). GML2 Encoding Example ''''''''''''''''''''' @@ -105,7 +106,7 @@ Here is a complete example:: WFS1.0 Encoding ''''''''''''''' -The Web Feature Server 1.0 specification extends GML2. You can work with this format using the GML Utility class.:: +The Web Feature Server 1.0 specification extends ``GML2``. You can work with this format using the GML Utility class.:: GML encode = new GML(Version.WFS1_0); encode.setNamespace("geotools", "http://geotools.org"); @@ -114,7 +115,7 @@ The Web Feature Server 1.0 specification extends GML2. You can work with this fo FeatureTransformer '''''''''''''''''' -You can read how to use FeatureTransformer directly; however we also provide +You can read how to use ``FeatureTransformer`` directly; however we also provide access to this class using the GML Utility class:: GML encode = new GML(Version.GML2); @@ -122,9 +123,9 @@ access to this class using the GML Utility class:: encode.setLegacy(true); encode.encode(out, collection); -This method depends on you doing everything exactly right as it blindly writes out a document referring to an XSD file that may or may not exist. It is a good choice when encoding content against a WFS DescribeFeatureType URL for example. +This method depends on you doing everything exactly right as it blindly writes out a document referring to an XSD file that may or may not exist. It is a good choice when encoding content against a WFS ``DescribeFeatureType`` URL for example. -Internally you can use the GMLTransform code directly for greater control +Internally you can use the ``GMLTransform`` code directly for greater control over this process: .. literalinclude:: /../src/main/java/org/geotools/xml/GMLExamples.java @@ -141,29 +142,29 @@ Notes: * Application Schema There is no such thing as a "GML" document; you need to created your own XML - Schema. Your XML Schema will extend GML concepts like AbstractFeature and define + Schema. Your XML Schema will extend GML concepts like ``AbstractFeature`` and define specific concepts from your application - like ROAD, RIVER, CITY etc... This line is where you tell the Transform about your XML Schema:: ft.getFeatureNamesapces().declarePrefix("myns","http://somewhere.org"); - The "myns" prefix is supposed to line up with an XML Schema document which you + The ``myns`` prefix is supposed to line up with an XML Schema document which you have defined to describe your document. -* SRS +* ``SRS`` - Internally in GeoTools we use real CoordinateReferenceSystem instances to record - what the numbers mean. In GML they use a simple string called "SRS" (ie Spatial + Internally in GeoTools we use real ``CoordinateReferenceSystem`` instances to record + what the numbers mean. In GML they use a simple string called ``SRS`` (i.e. Spatial Reference System).:: transform.setSrsName( "EPSG:4326" ); - The CRS utility class has a method that can help you determine a good srsName:: + The CRS utility class has a method that can help you determine a good ``srsName``:: String srsName = CRS.toSRS(schema.getCoordinateReferenceSystem(); -We also have an email from foerster@itc.nl with an example: +We also have an email from ``foerster@itc.nl`` with an example: .. literalinclude:: /../src/main/java/org/geotools/xml/GMLExamples.java :language: java @@ -184,7 +185,7 @@ You can parse the XSD document (useful when you want to make additional features Name typeName = new NameImpl("http://www.openplans.org/topp", "states"); SimpleFeatureType featureType = gml.decodeSimpleFeatureType(schemaLocation, typeName ); -XSD files can have more then one entry; so you need to explicitly ask for the one you want. We also need to know the CoordinateReferenceSystem of the content. +XSD files can have more then one entry; so you need to explicitly ask for the one you want. We also need to know the ``CoordinateReferenceSystem`` of the content. You can make use of Configuration and the GTXML class to directly read out the schema information: @@ -203,7 +204,7 @@ Here is a slightly more involved example using a custom configuration: FeatureCollection ''''''''''''''''' -You can parse out a FeatureCollection in one gulp:: +You can parse out a ``FeatureCollection`` in one gulp:: GML gml = new GML(Version.WFS1_0); SimpleFeatureCollection featureCollection = gml.decodeFeatureCollection(in); @@ -233,27 +234,27 @@ SAX An alternative to the GML utility class is to directly handle the SAX events yourself. -If you have an existing SAX based parser you can make use of **ContentHandlers** defined by GeoTools in order to feed Geometries into your own parser. +If you have an existing SAX based parser you can make use of ``ContentHandlers`` defined by GeoTools in order to feed Geometries into your own parser. -* GMLHandlerJTS -* GMLHandlerGeometry -* GMLHandlerFeature +* ``GMLHandlerJTS`` +* ``GMLHandlerGeometry`` +* ``GMLHandlerFeature`` -To make matters exciting the **ContentHandler** classes are defined at different "levels" for GML. +To make matters exciting the ``ContentHandler`` classes are defined at different "levels" for GML. -===== ================= =================== =================================== -Level Interface Implementation Description -===== ================= =================== =================================== -1 (raw sax) GMLFilterDocument Alerts for GML types -2 GMLHandlerJTS GMLHandlerGeometry GML events into OGC simple types -3 GMLHandlerFeature (your code) Implement accept parsed features. -===== ================= =================== =================================== +===== ===================== ======================= =================================== +Level Interface Implementation Description +===== ===================== ======================= =================================== +1 (raw sax) ``GMLFilterDocument`` Alerts for GML types +2 ``GMLHandlerJTS`` ``GMLHandlerGeometry`` GML events into OGC simple types +3 ``GMLHandlerFeature`` (your code) Implement accept parsed features. +===== ===================== ======================= =================================== Here is what this looks like in the context of your own code. .. image:: /images/gml_sax.PNG -You can see that in order to use literal JTS Geometries the SAX Filter parser will need to implement GMLHandlerFeature: +You can see that in order to use literal JTS Geometries the SAX Filter parser will need to implement ``GMLHandlerFeature``: .. literalinclude:: /../src/main/java/org/geotools/xml/YourCode.java :language: java @@ -334,8 +335,8 @@ XML file formats are defined using XSD files such as the following:: The above file defines two new ideas: -* TestFeatureType - it extends the AbstractFeatureType idea from GML -* TestFeatureCollectionType - it extends the AbstractFeatureCollectionType from GML +* ``TestFeatureType`` - it extends the ``AbstractFeatureType`` idea from GML +* ``TestFeatureCollectionType`` - it extends the ``AbstractFeatureCollectionType`` from GML Here is what that looks like as a UML diagram: @@ -344,7 +345,7 @@ Here is what that looks like as a UML diagram: .. note:: While we cannot parse a GML2 document - nobody can! Since GML2 documents do not exist as a - file format. The parser is able to parse an XML file defined by test.xsd above. + file format. The parser is able to parse an XML file defined by ``test.xsd`` above. Here is an example to parse against the above schema:: @@ -434,7 +435,7 @@ The good news is that GML3 is able to encode feature collections on its own; it GML3 Parsing ^^^^^^^^^^^^ -GML3 is a actually a pretty significant departure from GML2 with a different representation of Geometry more closely aligned with ISO19017. This means that content is encoded as Curves and so forth even though though we only use JTS LineStrings in GeoTools - we make sure to encode them as a curve of line segments. +GML3 is a actually a pretty significant departure from GML2 with a different representation of Geometry more closely aligned with ISO19017. This means that content is encoded as Curves and so forth even though though we only use JTS ``LineStrings`` in GeoTools - we make sure to encode them as a curve of line segments. Not all GML3 geometry types can be represented in JTS Geometry; we have looked at using ISO19107 representations directly but so far it is a matter of research and collaboration. @@ -460,7 +461,7 @@ You can parse an XML schema file extended from the abstract GML3 schema:: FeatureCollection ''''''''''''''''' -Parsing out an entire FeatureCollection:: +Parsing out an entire ``FeatureCollection``:: URL url = TestData.getResource(this, "states.gml"); InputStream in = url.openStream(); @@ -687,7 +688,7 @@ we use in our test cases:: KML Parser '''''''''' -The Parser can use the KMLConfiguration to read out the contents of a KML file +The Parser can use the ``KMLConfiguration`` to read out the contents of a KML file as a single Feature. Accessing the placemarks of that Feature returns a Collection:: @@ -713,7 +714,7 @@ The Streaming Parser is also available:: KML Encoding '''''''''''' -The KMLConfiguration provides the Encoder with the ability to generate KML output:: +The ``KMLConfiguration`` provides the Encoder with the ability to generate KML output:: Encoder encoder = new Encoder(new KMLConfiguration()); encoder.setIndenting(true); @@ -728,9 +729,9 @@ Advanced Application Schema '''''''''''''''''' -The above TestSchema examples makes reference to an application schema with the namespace "http://www.geotools.org/test", and defined in the schema document "test.xsd". In order for the document to parse correctly, the parser must be able to resolve the schema file correctly, which means that the file test.xsd needs to be in the same directory as the parser is executing from. +The above ``TestSchema`` examples makes reference to an application schema with the namespace "http://www.geotools.org/test", and defined in the schema document ``test.xsd``. In order for the document to parse correctly, the parser must be able to resolve the schema file correctly, which means that the file ``test.xsd`` needs to be in the same directory as the parser is executing from. -Unfortunately, this is rarely the case. GML documents are often encountered in the wild with no schemaLocation attribute attached, or it is inaccurate. +Unfortunately, this is rarely the case. GML documents are often encountered in the wild with no ``schemaLocation`` attribute attached, or it is inaccurate. If you do not have an XSD file you are likely to get warnings like the following:: @@ -742,9 +743,10 @@ Fortunately there are a number of alternatives. * Alternative 1: Create an Application Schema Configuration This method can be used if the application schema to be parsed is known before - hand. The org.geotools.xsd.Configuration class is used to configure the parser - with the information for a particular schema. The org.geotools.gml.ApplicationSchemaConfiguration can be used to create a - configuration from a namespace,schemaLocation pair.:: + hand. The ``org.geotools.xsd.Configuration`` class is used to configure the parser + with the information for a particular schema. The + ``org.geotools.gml.ApplicationSchemaConfiguration`` can be used to create a + configuration from a ``namespace,schemaLocation`` pair.:: //create the parser with the filter 1.0 configuration @@ -753,15 +755,15 @@ Fortunately there are a number of alternatives. org.geotools.xml.Configuruation configuration = new ApplicationSchemaConfiguration( namespace, schemaLocation ); org.geotools.xsd.Parser parser = new org.geotools.xsd.Parser( configuration ); - - //the xml instance document above - InputStream xml = ... - - //parse - SimpleFeatureCollection fc = (SimpleFeatureCollection) parser.parse( xml ); + + //the xml instance document above + InputStream xml = ... + + //parse + SimpleFeatureCollection fc = (SimpleFeatureCollection) parser.parse( xml ); In this case we are manually configuring the parser by hand prior to use; - normally the XML document itself is supposed to refer to "test.xsd" after all. + normally the XML document itself is supposed to refer to ``test.xsd`` after all. The above technique allows you to correct the mistake. * Alternative 2: Ignoring the Application Schema @@ -779,8 +781,8 @@ Fortunately there are a number of alternatives. Now this has a few consequences. It means that the parser knows nothing about types and elements that have been defined in application schema. Which means they will get parsed differently. In the example, what this means is that the parser - will not know that TestFeature is indeed a feature. So instead of parsing it into - a Feature, it will parse it into a Map, which is the default for complex types. + will not know that ``TestFeature`` is indeed a feature. So instead of parsing it into + a Feature, it will parse it into a ``Map``, which is the default for complex types. Therefore parsing the document becomes:: diff --git a/docs/user/library/xml/index.rst b/docs/user/library/xml/index.rst index 113f60955c2..e260f3eb896 100644 --- a/docs/user/library/xml/index.rst +++ b/docs/user/library/xml/index.rst @@ -8,7 +8,7 @@ Supports the parsing and encoding of geospatial information using XML. There are a large number of supporting plugins capturing XML schemas, and "bindings" mapping these ideas into concrete Java objects. -The Geotools library has spent a lot of time and energy on this problem, this document introduces +The GeoTools library has spent a lot of time and energy on this problem, this document introduces you to what is available. **Maven**:: diff --git a/docs/user/library/xml/internal/bindings.rst b/docs/user/library/xml/internal/bindings.rst index a8e5d6c4ec9..1c7d4fd5cf4 100644 --- a/docs/user/library/xml/internal/bindings.rst +++ b/docs/user/library/xml/internal/bindings.rst @@ -8,7 +8,7 @@ A binding is what transforms XML into a Java object and vice versa. Bindings can * simple types * complex types -More specifically, a binding is an instanceof of **org.geotools.xsd.Binding**:: +More specifically, a binding is an ``instanceof`` of ``org.geotools.xsd.Binding``:: interface Binding { /** @@ -35,20 +35,20 @@ Bindings must declare the component they are attached to, known as the target fo QName getTarget(); -This is achieved with a qualified name, an instance of **javax.xml.namespace.QName**. A qualified name is made up of: +This is achieved with a qualified name, an instance of ``javax.xml.namespace.QName``. A qualified name is made up of: -* a namespace uri, and +* a namespace URI, and * a local parse Examples: -================================ ==================== ================================== -Namespace Local Component -================================ ==================== ================================== -http://www.geotools.org/po purchaseOrder Global "purchaseOrder" element -http://www.w3.org/2001/XMLSchema int Simple type "int" -http://www.opengis.net/gml AbstractFeatureType Complex type "AbstractFeatureType" -================================ ==================== ================================== +==================================== ======================== ====================================== +Namespace Local Component +==================================== ======================== ====================================== +``http://www.geotools.org/po`` ``purchaseOrder`` Global ``purchaseOrder`` element +``http://www.w3.org/2001/XMLSchema`` ``int`` Simple type ``int`` +``http://www.opengis.net/gml`` ``AbstractFeatureType`` Complex type ``AbstractFeatureType`` +==================================== ======================== ====================================== Binding Type '''''''''''' @@ -59,13 +59,13 @@ The job of a binding is to transform between objects and XML. Along with the tar Examples: -=============================================== ============================ -Target Type (Java Class) -=============================================== ============================ -http://www.geotools.org/po, purchaseOrder org.geotools.po.PurchaseOrder -http://www.w3.org/2001/XMLSchema, int java.lang.Integer -http://www.opengis.net/gml, AbstractFeatureType org.geotools.feature.Feature -=============================================== ============================ +======================================================= ================================= +Target Type (Java Class) +======================================================= ================================= +``http://www.geotools.org/po``, ``purchaseOrder`` ``org.geotools.po.PurchaseOrder`` +``http://www.w3.org/2001/XMLSchema,`` ``int`` ``java.lang.Integer`` +``http://www.opengis.net/gml``, ``AbstractFeatureType`` ``org.geotools.feature.Feature`` +======================================================= ================================= Binding Execution ''''''''''''''''' @@ -76,7 +76,7 @@ When an element or attribute in an XML document is being parsed, a Binding Execu The bindings in the chain are executed one after another and the result is the final representation of the element / attribute as a java object. Each binding receives the value produced by the binding before it. -Consider the following xml snippet, in which an element named "integerElement" which is of type "xs:integer" is being parsed:: +Consider the following XML snippet, in which an element named ``integerElement`` which is of type ``xs:integer`` is being parsed:: 25 @@ -94,7 +94,7 @@ Once the binding chain has been formed, it is executed in order, with the input .. image:: /images/xml/bindingChain2.png -The default execution behaviour is to execute after its "parent" binding has executed. However a binding may also specify different execution behaviour, called its **Execution Mode**: +The default execution behavior is to execute after its "parent" binding has executed. However a binding may also specify different execution behavior, called its **Execution Mode**: * After @@ -141,16 +141,16 @@ The default execution behaviour is to execute after its "parent" binding has exe And the associated gt-opengis java interface mappings: - ================================= ================================================== - Element Interface - ================================= ================================================== - PropertyIsEqualTo org.opengis.filter.PropertyIsEqualTo - PropertyIsNotEqualTo org.opengis.filter.PropertyIsNotEqualTo - PropertyIsLessThan org.opengis.filter.PropertyIsLessThan - PropertyIsLessThanOrEqualTo org.opengis.filter.PropertyIsLessThanOrEqualTo - PropertyIsGreaterThan org.opengis.filter.PropertyIsGreaterThan - PropertyIsGreaterThanOrEqualTo org.opengis.filter.PropertyIsGreaterThanOrEqualTo - ================================= ================================================== + ===================================== ====================================================== + Element Interface + ===================================== ====================================================== + ``PropertyIsEqualTo`` ``org.opengis.filter.PropertyIsEqualTo`` + ``PropertyIsNotEqualTo`` ``org.opengis.filter.PropertyIsNotEqualTo`` + ``PropertyIsLessThan`` ``org.opengis.filter.PropertyIsLessThan`` + ``PropertyIsLessThanOrEqualTo`` ``org.opengis.filter.PropertyIsLessThanOrEqualTo`` + ``PropertyIsGreaterThan`` ``org.opengis.filter.PropertyIsGreaterThan`` + ``PropertyIsGreaterThanOrEqualTo`` ``org.opengis.filter.PropertyIsGreaterThanOrEqualTo`` + ===================================== ====================================================== All of the elements are of the same XML type "BinaryComparisonOpType", but each maps to a different Java interface, so it makes sense to have a specific binding for each element, instead of having a single binding for the type do the work. @@ -186,10 +186,10 @@ Simple bindings are used to parse and encode elements and attributes which have The parse method for simple bindings takes two parameters: - * instance: The instance component ( element or attribute ) that is being parsed as an instance of org.geotools.xsd.InstanceComponent + * instance: The instance component ( element or attribute ) that is being parsed as an instance of ``org.geotools.xsd.InstanceComponent`` * value: The parsed value of the element / attribute created by the previous binding in the execution chain ( explained in greater detail above ). If the binding is the first in the chain, this value is the raw text of the element / attribute as a String. - The return value of the method is the transformed object. Continuing with the "xs:integer" example, an implementation could be:: + The return value of the method is the transformed object. Continuing with the ``xs:integer`` example, an implementation could be:: Object parse(InstanceComponent instance, Object value) throws Exception { return Integer.parseInt( (String) value ); @@ -204,19 +204,19 @@ Simple bindings are used to parse and encode elements and attributes which have It takes two parameters: * object: The object to serialize or encode as XML - * value: The string value as encoded by the previous binding in the execution chain. If the binding is the first in the chain, the value is the result of calling toString() on the object parameter. + * value: The string value as encoded by the previous binding in the execution chain. If the binding is the first in the chain, the value is the result of calling ``toString()`` on the object parameter. The return value of the method is the serialized value for the object. - The example of "xs:integer" can be implemented as:: + The example of ``xs:integer`` can be implemented as:: String encode(Object object, String value) throws Exception { Integer integer = (Integer) object; return integer.toString(); } -* AbstractSimpleBinding +* ``AbstractSimpleBinding`` - The class org.geotools.xsd.AbstractSimpleBinding is available for subclassing + The class ``org.geotools.xsd.AbstractSimpleBinding`` is available for sub-classing by binding writers. Complex Bindings @@ -252,9 +252,9 @@ The interface for complex bindings looks like:: The parse method for a complex binding takes three parameters: - * instance: The element instance being parsed, an instance of **org.geotools.xsd.ElementInstance** - * nocde:: A node in the current "parse tree" ( explained below ) at the time the binding is being executed, an instance of Node - * value: The parsed value as produced by the previous binding in the execution chain. This value is null for the first binding in the chain. + * ``instance``: The element instance being parsed, an instance of ``org.geotools.xsd.ElementInstance`` + * ``nocde``:: A node in the current "parse tree" ( explained below ) at the time the binding is being executed, an instance of Node + * ``value``: The parsed value as produced by the previous binding in the execution chain. This value is null for the first binding in the chain. Complex types by definition are XML elements which are composed of other XML elements and attributes. A complex object could be defined as an object which is composed of other objects. Parsing a complex object really just amounts to rounding up objects for child elements, and composing the resulting object accordingly. @@ -262,9 +262,9 @@ The interface for complex bindings looks like:: A complex binding must use the parse tree to obtain the values that it needs to compose the resulting object. - As an example, consider the binding for the "PurchaseOrderType" from the purchase order schema.:: + As an example, consider the binding for the ``PurchaseOrderType`` from the purchase order schema.:: - Object parse(ElementInstance instance, Node node, Object value) throws Exception { + Object parse(ElementInstance instance, Node node, Object value) throws Exception { PurchaseOrder po = new PurchaseOrder(); //mandatory child elements @@ -291,11 +291,11 @@ The interface for complex bindings looks like:: * object: The object to encode * document: A document used to create DOM components - * value: A value as an element which is the result of the previous binding in the execution chain. For the first binding in the chain this is an empty element ( no attributes, children, or text ) + * value: A value as an element which is the result of the previous binding in the execution chain. For the first binding in the chain this is an empty element (no attributes, children, or text) - The return value of the method is the encoded element. Often this is the same element passed in ( the value parameter ), with some content added to it. + The return value of the method is the encoded element. Often this is the same element passed in (the value parameter), with some content added to it. - The getProperty method for a complex binding is used to retrieve properties from an object being encoded.:: + The ``getProperty`` method for a complex binding is used to retrieve properties from an object being encoded.:: Object getProperty(Object object, QName name) throws Exception; @@ -310,11 +310,11 @@ The interface for complex bindings looks like:: .. note:: - A multi-valued property is an element declaration in which the "maxOccurs" attribute is greater then 1. In this case, the getProperty method may return a collection, an array, or an iterator for the property. + A multi-valued property is an element declaration in which the ``maxOccurs`` attribute is greater then 1. In this case, the ``getProperty`` method may return a collection, an array, or an iterator for the property. The entire encoding process for a complex binding is split over these two methods. - Consider the "PurchaseOrderType" example:: + Consider the ``PurchaseOrderType`` example:: Element encode(Object object, Document document, Element value) throws Exception { return value; @@ -335,10 +335,10 @@ The interface for complex bindings looks like:: } - In the above example all of the work is done in the getProperty method. This is often the case. However there are situations where the encode method is necessary. + In the above example all of the work is done in the ``getProperty`` method. This is often the case. However there are situations where the encode method is necessary. * For types with "open-ended" or "extensible" content ( think AbstractFeatureType from the GML schema ). Since the content is open ended the schema does not contain the necessary information to retrieve the property - * For types with "mixed" content ( i.e. can have child elements and text ). In this situation the child elements can be encoded with getProperty, and the text content can be be encoded in encode. + * For types with "mixed" content ( i.e. can have child elements and text ). In this situation the child elements can be encoded with ``getProperty``, and the text content can be be encoded in encode. .. note:: @@ -376,18 +376,18 @@ The interface for complex bindings looks like:: return null; } - In this example, all the work is done in the encode method. However it is evident that the second example results in much more work for the binding implementor which is why the first method is often preferred. + In this example, all the work is done in the encode method. However it is evident that the second example results in much more work for the binding implementer which is why the first method is often preferred. -* AbstractComplexBinding +* ``AbstractComplexBinding`` - The class org.geotools.xml.AbstractCompledxBinding is available for subclassing by binding writers. + The class ``org.geotools.xml.AbstractCompledxBinding`` is available for sub-classing by binding writers. Binding Context ''''''''''''''' Often bindings have dependencies on other types of objects. The most common case is a factory used to create objects. Bindings work with the concept of Constructor Injection, in which any dependencies a binding has on another object is listed as a parameter in its constructor. -Let us consider the "PurchaseOrderType" example once again:: +Let us consider the ``PurchaseOrderType`` example once again:: class PurchaseOrderTypeBinding extends AbstractComplexBinding { @@ -402,16 +402,16 @@ Let us consider the "PurchaseOrderType" example once again:: In the above, the binding declares a dependency on a factory which it will use to construct objects. You may be asking the question Where does this factory come from?. The answer is the Binding Context. -The Binding Context is used to create bindings. More specifically a binding is created within a binding context. Which means that all dependencies ( a PurchaseOrderFactory in this case ) must also be present in the binding context. For those of you familiar with the concept of Inversion of Control (IoC) it may not surprise you that the binding context is nothing more then a PicoContainer instance. +The Binding Context is used to create bindings. More specifically a binding is created within a binding context. Which means that all dependencies ( a ``PurchaseOrderFactory`` in this case ) must also be present in the binding context. For those of you familiar with the concept of Inversion of Control it may not surprise you that the binding context is nothing more then a ``PicoContainer`` instance. The Binding Context is described further in the Configuration section. Binding Testing '''''''''''''''' -The **XMLTestSupport** class is used as a base class for binding unit tests. +The ``XMLTestSupport`` class is used as a base class for binding unit tests. -Subclasses of XMLTestSupport need to provide the configuration the binding under test is part of. For instance:: +Subclasses of ``XMLTestSupport`` need to provide the configuration the binding under test is part of. For instance:: public class POBindingTest extends XMLTestSupport { @@ -424,7 +424,7 @@ The class provides convenience methods for testing various aspects of all bindin * Parse Testing - Each binding unit test has a member of type org.w3c.dom.Document. It is meant to be used to build up an instance document to be parsed by the parser. The instance document contains the content that the binding under test will parse. The document must be built up from a test method. Once built up, the parse method is called to parse the instance document into an object.:: + Each binding unit test has a member of type ``org.w3c.dom.Document``. It is meant to be used to build up an instance document to be parsed by the parser. The instance document contains the content that the binding under test will parse. The document must be built up from a test method. Once built up, the parse method is called to parse the instance document into an object.:: /** * Parses the built document. @@ -482,7 +482,7 @@ The class provides convenience methods for testing various aspects of all bindin * object: the object to be encoded * element: the qualified name of the element which maps to the object - The method returns a org.w3c.dom.Document object which is the root of the encoded document. + The method returns a ``org.w3c.dom.Document`` object which is the root of the encoded document. An example usage:: diff --git a/docs/user/library/xml/internal/code.rst b/docs/user/library/xml/internal/code.rst index e48b788ee5e..b1ad25cb82e 100644 --- a/docs/user/library/xml/internal/code.rst +++ b/docs/user/library/xml/internal/code.rst @@ -1,7 +1,7 @@ Code Generation ^^^^^^^^^^^^^^^ -The xmlcodegen maven plugin provides a code generator which can be used to generate bindings and other classes used in the geotools xml framework. The code generator feeds off a single schema file and generates a number of java classes. +The ``xmlcodegen`` maven plugin provides a code generator which can be used to generate bindings and other classes used in the GeoTools XML framework. The code generator feeds off a single schema file and generates a number of java classes. Plugin Configuration '''''''''''''''''''' @@ -34,7 +34,7 @@ To use the plugin in a project, the following configuration must first be added -In the above, po.xsd should be replaced with an actual schema file. Once configured the plugin can be executed with the following command:: +In the above, ``po.xsd`` should be replaced with an actual schema file. Once configured the plugin can be executed with the following command:: mvn org.geotools.maven:xmlcodegen:generate @@ -63,25 +63,25 @@ The output of the command will look something like the following:: By default, the code generator will generate the following classes: * A binding for each type in the schema -* A subclass of org.geotools.xsd.Configuration for the schema -* A subclass of org.geotools.xml.BindingConfiguration +* A subclass of ``org.geotools.xsd.Configuration`` for the schema +* A subclass of ``org.geotools.xml.BindingConfiguration`` * An interface containing the qualified names of all elements, attributes, and types defined in the schema -The plugin contains may configuration options which can be used to modify this default behaviour. +The plugin contains may configuration options which can be used to modify this default behavior. **Example: gt-xsd-gml3 GMLSchema** -This example demonstrates how to generate (just) GMLSchema.java, a file containing a type constant for every GML 3.1.1 XSD type, for gt-xsd-gml3, the GeoTools GML 3.1.1 support module. +This example demonstrates how to generate (just) ``GMLSchema.java``, a file containing a type constant for every GML 3.1.1 XSD type, for ``gt-xsd-gml3``, the GeoTools GML 3.1.1 support module. -1. Build xmlcodegen +1. Build ``xmlcodegen`` - In build/maven/xmlcodegen:: + In ``build/maven/xmlcodegen``:: mvn clean install 2. Generate the schema - In modules/extension/xsd/xsd-gml3:: + In ``modules/extension/xsd/xsd-gml3``:: mvn -o xmlcodegen:generateSchema @@ -89,44 +89,44 @@ This example demonstrates how to generate (just) GMLSchema.java, a file containi There are still some manual changes to perform: - * The default location of the schema source file is wrong. Move it, replacing the current GMLSchema.java:: + * The default location of the schema source file is wrong. Move it, replacing the current ``GMLSchema.java``:: mv src/main/java/GMLSchema.java src/main/java/org/geotools/gml3/GMLSchema.java - * The Java package is wrong. Add to the top of GMLSchema.java:: + * The Java package is wrong. Add to the top of ``GMLSchema.java``:: package org.geotools.gml3; - * Java imports are wrong, Fix GMLSchema.java imports in Eclipse with Ctrl-Shift-O. + * Java imports are wrong, Fix ``GMLSchema.java`` imports in Eclipse with ``Ctrl-Shift-O``. Configuration Parameter Reference ''''''''''''''''''''''''''''''''' The code generator plugins offers the following goals: -* xmlcodegen:generate - Generates the parser/encoding configuration and bindings -* xmlcodegen:generateSchema - Generates the class that represents the XML schema as a geotools feature model schema +* ``xmlcodegen:generate`` - Generates the parser/encoding configuration and bindings +* ``xmlcodegen:generateSchema`` - Generates the class that represents the XML schema as a GeoTools feature model schema **Common Configuration** Many configuration parameters are shared between the above goals. The following is a list of all the common configuration parameters: -* schemaLocation (no default) +* ``schemaLocation`` (no default) - Location of the \*.xsd file defining the schema. This can be a relative or absolute path. For relative paths, the schemaSourceDirectory and schemaLookupDirectories parameters are used.:: + Location of the ``*.xsd`` file defining the schema. This can be a relative or absolute path. For relative paths, the ``schemaSourceDirectory`` and ``schemaLookupDirectories`` parameters are used.:: po.xsd /home/bob/filter.xsd -* schemaSourceDirectory (default src/main/xsd) +* ``schemaSourceDirectory`` (default ``src/main/xsd``) - Directory containing the schema specified by schemaLocation, and optionally any other schemas referenced by it.:: + Directory containing the schema specified by ``schemaLocation``, and optionally any other schemas referenced by it.:: src/main/resources /home/bob/schemas -* schemaLookupDirectories (no default) +* ``schemaLookupDirectories`` (no default) List of additional directories to be used to locate referenced schemas.:: @@ -135,66 +135,66 @@ Many configuration parameters are shared between the above goals. The following /home/bob/otherSchemas -* targetPrefix (no default) +* ``targetPrefix`` (no default) - The prefix to be mapped to the 'targetNamespace' of the schema.:: + The prefix to be mapped to the ``targetNamespace`` of the schema.:: po -* destinationPackage (no default) +* ``destinationPackage`` (no default) Name of java package in which to place generated files into. If unspecified the root of the default ( empty ) package is used.:: org.geotools.po -* outputDirectory (default src/main/java) +* ``outputDirectory`` (default ``src/main/java``) - Base location of where generated files should be written. If the destinationPackage is also specified it is appended to this location.:: + Base location of where generated files should be written. If the ``destinationPackage`` is also specified it is appended to this location.:: /home/bob/xml src/other/java -* overwriteExistingFiles (default false) +* ``overwriteExistingFiles`` (default false) Flag controlling whether existing files should be overwritten by newly generated files.:: true -* relativeSchemaReference (default false) +* ``relativeSchemaReference`` (default false) - Treat all relative schema references (include and import) as relative to the schema (XSD) resource in which they are found, rather than looking for them in compiled classes or ``schemaLookupDirectories``. This requires all included/imported schemas to be present in the expected relative filesystem location. The main advantage of this approach is that it supports schema files that have cyclic dependencies (e.g. GML 3.2):: + Treat all relative schema references (include and import) as relative to the schema (XSD) resource in which they are found, rather than looking for them in compiled classes or ``schemaLookupDirectories``. This requires all included/imported schemas to be present in the expected relative file system location. The main advantage of this approach is that it supports schema files that have cyclic dependencies (e.g. GML 3.2):: true **Generate Configuration** -The following configuration parameters apply only to the **generate** goal: +The following configuration parameters apply only to the ``generate`` goal: -* generateXsd (default true) +* ``generateXsd`` (default true) Flag controlling whether the interface containing all the qualified element, attribute, and type names for the schema is generated.:: false -* generateConfiguration (default true) +* ``generateConfiguration`` (default true) Flag controlling whether the Configuration for the schema should be generated.:: false -* generateAttributeBindings (default false) +* ``generateAttributeBindings`` (default false) Flag controlling whether bindings for attributes declared in the schema should be generated.:: true -* generateElementBindings (default false) +* ``generateElementBindings`` (default false) Flag controlling whether bindings for elements declared in the schema should be generated.:: true -* generateTypeBindings (default true) +* ``generateTypeBindings`` (default true) Flag controlling whether bindings for types declared in the schema should be generated.:: @@ -211,7 +211,7 @@ The following configuration parameters apply only to the **generate** goal: PropertyIsNotEqualTo -* bindingConstructorArguments (defaults none) +* ``bindingConstructorArguments`` (defaults none) List of name, class pairs which define the constructor arguments for each generated binding.:: @@ -234,47 +234,47 @@ The following configuration parameters apply only to the **generate** goal: **GenerateSchema Configuration** -The following configuration parameters apply only to the generateSchema goal: +The following configuration parameters apply only to the ``generateSchema`` goal: -* includeComplexTypes (default true) +* ``includeComplexTypes`` (default true) - Controls whether complex types from the XML schema are included in the generated geotools schema + Controls whether complex types from the XML schema are included in the generated GeoTools schema -* includeSimpleTypes (default true) +* ``includeSimpleTypes`` (default true) - Controls whether simple types from the XML schema are included in the generated geotools schema. + Controls whether simple types from the XML schema are included in the generated GeoTools schema. -* followComplexTypes (default false) +* ``followComplexTypes`` (default false) - Controls whether the contents of complex XML types are processed during schema generation. Setting this parameter to true will cause the generator to create geotools types which model exactly their corresponding XML schema types in term of base types and composition:: + Controls whether the contents of complex XML types are processed during schema generation. Setting this parameter to true will cause the generator to create GeoTools types which model exactly their corresponding XML schema types in term of base types and composition:: true -* cyclicTypeSupport (default false) +* ``cyclicTypeSupport`` (default false) Support complex XML types that are cyclically defined, such as ``gmd:CI_CitationType`` from GML 3.2. Types in the generated Schema file will be defined using ``AbstractLazyAttributeType`` and ``AbstractLazyComplexType`` from ``gt-main``. A ``main()`` method is also included in the generated Schema class to aid testing. This option is best used with ``followComplexTypes`` set to ``true``, although if you are working with a multi-package schema such as GML 3.2, you will likely need to bootstrap with ``followComplexTypes`` set to ``false`` to generate skeleton Schema files that you can import before recreating them all with ``followComplexTypes`` set to ``true``:: true -* imports (default none) +* ``imports`` (default none) - List of geotools schema classes to include as an import when generating the schema.:: + List of GeoTools schema classes to include as an import when generating the schema.:: org.geotools.xml.XLINKSchema -* printRecursionPaths (default false) +* ``printRecursionPaths`` (default false) Causes the generator to print out information about how it recurses through the XML schema -* maxRecrusionDepth (default 15) +* ``maxRecrusionDepth`` (default 15) Causes the generator to stop recursion and throw back an error when it reaches a particular recursion depth. This will happen if the schema has circular dependencies among its contents. -* typebindings (default none) +* ``typebindings`` (default none) - Override the default mapping of XSD complex types to Java types in generated *Schema.java*. By default, XSD complex types are mapped to Java ComplexTypeImpl bound to Collection, but for complex types represented by atomic Java types (such a geometries), it may be preferable to map these to AttributeTypeImpl with a binding to the atomic Java type.:: + Override the default mapping of XSD complex types to Java types in generated ``Schema.java``. By default, XSD complex types are mapped to Java ``ComplexTypeImpl`` bound to Collection, but for complex types represented by atomic Java types (such a geometries), it may be preferable to map these to ``AttributeTypeImpl`` with a binding to the atomic Java type.:: diff --git a/docs/user/library/xml/internal/configuration.rst b/docs/user/library/xml/internal/configuration.rst index fdf3f4e9cef..858292d6978 100644 --- a/docs/user/library/xml/internal/configuration.rst +++ b/docs/user/library/xml/internal/configuration.rst @@ -8,15 +8,15 @@ A configuration is an object that is used to configure the parser or the encoder * Locate schema while parsing an instance document * Declare dependencies on other configurations / schemas -More specifically a configuration is an instance of **org.geotools.xsd.Configuration**. +More specifically a configuration is an instance of ``org.geotools.xsd.Configuration``. Schema Location ''''''''''''''' A configuration has a one-to-one correspondence to a particular schema. The configuration references two pieces of information about the schema: -1. Namespace uri of the schema -2. Location of the \*.xsd file which defines the schema +1. Namespace URI of the schema +2. Location of the ``*.xsd`` file which defines the schema Here is what that looks like:: @@ -40,7 +40,7 @@ Here is what that looks like:: String getNamespaceURI(); - The getNamespaceURI method takes no parameters and returns a string which is the namespace uri of the schema. + The ``getNamespaceURI`` method takes no parameters and returns a string which is the namespace URI of the schema. An example implementation for the purchase order schema:: @@ -52,7 +52,7 @@ Here is what that looks like:: String getSchemaLocation(); - The getSchemaLocation method takes no parameters and returns a URI to a \*.xsd file for the schema. It can be any valid uri, local or remote, however it must be an absolute URI. + The ``getSchemaLocation`` method takes no parameters and returns a URI to a ``*.xsd`` file for the schema. It can be any valid URI, local or remote, however it must be an absolute URI. * A common practice is to store a copy of the schema in the same package relative to the configuration. An example implementation for the purchase order schema:: @@ -75,12 +75,12 @@ Here is what that looks like:: return "file:///home/bob/po.xsd" } - This location is used by the parser to actually process the schema while parsing an instance document. For schemas which are made up of multiple \*.xsd files, this value should be to the top level file, ie. the file which includes all other files. + This location is used by the parser to actually process the schema while parsing an instance document. For schemas which are made up of multiple ``*.xsd`` files, this value should be to the top level file, i.e. the file which includes all other files. Binding Configuration ''''''''''''''''''''' -A binding configuration is a set of name, binding mappings used to load bindings for particular elements, attributes, types. More specifically, a binding configuration is an instance of **org.geotools.xml.BindingConfiguration**:: +A binding configuration is a set of name, binding mappings used to load bindings for particular elements, attributes, types. More specifically, a binding configuration is an instance of ``org.geotools.xml.BindingConfiguration``:: interface BindingConfiguration { /** @@ -90,7 +90,7 @@ A binding configuration is a set of name, binding mappings used to load bindings void configure(MutablePicoContainer container); } -The single method configure is used to populate a container with a set of bindings. Each binding is registered under a key. The key is the qualified name (javax.xml.namespace.QName) of the element, attribute, or type the binding is bound to. Example:: +The single method configure is used to populate a container with a set of bindings. Each binding is registered under a key. The key is the qualified name (``javax.xml.namespace.QName``) of the element, attribute, or type the binding is bound to. Example:: class PurchaseOrderBindingConfiguration implements BindingConfiguration { @@ -121,35 +121,35 @@ A configuration maintains a reference to two "helper" classes:: These interfaces are used internally by the eclipse XSD library to parse schemas that are referenced by an instance document. -* XSDSchemaLocationResolver +* ``XSDSchemaLocationResolver`` - The job of this interface is to "resolve" a schema location from a namespace uri, and possible partial schema location. Often in an instance document schema references of the following form are encountered.:: + The job of this interface is to "resolve" a schema location from a namespace URI, and possible partial schema location. Often in an instance document schema references of the following form are encountered.:: ... - The above specifies that the purchase order schmea is defined in a file called "po.xsd". That is great, but where can the parser find the "po.xsd" file. If the reference to the file was an absolute reference it would be a different story, but sadly this is often not so. Luckily this is where the XSDSchemaLocationResolver comes in. + The above specifies that the purchase order schema is defined in a file called ``po.xsd``. That is great, but where can the parser find the ``po.xsd`` file. If the reference to the file was an absolute reference it would be a different story, but sadly this is often not so. Luckily this is where the ``XSDSchemaLocationResolver`` comes in. - Given a namespaceURI, and partial schema location, an instance of this interface must return an "absolute" reference to the file defining the schema. By default, the Configuration class looks in the same package as itself for a resource which matches the schema file name. + Given a ``namespaceURI``, and partial schema location, an instance of this interface must return an "absolute" reference to the file defining the schema. By default, the Configuration class looks in the same package as itself for a resource which matches the schema file name. - This behaviour may be changed by overriding the getSchemaLocationResolver() method of the Conifguration class. + This behavior may be changed by overriding the ``getSchemaLocationResolver()`` method of the ``Configuration`` class. -* XSDSchemaLocator +* ``XSDSchemaLocator`` - The job of this interface is slightly different from that of hte XSDSchemaLocationResolver interface. Instead of returning the absolute resolved location for a schema, it returns the actual schema itself. + The job of this interface is slightly different from that of the ``XSDSchemaLocationResolver`` interface. Instead of returning the absolute resolved location for a schema, it returns the actual schema itself. - By default, the Configuration class will return an instance of XSDSchemaLocator which uses the getSchemaLocation() method to return a schema. Subclasses may wish to override to change this behaviour. + By default, the Configuration class will return an instance of ``XSDSchemaLocator`` which uses the ``getSchemaLocation()`` method to return a schema. Subclasses may wish to override to change this behavior. Configuration Dependency '''''''''''''''''''''''' Just like a schema has dependencies on other schemas, a configuration has dependencies on other configurations. Not surprisingly the configuration dependencies mirror the schema dependencies. -Configuration dependencies are added with the addDependency method.:: +Configuration dependencies are added with the ``addDependency`` method.:: protected void addDependency( Configuration dependency ); -The method should be called from the constructor of a subclass. As an example, the filter schema has a dependency on the gml schema:: +The method should be called from the constructor of a subclass. As an example, the filter schema has a dependency on the GML schema:: class OGCConfiguration extends Configuration { diff --git a/docs/user/library/xml/internal/index.rst b/docs/user/library/xml/internal/index.rst index 122cd40eb97..739581ac005 100644 --- a/docs/user/library/xml/internal/index.rst +++ b/docs/user/library/xml/internal/index.rst @@ -19,18 +19,18 @@ Generated objects matching the XML schema: * :doc:`net.opengis.wps ` : web processing service schema * :doc:`net.opengis.wcs ` : web coverage service schema * :doc:`net.opengis.wfsv ` : web feature service schema -* :doc:`org.w3.xlink ` : xlink schema +* :doc:`org.w3.xlink ` : XLink schema Schema and bindings plugins: * :doc:`gt-xsd-core ` : Basic types defined by XML schema * :doc:`gt-xsd-fes ` : filter 2.0 -* :doc:`gt-xsd-filter ` : filter 1.0 (used by ogc cat and wfs) +* :doc:`gt-xsd-filter ` : filter 1.0 (used by OGC CAT and WFS) * :doc:`gt-xsd-kml ` : keyhole markup language * :doc:`gt-xsd-wfs ` : web feature service * :doc:`gt-xsd-wps ` : web processing service * :doc:`gt-xsd-gml3 ` : geographic markup language 3 -* :doc:`gt-xsd-gml2 ` : geographinc markup language 2 +* :doc:`gt-xsd-gml2 ` : geographic markup language 2 * :doc:`gt-xsd-ows ` : open web services * :doc:`gt-xsd-wcs ` : web coverage service * :doc:`gt-xsd-wms ` : web map service @@ -40,7 +40,7 @@ Schema and bindings plugins: Frequently asked questions for binding developers. -* Q: NullPointerException in createURIWithCache when parsing? +* Q: ``NullPointerException`` in ``createURIWithCache`` when parsing? When I try to parse a document, i get the following error:: @@ -54,11 +54,11 @@ Frequently asked questions for binding developers. ... What this means is that somewhere in your instance document, or in a schema it references, - a relative uri cannot be resolved to an absolute location. + a relative URI cannot be resolved to an absolute location. Possible solutions: - * Ensure that the getSchemaLocationResolver method has been implemented for the Configuration + * Ensure that the ``getSchemaLocationResolver`` method has been implemented for the ``Configuration`` class of your schema. The Code Generator can be used to create a schema location resolver specific to your schema. * Ensure the Configuration class for your schema declares all the necessary dependencies. @@ -73,4 +73,4 @@ Frequently asked questions for binding developers. What this means is that the encoding for the element ( Polygon in this case ) - has not yet been implemented. Please post the problem to the users list. \ No newline at end of file + has not yet been implemented. Please post the problem to the users list. diff --git a/docs/user/library/xml/internal/overview.rst b/docs/user/library/xml/internal/overview.rst index 5aca4ed9d12..5aa9bda8593 100644 --- a/docs/user/library/xml/internal/overview.rst +++ b/docs/user/library/xml/internal/overview.rst @@ -4,7 +4,7 @@ Overview Parsing Overview '''''''''''''''' -Parsing the process of transforming xml elements and attributes in an instance document into java objects. +Parsing the process of transforming XML elements and attributes in an instance document into java objects. .. image:: /images/xml/parserOverview.png @@ -20,7 +20,7 @@ During parsing an XML schema is used to assist in the transformation. The parser xsi:schemaLocation="http://www.geotools.org/po po.xsd"> ... - The key attribute is **xsi:schemaLocation** which contains a **namespace-schema location** mapping. In the above example the mappings tells us that the schema for the namespace "http://www.geotools.org/po" can be found in a file named "po.xsd". The parser uses this mapping to locate the schema for the document. This is known as Schema Resolution. Once the schema has been "resolved", it parsed and processing proceeds to the next phase. + The key attribute is ``xsi:schemaLocation`` which contains a ``namespace-schema location`` mapping. In the above example the mappings tells us that the schema for the namespace "http://www.geotools.org/po" can be found in a file named ``po.xsd``. The parser uses this mapping to locate the schema for the document. This is known as Schema Resolution. Once the schema has been "resolved", it parsed and processing proceeds to the next phase. 2. Element and Attribute Binding @@ -35,11 +35,11 @@ During parsing an XML schema is used to assist in the transformation. The parser * A binding for the type of the element or attribute * A binding for each base type - As an example, consider processing the "purchaseOrder" element shown above. The following bindings would be derived: + As an example, consider processing the ``purchaseOrder`` element shown above. The following bindings would be derived: - * The "purchaseOrder" global element declaration - * The "PurchaseOrderType" type definition ( the declared type of the "purchaseOrder" element ) - * The "anyType" type definition ( the base type of all complex type definitions ) + * The ``purchaseOrder`` global element declaration + * The ``PurchaseOrderType`` type definition ( the declared type of the ``purchaseOrder`` element ) + * The ``anyType`` type definition ( the base type of all complex type definitions ) Once a set of bindings has been located, they are executed in a defined order, and the element or attribute is transformed into an object. Binding derivation and execution is explained in greater detail here. @@ -51,15 +51,15 @@ During parsing an XML schema is used to assist in the transformation. The parser .. image:: /images/xml/parserExecution0.png - * Leading edge of the "purhaseOrder" element is reached. On the leading edge of an element, all of its attributes are parsed. In this case the "orderDate" attribute is parsed into a java.util.Date object, and placed on the stack. + * Leading edge of the ``purchaseOrder`` element is reached. On the leading edge of an element, all of its attributes are parsed. In this case the ``orderDate`` attribute is parsed into a ``java.util.Date`` object, and placed on the stack. .. image:: /images/xml/parserExecution1.png - * Leading edge of the "shipTo" element is reached, and attributes parsed. + * Leading edge of the ``shipTo`` element is reached, and attributes parsed. .. image:: /images/xml/parserExecution2.png - * Leading and trailing edges of the "street" element are reached. For elements themselves, transformation occurs on the trailing edge. In this case, the street element is transformed to a java.lang.String, and placed on the stack. + * Leading and trailing edges of the ``street`` element are reached. For elements themselves, transformation occurs on the trailing edge. In this case, the street element is transformed to a ``java.lang.String,`` and placed on the stack. .. image:: /images/xml/parserExecution3.png @@ -71,30 +71,30 @@ During parsing an XML schema is used to assist in the transformation. The parser .. image:: /images/xml/parserExecution5.png - * Trailing edge of the "shipTo" element. At this state, all the child elements have been processed and exist on the stack. In processing the shipTo element all the values which correspond to child elements and attributes are popped off the stack and used to compose the resulting object for the shipTo element, an instance of Address. The transformed object is then placed on the stack. + * Trailing edge of the ``shipTo`` element. At this state, all the child elements have been processed and exist on the stack. In processing the ``shipTo`` element all the values which correspond to child elements and attributes are popped off the stack and used to compose the resulting object for the ``shipTo`` element, an instance of ``Address``. The transformed object is then placed on the stack. .. image:: /images/xml/parserExecution6.png - * Trailing edge of the "purchaseOrder" element, similar to State 6, the objects created for child elements and attributes are used to compose the resulting purchaseOrder object, an instance of PurchaseOrder. + * Trailing edge of the ``purchaseOrder`` element, similar to State 6, the objects created for child elements and attributes are used to compose the resulting ``purchaseOrder`` object, an instance of ``PurchaseOrder``. .. image:: /images/xml/parserExecution7.png - * Instance document has been processed. The stack contains the single object which corresponds to the root element of the document, in this case "purchaseOrder". + * Instance document has been processed. The stack contains the single object which corresponds to the root element of the document, in this case ``purchaseOrder``. .. image:: /images/xml/parserExecution8.png Encoding Overview ''''''''''''''''' -Encoding is the process of serializing a hierarchy of objects as xml. +Encoding is the process of serializing a hierarchy of objects as XML. .. image:: /images/xml/encoderOverview.png -During encoding an xml schema is used to determine how various objects should be encoded as elemements / attributes, and to navigate through the hierarchy of objects. +During encoding an XML schema is used to determine how various objects should be encoded as elements / attributes, and to navigate through the hierarchy of objects. 1. Element and Attribute Binding - As objects are encoded the xml schema is used to locate bindings to perform the encoding process. During encoding bindings serve two roles: + As objects are encoded the XML schema is used to locate bindings to perform the encoding process. During encoding bindings serve two roles: * Serialization of objects as elements and attributes * Navigation among objects by determining which objects correspond to child elements and attributes of a particular element @@ -105,40 +105,40 @@ During encoding an xml schema is used to determine how various objects should be As an object tree is encoded individual objects are serialized as elements and attributes. The following diagram pictorially represents how the encoding process works. - * The first step is to encode the root element of the document, the "PurchaseOrder element , which corresponds to the top object in the tree + * The first step is to encode the root element of the document, the ``PurchaseOrder`` element , which corresponds to the top object in the tree .. image:: /images/xml/encoderExecution1.png - * Next the the elements type, "PurchaseOrderType", is used to move the process forward and infer the next object to encode. The type yields the attribute "orderDate". + * Next the the elements type, ``PurchaseOrderType``, is used to move the process forward and infer the next object to encode. The type yields the attribute ``orderDate``. .. image:: /images/xml/encoderExecution2.png - * Continuing through the contents of "PurchaseOrderType" is the "shipTo" element. + * Continuing through the contents of ``PurchaseOrderType`` is the ``shipTo`` element. .. image:: /images/xml/encoderExecution3.png - * Since the "shipTo" element is complex, the encoding process recurses into its type, "USAddress", and continues on. The type yields the "country" attribute. + * Since the ``shipTo`` element is complex, the encoding process recurses into its type, ``USAddress``, and continues on. The type yields the ``country`` attribute. .. image:: /images/xml/encoderExecution4.png - * Continuing through the contents of "USAddress" is the "street" element. + * Continuing through the contents of ``USAddress`` is the ``street`` element. .. image:: /images/xml/encoderExecution5.png - * And the "state" element + * And the ``state`` element .. image:: /images/xml/encoderExecution6.png - * And the "zip" element. + * And the ``zip`` element. .. image:: /images/xml/encoderExecution7.png - * All the contents of the "USAddress" type have been completed, the "shipTo" element is closed and recursion pops back to the surrounding type + * All the contents of the ``USAddress`` type have been completed, the ``shipTo`` element is closed and recursion pops back to the surrounding type .. image:: /images/xml/encoderExecution8.png - * All the contents of the "PurchaseOrderType" have been completed, the "purchaseOrder" element is closed. Being the root element of the document there is no containing type and the encoding process is stopped. + * All the contents of the ``PurchaseOrderType`` have been completed, the ``purchaseOrder`` element is closed. Being the root element of the document there is no containing type and the encoding process is stopped. .. image:: /images/xml/encoderExecution9.png -There are some situations where the encoder will try to encode complex features against a complex type that is not completely valid. This happens for example when mapping nested entities against a complex type that doesn't respect GML object-property model. The Java configuration property ``encoder.relaxed`` can be set to ``false`` to disable this behavior. \ No newline at end of file +There are some situations where the encoder will try to encode complex features against a complex type that is not completely valid. This happens for example when mapping nested entities against a complex type that doesn't respect GML object-property model. The Java configuration property ``encoder.relaxed`` can be set to ``false`` to disable this behavior. diff --git a/docs/user/library/xml/internal/tutorial.rst b/docs/user/library/xml/internal/tutorial.rst index eddd6cbffb1..9fd74e98cd2 100644 --- a/docs/user/library/xml/internal/tutorial.rst +++ b/docs/user/library/xml/internal/tutorial.rst @@ -6,24 +6,24 @@ This tutorial covers how to implement XML support for a particular schema. Prerequisites at the time of writing: * Maven 3 -* Build GeoTools trunk locally; the gt2-xmlcodegen maven plugin is not published anywhere - you need to build it +* Build GeoTools trunk locally; the ``gt2-xmlcodegen`` maven plugin is not published anywhere - you need to build it Create a New Project '''''''''''''''''''' Somewhere on your system: -1. Create a new directory called xml-po -2. Add the the following **pom.xml** to the xml-po directory +1. Create a new directory called ``xml-po`` +2. Add the following ``pom.xml`` to the ``xml-po`` directory .. literalinclude:: /artifacts/xml/pom1.xml -3. Create the directories src/main/java and src/main/xsd:: +3. Create the directories ``src/main/java and src/main/xsd``:: mkdir -p src/main/java mkdir -p src/main/resources mkdir -p src/test/java -4. Copy :download:`po.xsd <../../../artifacts/xml/po.xsd>` into src/main/resources +4. Copy :download:`po.xsd <../../../artifacts/xml/po.xsd>` into ``src/main/resources`` .. literalinclude:: ../../../artifacts/xml/po.xsd @@ -32,13 +32,13 @@ Generate the Model The first step is to come up with an object model to work with. There are a number of technologies that will take an XML schema and generate Java code from it. To name a few: -* Eclipse Modelling Framework +* Eclipse Modeling Framework * Java Architecture for XML Binding (JAXB) * XML Beans For this tutorial we will use JAXB. -First we must configure the pom.xml file of our project to use the `maven-jaxb2-plugin `_ plugin, and also depend on jaxb as it will add some annotations. +First we must configure the ``pom.xml`` file of our project to use the `maven-jaxb2-plugin `_ plugin, and also depend on JAXB as it will add some annotations. .. note:: @@ -48,13 +48,13 @@ First we must configure the pom.xml file of our project to use the `maven-jaxb2- You may wish to download a newer copy of the instructions if they seem out of date. -1. Add a dependency on jaxb api: +1. Add a dependency on ``jaxb api``: .. literalinclude:: /artifacts/xml/pom2.xml :start-after: :end-before: -2. Configure the jaxb maven plugin: +2. Configure the JAXB maven plugin: .. literalinclude:: /artifacts/xml/pom2.xml :start-after: @@ -67,7 +67,7 @@ First we must configure the pom.xml file of our project to use the `maven-jaxb2- 4. Now we are ready to generate the model. - Run the jaxb2 code generation:: + Run the JAXB2 code generation:: [xml-po]$ mvn jaxb2:xjc [INFO] Scanning for projects... @@ -91,25 +91,25 @@ First we must configure the pom.xml file of our project to use the `maven-jaxb2- [xml-po]% mvn install -6. At this point, the model should have been generated under src/main/java. +6. At this point, the model should have been generated under ``src/main/java``. - * Items.java - * ObjectFactory.java - * PurchaseOrderType.java - * USAddress.java + * ``Items.java`` + * ``ObjectFactory.java`` + * ``PurchaseOrderType.java`` + * ``USAddress.java`` Generate the Bindings ''''''''''''''''''''' -At this point, we have generated objects from the original schema. The next step will be to generate XML bindings from the original schema. To do this we will make use of the geotools XML generation plugin. +At this point, we have generated objects from the original schema. The next step will be to generate XML bindings from the original schema. To do this we will make use of the GeoTools XML generation plugin. -1. Add a dependency on the geotools xml module: +1. Add a dependency on the GeoTools XML module: .. literalinclude:: /artifacts/xml/pom3.xml :start-after: :end-before: -2. Configure the xml generation plugin: +2. Configure the XML generation plugin: .. literalinclude:: /artifacts/xml/pom3.xml :start-after: @@ -117,11 +117,11 @@ At this point, we have generated objects from the original schema. The next step 3. A couple of things to note about the configuration: - * The schemaLocation tag defines the target schema, in this case po.xsd. - * The destinationPackage defines which package we would like the generate - code to end up in, in this case org.geotools.po.bindings - * The constructorArguments tag defines the constructor arguments we want our - xml bindings to take, in this case org.geotools.po.ObjectFactory which is + * The ``schemaLocation`` tag defines the target schema, in this case ``po.xsd``. + * The ``destinationPackage`` defines which package we would like the generate + code to end up in, in this case ``org.geotools.po.bindings`` + * The ``constructorArguments`` tag defines the constructor arguments we want our + XML bindings to take, in this case ``org.geotools.po.ObjectFactory`` which is a factory that was generated in our model in the previous section 4. At this point, your pom should look like this :download:`pom.xml ` . @@ -172,7 +172,7 @@ At this point, we have generated objects from the original schema. The next step [INFO] Final Memory: 15M/291M [INFO] ------------------------------------------------------------------------ -5. At this point, the bindings should have been generated under src/main/java:: +5. At this point, the bindings should have been generated under ``src/main/java``:: [xml-po]% ls src/main/java/org/geotools/po/bindings @@ -184,19 +184,23 @@ At this point, we have generated objects from the original schema. The next step 6. Some explanation of the generated files is in order: - * Binding.java + * ``Binding.java`` These are the bindings themselves, there should be one for every type in the purchase order schema - * PO.java + + * ``PO.java`` An interface which contains constants for the qualified names of attributes, elements, and types defined in the schema - * POConfiguration - The parser configuration used to prepare the xml parser for parsing an instance of the schema - * POSchemaLocationResolver.java + * ``POConfiguration`` + + The parser configuration used to prepare the XML parser for parsing an instance of the schema + + * ``POSchemaLocationResolver.java`` Helper class used by the configuration to locate our schema file while parsing - * POBindingConfiguration.java + + * ``POBindingConfiguration.java`` Helper class used by the configuration to register the generated bindings with the parser @@ -227,15 +231,15 @@ The next step is to implement the bindings, which are at this point contain stub [INFO] 2. The command will produce a few warnings were it cannot find source or - javadoc files but it will generate a .project and .classpath allowing you to + javadoc files but it will generate a ``.project`` and ``.classpath`` allowing you to import the project into eclipse. .. image:: /images/xml/eclipseImport.png .. note:: - You may get a compile error from Eclipse noting `The method parse(InstanceComponent, Object) in the type AbstractSimpleBinding is not applicable for the arguments (ElementInstance, Node, Object) PurchaseOrderBinding.java /xml-po/src/main/java/org/geotools/po/bindings line 60 Java Problem` + You may get a compile error from Eclipse noting ``The method parse(InstanceComponent, Object) in the type AbstractSimpleBinding is not applicable for the arguments (ElementInstance, Node, Object) PurchaseOrderBinding.java /xml-po/src/main/java/org/geotools/po/bindings line 60 Java Problem`` - This is easily solved by changing PurchaseOrderBinding to exend AbstractComplexBinding instead of the generated AbstractSimpleBinding. + This is easily solved by changing PurchaseOrderBinding to extend AbstractComplexBinding instead of the generated ``AbstractSimpleBinding``. 3. We will take a bottom approach to implementation of the bindings, that is starting with bindings for types that are referenced by other types. @@ -251,7 +255,7 @@ SKU (Simple Type) 2. From the schema definition, we see that the SKU type is a Simple Type, - which extends xsd:string. In the realm of xml schema, the following diagram + which extends ``xsd:string.`` In the realm of XML schema, the following diagram depicts the inheritance hierarchy of the SKU type: .. image:: /images/xml/skuHierachy.png @@ -265,7 +269,7 @@ SKU (Simple Type) 4. Implement the parse method - So with that explanation, we can implement the SKUBinding.parse method:: + So with that explanation, we can implement the ``SKUBinding.parse`` method:: Object parse( InstanceComponent instance, Object value ) { return null; @@ -273,7 +277,7 @@ SKU (Simple Type) } The value parameter is the parsed value that has been passed down from the - parent ( xsd:string ), which is an instance of java.lang.String, so we can + parent ( ``xsd:string`` ), which is an instance of ``java.lang.String``, so we can cast accordingly.:: Object parse( InstanceComponent instance, Object value ) { @@ -295,11 +299,11 @@ SKU (Simple Type) return sku; } -5. Implement the getType method +5. Implement the ``getType`` method The last thing to do in implementing the SKU binding is to declare the type of the object that it returns. From the implementation parse it is clear that - this is java.lang.String.:: + this is ``java.lang.String``.:: Class getType() [ return String.class; @@ -310,29 +314,29 @@ SKU (Simple Type) Comment (Simple Type) ''''''''''''''''''''' -1. We will start by implementing the binding for the Comment type in our schema:: +1. We will start by implementing the binding for the ``Comment`` type in our schema:: -2. Implement the parse method:: +2. Implement the ``parse`` method:: Object parse(InstanceComponent instance, Object value) throws Exception { String comment = (String) value; return comment; } -3. Implement the getType method:: +3. Implement the ``getType`` method:: Class getType() { return String.class; } -4. You can download completed :download:`CommentBinding.java ` . +4. You can download the completed code :download:`CommentBinding.java ` . USAddress (Complex Type) '''''''''''''''''''''''' -1. Next we will move on to implement a binding for the ComplexType USAddress:: +1. Next we will move on to implement a binding for the ``ComplexType`` ``USAddress``:: @@ -355,7 +359,7 @@ USAddress (Complex Type) return null; } -3. The difference is the addition of the node parameter. A Node instance +3. The difference is the addition of the node parameter. A ``Node`` instance contains the parsed values of all elements and attributes contained within the complex type. The node API is map like in which element and attribute values can be looked up by name:: @@ -365,13 +369,13 @@ USAddress (Complex Type) Object getAttributeValue( String name ): } - So in implementing the binding for USAddress, we will make use of the node to + So in implementing the binding for ``USAddress``, we will make use of the node to obtain the properties of the address. 4. Implement the parse method - The first step is to create a new instance of USAddress. To do so we make - use of the org.geotools.po.ObjectFactory. If you remember earlier when we + The first step is to create a new instance of ``USAddress``. To do so we make + use of the ``org.geotools.po.ObjectFactory``. If you remember earlier when we configured the binding generator, we specified that each binding should take one of these factories in its constructor. Well know we will put it to use.:: @@ -381,7 +385,7 @@ USAddress (Complex Type) } 5. Next, we must get the values for each of the elements and attributes defined - in the XML schema type for USAddress from the node parameter:: + in the XML schema type for ``USAddress`` from the node parameter:: Object parse(ElementInstance instance, Node node, Object value) throws Exception { USAddress address = factory.createUSAddress(); @@ -399,10 +403,10 @@ USAddress (Complex Type) return address; } -6. Implement the getType method +6. Implement the ``getType`` method Same as with simple types above, complex bindings must declare the type of - object they create. An so:: + object they create. And so:: Class getType() { return USAddress.class; @@ -437,11 +441,11 @@ Moving along we encounter the Items type. The schema for the type is relatively -However, the element "item" itself provides a small wrinkle: it has an Anonymous Inline Type Definition. +However, the element ``item`` itself provides a small wrinkle: it has an Anonymous Inline Type Definition. 1. The convention used for the binding append the element name to the name of the parent. - In this case "Items_item".:: + In this case ``Items_item``.:: Class getType() { return Items.Item.class; @@ -469,7 +473,7 @@ Items ( Another Complex Type ) Items is just a container for multiple Item elements. -1. In implementing we make use of the getChildValues() method of Node, which returns a collection of child elements corresponding to a particular name.:: +1. In implementing we make use of the ``getChildValues()`` method of Node, which returns a collection of child elements corresponding to a particular name.:: Class getType() { return Items.class; @@ -491,7 +495,7 @@ Items is just a container for multiple Item elements. PurchaseOrder ( Another Complex Type ) '''''''''''''''''''''''''''''''''''''' -1. PurchaseOrder is a complex type based upon the complex type PurchaseOrderType:: +1. ``PurchaseOrder`` is a complex type based upon the complex type ``PurchaseOrderType``:: @@ -516,7 +520,7 @@ PurchaseOrder ( Another Complex Type ) PurchaseOrderType( The Last One ) ''''''''''''''''''''''''''''''''' -Onto the final binding to implement PurchaseOrderType. +Onto the final binding to implement ``PurchaseOrderType``. 1. Compared to the binding for Items it is simple:: @@ -540,14 +544,14 @@ Onto the final binding to implement PurchaseOrderType. All Done!! ... for now. -And thats that for implementing the bindings. In the continuing sections we will focus on configuring the parser in order to hook up the bindings implemented in this section. +And that's that for implementing the bindings. In the continuing sections we will focus on configuring the parser in order to hook up the bindings implemented in this section. Configure the Binding Context ''''''''''''''''''''''''''''' -You should recall above our discussion about injecting all of our bindings with an instance of org.geotools.po.ObjectFactory. But where does this come from? The answer is the Binding Context. The Binding Context is a container ( PicoContainer ) in which all the bindings are created in. The container uses Dependency Injection to satisfy binding dependencies. Therefore anytime a binding requires a factory or some other class to do work, it just has to declare one in its constructor. +You should recall above our discussion about injecting all of our bindings with an instance of ``org.geotools.po.ObjectFactory``. But where does this come from? The answer is the Binding Context. The Binding Context is a container ( ``PicoContainer`` ) in which all the bindings are created in. The container uses Dependency Injection to satisfy binding dependencies. Therefore anytime a binding requires a factory or some other class to do work, it just has to declare one in its constructor. -But, these dependencies have to be placed in the container at some point. This is done by the Configuration class. So in our case we would like to place an instance of org.geotools.po.ObjectFactory in the context. We do this by implementing the configureContext method in POConfiguration.:: +But, these dependencies have to be placed in the container at some point. This is done by the Configuration class. So in our case we would like to place an instance of ``org.geotools.po.ObjectFactory`` in the context. We do this by implementing the ``configureContext`` method in ``POConfiguration``.:: class POConfiguration { ... @@ -557,14 +561,14 @@ But, these dependencies have to be placed in the container at some point. This i } } -The complete implementation of POConfiguration can be found here. +The complete implementation of ``POConfiguration`` can be found here. Test the Bindings ''''''''''''''''' Now that the bindings are implemented, it is time to do some testing. -1. Add the junit dependency to the pom:: +1. Add the ``junit`` dependency to the pom:: junit @@ -577,13 +581,13 @@ Now that the bindings are implemented, it is time to do some testing. [xml-po]% mvn eclipse:eclipse -3. Switch to your ide and create a new test class: POTest ( remember that test cases live under src/test/java in the project ):: +3. Switch to your IDE and create a new test class: ``POTest`` ( remember that test cases live under ``src/test/java`` in the project ):: class POTest extends TestCase { } -4. Next, create a test method called test, which will build up a dom tree for an USAddress element.:: +4. Next, create a test method called test, which will build up a DOM tree for an ``USAddress`` element.:: public void test() throws Exception { @@ -596,11 +600,11 @@ Now that the bindings are implemented, it is time to do some testing. assertNotNull( po ); } -5. The complete implementation of POTest can be found here. +5. The complete implementation of ``POTest`` can be found here. 6. To run the test we will create a test resource directory:: [xml-po]% mkdir -p src/test/resources/org/geotools/po -7. Copy po.xml into the new directory +7. Copy ``po.xml`` into the new directory 8. Run the test from your IDE diff --git a/docs/user/library/xml/resolving.rst b/docs/user/library/xml/resolving.rst index 3f6d0287c95..1761e893dd3 100644 --- a/docs/user/library/xml/resolving.rst +++ b/docs/user/library/xml/resolving.rst @@ -40,4 +40,4 @@ Example:: SchemaResolver resolver = new SchemaResolver(new SchemaCache(new File("/path/to/schema-cache"), true)); -If downloads are not enabled, a prepopulated cache will still be used, but missing schemas will not be downloaded. +If downloads are not enabled, a pre-populated cache will still be used, but missing schemas will not be downloaded. diff --git a/docs/user/library/xml/style.rst b/docs/user/library/xml/style.rst index 214a1b004d0..9cf344f43d8 100644 --- a/docs/user/library/xml/style.rst +++ b/docs/user/library/xml/style.rst @@ -3,7 +3,7 @@ Style References: -* http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd (xml schema) +* http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd (XML schema) * http://schemas.opengis.net/sld/1.0.0/example-sld.xml (example) @@ -15,13 +15,13 @@ Parser You can use a GTXML Configuration to parse and encode SLD documents. -To parse an SLD document use the SLDConfiguration:: +To parse an SLD document use the ``SLDConfiguration``:: Configuration config = new SLDConfiguration(); Parser parser = new Parser(config); StyledLayerDescriptor sld = (StyledLayerDescriptor) parser.parse(inputStream); -Consider the following sld document:: +Consider the following SLD document:: Run Configurations from the menu -and create a new Java Application config with the following configuration. +and create a new ``Java Application Config`` with the following configuration. .. figure:: artifacts/runconf.png -Under the *Arguments* tab we'll point our application at the downloaded raster data, give it a tile -count of 16x8, output it to a temp director and scale the tiles by two. +Under the ``Arguments`` tab we'll point our application at the downloaded raster data, give it a tile +count of ``16x8``, output it to a temp director and scale the tiles by two. `-f /Users/devon/Downloads/NE2_50M_SR_W/NE2_50M_SR_W.tif -htc 16 -vtc 8 -o /Users/devon/tmp/tiles -scale 2.0` @@ -160,7 +160,7 @@ Running With Maven ------------------ If you're not using an IDE then the easiest way to run our application is to use the Maven exec task to run our application for us, as detailed in the `Maven Quickstart`_. We simply need to add the Maven Shade -plugin to our pom.xml +plugin to our ``pom.xml`` ``mvn exec:java -Dexec.mainClass=org.geotools.tutorial.ImageTiler -Dexec.args="-f /Users/devon/Downloads/NE2_50M_SR_W/NE2_50M_SR_W.tif -htc 16 -vtc 8 -o /Users/devon/tmp/tiles -scale 2.0"`` @@ -171,7 +171,7 @@ Things to Try ============= * See the `Coverage Processor`_ documentation for more information about the operations available - on coverages. One of the operations available in the CoverageProcessor is Resample (see the `Operations`_ class), which we can use to + on coverages. One of the operations available in the ``CoverageProcessor`` is ``Resample`` (see the `Operations`_ class), which we can use to reproject our coverage very easily. Try reprojecting the coverage into EPSG:3587 (Google's Web Mercator projection). * We can verify that our tiles look OK by loading them into the GeoServer `ImageMosaic`_ store. Alternatively we could programmatically create an `ImageMosaicReader`_ pointed at our directory files and read from it. diff --git a/docs/user/tutorial/datastore/intro.rst b/docs/user/tutorial/datastore/intro.rst index a7c901e6084..4cfde994c83 100644 --- a/docs/user/tutorial/datastore/intro.rst +++ b/docs/user/tutorial/datastore/intro.rst @@ -8,9 +8,9 @@ Introducing CSVDataStore In our initial :doc:`feature tutorial ` we provided a code snippet to read in comma separated value file and produce feature collection. -In this tutorial we will build a CSV DataStore, and in the process explore several aspects of how DataStores work and best to make use of them. +In this tutorial we will build a CSV DataStore, and in the process explore several aspects of how ``DataStore``\ s work and best to make use of them. -If you would like to follow along with this workshop, start a new Java project in your favourite IDE, and ensure GeoTools is on your CLASSPATH (using maven or downloading the jars). +If you would like to follow along with this workshop, start a new Java project in your favorite IDE, and ensure GeoTools is on your CLASSPATH (using maven or downloading the jars). .. note:: Terminology @@ -46,38 +46,38 @@ Approach to Parsing CSV Here is our strategy for representing GeoTools concepts with a CSV file. -* FeatureID or FID - uniquely defines a Feature. +* ``FeatureID`` or ``FID`` - uniquely defines a Feature. We will use the row number in our CSV file. -* FeatureType Name +* ``FeatureType`` Name Same as the name of the :file:`.csv` file (i.e. "locations" for :file:`locations.csv`.) -* DataStore +* ``DataStore`` - We will create a **CSVDataStore** to access all the FeatureTypes (.csv files) in a directory + We will create a ``CSVDataStore`` to access all the ``FeatureTypes`` (``.csv`` files) in a directory -* FeatureType or Schema +* ``FeatureType`` or Schema We will represent the names of the columns in our CSV (and if possible their types). -* Geometry +* ``Geometry`` - Initially we will try to recognise several columns and map them into Point x and y ordinates. This technique is used to handle content from websites such as **geonames**. + Initially we will try to recognize several columns and map them into Point x and y ordinates. This technique is used to handle content from websites such as **geonames**. We can also look at parsing a column using the Well-Known-Text representation of a Geometry. -# CoordinateReferenceSystem +# ``CoordinateReferenceSystem`` - Look for a :file:`prj` sidecar file (ie :file:`locations.prj` for :file:`locations.csv` .) + Look for a :file:`prj` sidecar file (i.e.:file:`locations.prj` for :file:`locations.csv` .) JavaCSV Reader ^^^^^^^^^^^^^^ Rather than go through the joy of parsing a CSV file by hand, we are going to make use of a library to read CSV files. -The **JavaCSV** project looks nice and simple and is available in maven: +The ``JavaCSV`` project looks nice and simple and is available in maven: * http://opencsv.sourceforge.net (Apache 2.0) @@ -125,16 +125,16 @@ Time to create a new project making use of this library: #. You can check against the completed :download:`pom.xml ` -#. Create a directory `src/test/resources` and in there create package `org.geotools.tutorial.csv`. Then add locations.csv to this package. +#. Create a directory `src/test/resources` and in there create package `org.geotools.tutorial.csv`. Then add ``locations.csv`` to this package. - * package: org.geotools.tutorial.csv - * file: locations.csv + * package: ``org.geotools.tutorial.csv`` + * file: ``locations.csv`` .. literalinclude:: artifacts/locations.csv Download :download:`locations.csv `. -#. Below is a JUnit4 test case to confirm JavaCSV is available and can read our file. Create a directory `src/test/java` and in there create package `org.geotools.tutorial.csv`. Then add CSVTest.java to the package: +#. Below is a ``JUnit4`` test case to confirm ``JavaCSV`` is available and can read our file. Create a directory `src/test/java` and in there create package `org.geotools.tutorial.csv`. Then add ``CSVTest.java`` to the package: .. literalinclude:: /../src/main/java/org/geotools/tutorial/csv/CSVTest.java :language: java diff --git a/docs/user/tutorial/datastore/optimisation.rst b/docs/user/tutorial/datastore/optimisation.rst index 74c376edc92..1f2e4626755 100644 --- a/docs/user/tutorial/datastore/optimisation.rst +++ b/docs/user/tutorial/datastore/optimisation.rst @@ -6,14 +6,14 @@ Optimization ------------ -In this part we will explore several Optimization techniques for CSVDataStore. +In this part we will explore several Optimization techniques for ``CSVDataStore``. Query Hints ^^^^^^^^^^^ The GeoTools Hints system can be used to configure a DataStore for use by an application. This is often done to speed things up by providing the Factories that the DataStore will use during the course of its operation. -As an example a CurvedGeoemtryFactory with a specific tolerance can be passed in to aid in parsing WKT containing arcs: +As an example a ``CurvedGeoemtryFactory`` with a specific tolerance can be passed in to aid in parsing WKT containing arcs: .. code-block:: java @@ -23,30 +23,30 @@ As an example a CurvedGeoemtryFactory with a specific tolerance can be passed in query.setHints(hints); SimpleFeatureCollection features = featureSource.getFeatures( query ); -To interactively discover what hints are supported clients call FeatureSource.getSupportedHints(). +To interactively discover what hints are supported clients call ``FeatureSource.getSupportedHints()``. At the time of writing the following hints are supported: -* Hints.FEATURE_DETACHED: indicates returned features are a copy (can can be modified without side-effect) -* Hints.JTS_GEOMETRY_FACTORY: control of geometry representation -* Hints.JTS_COORDINATE_SEQUENCE_FACTORY: control of coordinate storage (you may be able to optimise read performance by directly using the binary data provided by your dataformat, or you may wish to optimise for memory use). -* Hints.JTS_PRECISION_MODEL: configure to match precision maintained by coordinate sequence factory -* Hints.JTS_SRID: for compatibility with systems using a spatial reference system identifier (such as PostGIS) -* Hints.GEOMETRY_DISTANCE: used to select a geometry of appropriate generalization. Your datastore may wish to simplify "on the fly" while reading the geometry -* Hints.FEATURE_2D: used to indicate that only two dimensions are required (ignoring the 3rd dimension for 2.5D data) +* ``Hints.FEATURE_DETACHED``: indicates returned features are a copy (can can be modified without side-effect) +* ``Hints.JTS_GEOMETRY_FACTORY``: control of geometry representation +* ``Hints.JTS_COORDINATE_SEQUENCE_FACTORY``: control of coordinate storage (you may be able to optimize read performance by directly using the binary data provided by your data format, or you may wish to optimize for memory use). +* ``Hints.JTS_PRECISION_MODEL``: configure to match precision maintained by coordinate sequence factory +* ``Hints.JTS_SRID``: for compatibility with systems using a spatial reference system identifier (such as PostGIS) +* ``Hints.GEOMETRY_DISTANCE``: used to select a geometry of appropriate generalization. Your datastore may wish to simplify "on the fly" while reading the geometry +* ``Hints.FEATURE_2D``: used to indicate that only two dimensions are required (ignoring the 3rd dimension for 2.5D data) Many of these values are filled in when rendering, by taking advantage of these query hints you can offer vastly improved performance. QueryCapabilities ^^^^^^^^^^^^^^^^^ -Your implementation can also advertise additional functionality using the FeatureSource.getQueryCapabilities() data structure. +Your implementation can also advertise additional functionality using the ``FeatureSource.getQueryCapabilities()`` data structure. -Formats that allows user supplied FeatureIds when adding new features fill in QueryCapabilities.isUseProvidedFIDSupported() to return true. +Formats that allows user supplied ``FeatureIds`` when adding new features fill in ``QueryCapabilities.isUseProvidedFIDSupported()`` to return true. -To use this approach CSVDataStore would need to be extended with an FID_COLUMN parameter (to be used as a FeatureId). This works when reading (or modifying) existing features, but we run into a glitch in the API when inserting new features ... the feature id cannot be changed! +To use this approach ``CSVDataStore`` would need to be extended with an ``FID_COLUMN`` parameter (to be used as a ``FeatureId``). This works when reading (or modifying) existing features, but we run into a glitch in the API when inserting new features, the feature id cannot be changed! -The workaround is to ask clients to store the proposed FeatureId in the user data map: +The workaround is to ask clients to store the proposed ``FeatureId`` in the user data map: .. code-block:: java @@ -80,9 +80,9 @@ Single Use Feature Writers '''''''''''''''''''''''''' The first level of optimizations available is paying attention to the flags -provided when setting up our CSVFeatureWriter. +provided when setting up our ``CSVFeatureWriter``. -The **flags** passed in provide a bit of context for how the FeatureWriter will be +The **flags** passed in provide a bit of context for how the ``FeatureWriter`` will be used - so if you have a better implementation on hand you are welcome to use it. .. code-block:: java @@ -94,17 +94,17 @@ used - so if you have a better implementation on hand you are welcome to use it. return new CSVFeatureWriter(getState(), query, append); } -There are three distinct uses for FeatureWriters: +There are three distinct uses for ``FeatureWriters``: -* getFeatureWriter( typeName, transaction ) +* ``getFeatureWriter( typeName, transaction )`` - General purpose FeatureWriter + General purpose ``FeatureWriter`` -* getFeatureWriter( typeName, filter, transaction ) +* ``getFeatureWriter( typeName, filter, transaction )`` An optimized version that does not create new content can be created. -* getFeatureWriterAppend( typeName, transaction) +* ``getFeatureWriterAppend( typeName, transaction)`` An optimized version that duplicates the original file, and opens it in append mode can be created. We can also perform special tricks such as returning a Feature delegate to the user, @@ -117,10 +117,10 @@ There are three distinct uses for FeatureWriters: Tips: - * It is tempting to start with the use of Files.copy, but remember you need to track the number - of features in order to generate FeatureIds when appending. + * It is tempting to start with the use of ``Files.copy()`` but remember you need to track the number + of features in order to generate ``FeatureIds`` when appending. - * You may wish to review the implementation of FeatureWriters in ShapeDataStore and JDBCDataStore. + * You may wish to review the implementation of ``FeatureWriter``\ s in ``ShapeDataStore`` and ``JDBCDataStore``. .. Files.copy(file.toPath(), temp.toPath(), StandardCopyOption.REPLACE_EXISTING ); CsvReader count = null; @@ -138,17 +138,17 @@ There are three distinct uses for FeatureWriters: Wrapper/Decorator Optimization '''''''''''''''''''''''''''''' -ContentDataStore provides a lot of functionality based on the methods we implemented in the +``ContentDataStore`` provides a lot of functionality based on the methods we implemented in the Tutorials. We also know there are a number of wrappers used to fill in the gaps in our functionality. -It is worth reviewing **ContentFeatureSource.getReader(Query query)** to see what wrappers may be +It is worth reviewing ``ContentFeatureSource.getReader(Query query)`` to see what wrappers may be in play. .. note:: Each wrapper represents a post-processing step that is being applied on your data. If you are making - use of a service that supports reprojection - then you can implement canReproject() and avoid + use of a service that supports reprojection - then you can implement ``canReproject()`` and avoid this overhead. .. code-block:: java @@ -232,16 +232,16 @@ in play. .. note:: Challenge - The canRetype() operations is easy to support, check the query and only provide values for the - requested attributes. This is an especially valuable Optimization to perform at a low-level as - you may be able to avoid an expensive step (like parsing Geometry) if it is not being requested + The ``canRetype()`` operations is easy to support, check the query and only provide values for the + requested attributes. This is an especially valuable optimization to perform at a low-level as + you may be able to avoid an expensive step (like parsing ``Geometry``) if it is not being requested by the client. Tips: - * Check the Query object passed into your FeatureWriter + * Check the ``Query`` object passed into your ``FeatureWriter`` -A similar set of wrappers is used for FeatureWriter: +A similar set of wrappers is used for ``FeatureWriter``: .. code-block:: java @@ -281,18 +281,18 @@ A similar set of wrappers is used for FeatureWriter: return writer; } -The wrapper classes mentioned above are excellent examples on how to create your own FeatureWriters. +The wrapper classes mentioned above are excellent examples on how to create your own ``FeatureWriters``. .. note:: - Historically Filter.ALL and Filter.NONE were used as placeholder, - as crazy as it sounds, Filter.ALL filters out ALL (accepts none) - Filter.NONE filters out NONE (accepts ALL). + Historically ``Filter.ALL`` and ``Filter.NONE`` were used as placeholder, + as crazy as it sounds, ``Filter.ALL`` filters out ALL (accepts none) + ``Filter.NONE`` filters out NONE (accepts ALL). These two have been renamed in GeoTools 2.3 for the following: - * Filter.ALL has been replaced with Filter.EXCLUDE - * Filter.NONE has been replaced with Filter.INCLUDE + * ``Filter.ALL`` has been replaced with ``Filter.EXCLUDE`` + * ``Filter.NONE`` has been replaced with ``Filter.INCLUDE`` Every helper class we discussed above can be replaced if your external data source supports the functionality. @@ -300,57 +300,57 @@ functionality. Custom ContentState ''''''''''''''''''' -JDBDataStore supplies an example of subclassing ContentEntry to store additional information. +``JDBDataStore`` supplies an example of sub-classing ``ContentEntry`` to store additional information. .. figure:: images/JDBCState.png - JDBCState + ``JDBCState`` .. note:: Challenge - Create your own CSVState and wire it into CSVDataStore. + Create your own ``CSVState`` and wire it into ``CSVDataStore``. - If you like you can use your CSVState to store a SpatialIndex listing the row numbers. + If you like you can use your ``CSVState`` to store a ``SpatialIndex`` listing the row numbers. High-Level Optimization ^^^^^^^^^^^^^^^^^^^^^^^ -DataStore, FeatureSource and FeatureStore provide a few methods specifically set up +``DataStore``, ``FeatureSource`` and ``FeatureStore`` provide a few methods specifically set up for Optimization. DataStore Optimization '''''''''''''''''''''' -DataStore leaves open a number of methods for high-level optimisations: +DataStore leaves open a number of methods for high-level optimizations: -* ContentDataStore.getCount( query ) -* ContentDataStore.getBounds( query ) +* ``ContentDataStore.getCount( query )`` +* ``ContentDataStore.getBounds( query )`` -ContentDataStore has already done a good job of isolating this calculation and recording -the result on ContentState (so it is not regenerated each time). +``ContentDataStore`` has already done a good job of isolating this calculation and recording +the result on ``ContentState`` (so it is not regenerated each time). FeatureStore Optimization '''''''''''''''''''''''''' -DataStores operating against rich external data sources can often perform high level Optimizations. -JDBCDataStores for instance can often construct SQL statements that completely fulfill a request -without making use of FeatureWriters at all. +``DataStore``\ s operating against rich external data sources can often perform high level optimizations. +``JDBCDataStores`` for instance can often construct SQL statements that completely fulfill a request +without making use of ``FeatureWriter``\ s at all. When performing these queries please remember two things: -1. Check the lockingManager - If you are not providing your own native locking support, please - check the user's authorisation against the the lockingManager +1. Check the ``lockingManager`` - If you are not providing your own native locking support, please + check the user's authorization against the ``lockingManager`` 2. Event Notification - Remember to fire the appropriate notification events when contents change, Feature Caches will depend on this notification to accurately track the contents of your DataStore .. note:: **Challenge** - Since the FeatureId for CSV files is determined by row number, you can quickly scan to - to a requested FeatureID by skipping an appropriate number of rows. + Since the ``FeatureId`` for CSV files is determined by row number, you can quickly scan to + to a requested ``FeatureID`` by skipping an appropriate number of rows. - Use this knowledge to implement an optimized version of FeatureSource.removeFeatures(Filter filter) - that detects the use of an Id filter. + Use this knowledge to implement an optimized version of ``FeatureSource.removeFeatures(Filter filter)`` + that detects the use of an ``Id`` filter. - Hint: The Id Filter contains a Set - and you deliberately constructed your FeatureId + Hint: The ``Id`` Filter contains a ``Set`` - and you deliberately constructed your ``FeatureId`` with a consistent pattern. diff --git a/docs/user/tutorial/datastore/qa.rst b/docs/user/tutorial/datastore/qa.rst index 4fa5af96f5c..f8f8a609df3 100644 --- a/docs/user/tutorial/datastore/qa.rst +++ b/docs/user/tutorial/datastore/qa.rst @@ -6,13 +6,13 @@ Quality Assurance ----------------- -Since this tutorial has been written the result has been broken out into a distinct **gt-csv** plugin (with some feedback from the GeoServer community). +Since this tutorial has been written the result has been broken out into a distinct ``gt-csv`` plugin (with some feedback from the GeoServer community). To get an idea of what kind of "extra work" is required for an unsupported plugin: #. Ask on the email list - a Project Steering Committee member can often reply with a +1 and go about getting you commit access on GitHub. The project is fairly relaxed with a safe "unsupported" area for new experiments. -#. Set up a pom.xml and hook the module in to the build -#. Use a profile in unsupported/pom.xml to include your module in the build +#. Set up a ``pom.xml`` and hook the module in to the build +#. Use a profile in ``unsupported/pom.xml`` to include your module in the build To get the module supported (and included in each GeoTools release): @@ -26,13 +26,13 @@ For more information see the `developers guide `. -* DataStore.getTypeNames() +* ``DataStore.getTypeNames()`` - The method getTypeNames provides a list of the available types. + The method ``getTypeNames`` provides a list of the available types. - getTypeNames() example: + ``getTypeNames()`` example: .. literalinclude:: /../src/main/java/org/geotools/tutorial/csv/CSVTest.java :language: java :start-after: // example1 start :end-before: // example1 end - Produces the following output (given a directory with example.properties): + Produces the following output (given a directory with ``example.properties``): .. literalinclude:: artifacts/read-output.txt :language: text :start-after: example1 start :end-before: example1 end -* DataStore.getSchema( typeName ) +* ``DataStore.getSchema(typeName)`` - The method getSchema( typeName ) provides access to a FeatureType referenced by a type name. + The method ``getSchema(typeName)`` provides access to a ``FeatureType`` referenced by a type name. - getSchema( typeName ) example: + ``getSchema(typeName)`` example: .. literalinclude:: /../src/main/java/org/geotools/tutorial/csv/CSVTest.java :language: java @@ -54,70 +54,63 @@ If you would like to follow along with these examples you can download :start-after: example2 start :end-before: example2 end -* DataStore.getFeatureReader( query, transaction ) +* ``DataStore.getFeatureReader(query, transaction)`` - The method getFeatureReader( query, transaction ) allows access to the contents + The method ``getFeatureReader(query, transaction)`` allows access to the contents of our DataStore. The method signature may be more complicated than expected, we certainly did not talk - about Query or Transactions when we implemented our CSVDataStore. This is something - that AbstractDataStore is handling for you and will be discussed later in the section - on optimisation. + about ``Query`` or ``Transactions`` when we implemented our ``CSVDataStore``. This is something + that ``AbstractDataStore`` is handling for you and will be discussed later in the section + on optimization. - * Query.getTypeName() + * ``Query.getTypeName()`` - Determines which FeatureType is being requested. In addition, Query supports the - customization attributes, namespace, and typeName requested from the DataStore. - While you may use DataStore.getSchema( typeName ) to retrieve the types as specified by - the DataStore, you may also create your own FeatureType to limit the attributes returned + Determines which ``FeatureType`` is being requested. In addition, ``Query`` supports the + customization ``attributes``, ``namespace``, and ``typeName`` requested from the ``DataStore``. + While you may use ``DataStore.getSchema(typeName)`` to retrieve the types as specified by + the ``DataStore``, you may also create your own ``FeatureType`` to limit the attributes returned or cast the result into a specific namespace. - * Query.getFilter() + * ``Query.getFilter()`` Used to define constraints on which features should be fetched. The constraints can be on spatial and non-spatial attributes of the features. - * Query.getPropertiesNames() + * ``Query.getPropertiesNames()`` - Allows you to limit the number of properties of the returned Features to only those + Allows you to limit the number of properties of the returned ``Features`` to only those you are interested in. - * Query.getMaxFeatures() + * ``Query.getMaxFeatures()`` Defines an upper limit for the number of features returned. - * Query.getHandle() + * ``Query.getHandle()`` User-supplied name used to describe a query in user's terms in any generated error messages. - * Query.getCoordinateSystem() + * ``Query.getCoordinateSystem()`` - Used to force the use of a user-supplied CoordinateSystem (rather than the one supplied - by the DataStore). This capability will allow client code to use our DataStore with a - CoordinateSystem of their choice. The coordinates returned by the DataStore will not be + Used to force the use of a user-supplied ``CoordinateSystem`` (rather than the one supplied + by the ``DataStore``). This capability will allow client code to use our ``DataStore`` with a + ``CoordinateSystem`` of their choice. The coordinates returned by the ``DataStore`` will not be modified in any way. - * Query.getCoordinateSystemReproject() + * ``Query.getCoordinateSystemReproject()`` - Used to reproject the Geometries provided by a DataStore from their original value (or - the one provided by Query.getCoordinateSystem) into a different coordinate system. - The coordinate returned by the DataStore will be processed , either natively by - Advanced DataStores, or using GeoTools reprojection routines. + Used to reproject the ``Geometries`` provided by a ``DataStore`` from their original value (or + the one provided by ``Query.getCoordinateSystem``) into a different coordinate system. + The coordinate returned by the ``DataStore`` will be processed , either natively by + Advanced ``DataStore``\ s, or using GeoTools reprojection routines. - .. I suspect the following is no longer relevant (based on above) - .. .. note:: - .. Since this tutorial was written Query has expanding its capabilities - (and the capabilities of your DataStore) to include support for reprojection. - - It also offers an "open ended" pathway for expansion using "query hints". - - * Transaction + * ``Transaction`` Allows access the contents of a DataStore during modification. With all of that in mind we can now proceed to our - DataStore.getFeatureReader( featureType, filter, transaction ) example: + ``DataStore.getFeatureReader(featureType, filter, transaction)`` example: .. literalinclude:: /../src/main/java/org/geotools/tutorial/csv/CSVTest.java :language: java @@ -145,16 +138,16 @@ If you would like to follow along with these examples you can download :start-after: example4 start :end-before: example4 end -* DataStore.getFeatureSource( typeName ) +* ``DataStore.getFeatureSource(typeName)`` - This method is the gateway to the higher level interface as provided by an instance of FeatureSource, - FeatureStore or FeatureLocking. The returned instance represents the contents of a single - named FeatureType provided by the DataStore. The type of the returned instance indicates + This method is the gateway to the higher level interface as provided by an instance of ``FeatureSource``, + ``FeatureStore`` or ``FeatureLocking``. The returned instance represents the contents of a single + named ``FeatureType`` provided by the ``DataStore``. The type of the returned instance indicates the capabilities available. - This far in our tutorial CSVDataStore will only support an instance of FeatureSource. + This far in our tutorial ``CSVDataStore`` will only support an instance of ``FeatureSource``. - Example getFeatureSource: + Example ``getFeatureSource``: .. literalinclude:: /../src/main/java/org/geotools/tutorial/csv/CSVTest.java :language: java @@ -169,59 +162,59 @@ If you would like to follow along with these examples you can download :end-before: example5 end -FeatureSource -^^^^^^^^^^^^^ +``FeatureSource`` +^^^^^^^^^^^^^^^^^^ -FeatureSource provides the ability to query a DataStore and represents the contents of a single -FeatureType. In our example, the PropertiesDataStore represents a directory full of properties -files. FeatureSource will represent a single one of those files. +``FeatureSource`` provides the ability to query a ``DataStore`` and represents the contents of a single +``FeatureType``. In our example, the ``PropertiesDataStore`` represents a directory full of properties +files. ``FeatureSource`` will represent a single one of those files. -FeatureSource defines: +``FeatureSource`` defines: -* FeatureSource.getFeatures( query ) - request features specified by query -* FeatureSource.getFeatures( filter ) - request features based on constraints -* FeatureSource.getFeatures() - request all features -* FeatureSource.getSchema() - acquire FeatureType -* FeatureSource.getBounds() - return the bounding box of all features -* FeatureSource.getBounds( query ) - request bounding box of specified features -* FeatureSource.getCount( query ) - request number of features specified by query +* ``FeatureSource.getFeatures(query)`` - request features specified by query +* ``FeatureSource.getFeatures(filter)`` - request features based on constraints +* ``FeatureSource.getFeatures()`` - request all features +* ``FeatureSource.getSchema()`` - acquire ``FeatureType`` +* ``FeatureSource.getBounds()`` - return the bounding box of all features +* ``FeatureSource.getBounds(query)`` - request bounding box of specified features +* ``FeatureSource.getCount(query)`` - request number of features specified by query -FeatureSource also defines an event notification system and provides access to the DataStore -which created it. You may have more than one FeatureSource operating against a file at any time. +``FeatureSource`` also defines an event notification system and provides access to the ``DataStore`` +which created it. You may have more than one ``FeatureSource`` operating against a file at any time. -FeatureCollection -^^^^^^^^^^^^^^^^^ +``FeatureCollection`` +^^^^^^^^^^^^^^^^^^^^^ -.. sidebar:: FeatureResults +.. sidebar:: ``FeatureResults`` - FeatureResults is the original name of FeatureCollection. + ``FeatureResults`` is the original name of ``FeatureCollection``. Some of these methods have been replaced such as the use of - DataUtilities.collection( featureCollection ) to load + ``DataUtilities.collection(featureCollection)`` to load the contents into memory. It is interesting to note the design goal of capturing a prepared statement (rather than loading the features into memory). - The class was renamed FeatureCollection to help those migrating + The class was renamed ``FeatureCollection`` to help those migrating from GeoTools 1.0. -While the FeatureSource API does allow you to represent a named FeatureType, it still does not -allow direct access to a FeatureReader. The getFeatures methods actually return an instance of -FeatureCollection. +While the ``FeatureSource`` API does allow you to represent a named ``FeatureType``, it still does not +allow direct access to a ``FeatureReader``. The ``getFeatures`` methods actually return an instance of +``FeatureCollection``. -FeatureCollection defines: +``FeatureCollection`` defines: -* FeatureCollection.getSchmea() -* FeatureCollection.features() - access to a FeatureIterator -* FeatureCollection.accepts( visitor, progress ) -* FeatureCollection.getBounds() - bounding box of features -* FeatureCollection.getCount() - number of features -* DataUtilities.collection( featureCollection ) - used to load features into memory +* ``FeatureCollection.getSchmea()`` +* ``FeatureCollection.features()`` - access to a ``FeatureIterator`` +* ``FeatureCollection.accepts(visitor, progress)`` +* ``FeatureCollection.getBounds()`` - bounding box of features +* ``FeatureCollection.getCount()`` - number of features +* ``DataUtilities.collection(featureCollection)`` - used to load features into memory -FeatureCollection is the closest thing we have to a prepared request. Many DataStores are able to -provide optimised implementations that handles the above methods natively. +``FeatureCollection`` is the closest thing we have to a prepared request. Many ``DataStores`` are able to +provide optimized implementations that handles the above methods natively. -* FeatureCollection Example: +* ``FeatureCollection`` Example: .. literalinclude:: /../src/main/java/org/geotools/tutorial/csv/CSVTest.java :language: java @@ -241,14 +234,14 @@ provide optimised implementations that handles the above methods natively. You can think of this as: - * FeatureSource is a way to perform a quick check for a precanned answer for count and bounds. + * ``FeatureSource`` is a way to perform a quick check for a pre-canned answer for count and bounds. The Shapefile format will keep this information in the header at the top of the - file. In a similar fashion a Database may be able to quickly check an index for this information. - * FeatureCollection checks the contents, and possibly checks each item, for an answer to + file. In a similar fashion a database may be able to quickly check an index for this information. + * ``FeatureCollection`` checks the contents, and possibly checks each item, for an answer to size and bounds. - This is a terrible API tradeoff to have to make, resulting from implementations taking ten minutes to performing a "full table scan". + This is a terrible API trade-off to have to make, resulting from implementations taking ten minutes to performing a "full table scan". -Care should be taken when using the collection() method to capture the contents of a DataStore in +Care should be taken when using the ``collection()`` method to capture the contents of a DataStore in memory. GIS applications often produce large volumes of information and can place a strain on memory use. diff --git a/docs/user/tutorial/datastore/source.rst b/docs/user/tutorial/datastore/source.rst index bd8dc585a36..d177763367a 100644 --- a/docs/user/tutorial/datastore/source.rst +++ b/docs/user/tutorial/datastore/source.rst @@ -3,38 +3,38 @@ :Version: |release| :License: Creative Commons with attribution -Implementing FeatureSource --------------------------- +Implementing ``FeatureSource`` +------------------------------ Now with the setup out of the way we can get to work. -CSVDataStore -^^^^^^^^^^^^ +``CSVDataStore`` +^^^^^^^^^^^^^^^^ The first step is to create a basic DataStore that only supports feature extraction. We will read data from a CSV file into the GeoTools feature model. .. figure:: images/CSVDataStore.png - CSVDataStore + ``CSVDataStore`` -To implement a DataStore we will subclass ContentDataStore. This is a helpful base class for +To implement a ``DataStore`` we will subclass ``ContentDataStore``. This is a helpful base class for making new kinds of content available to GeoTools. The GeoTools library works with an interaction -model very similar to a database - with transactions and locks. ContentDataStore is going to handle +model very similar to a database - with transactions and locks. ``ContentDataStore`` is going to handle all of this for us - as long as we can teach it how to access our content. -ContentDataStore requires us to implement the following two methods: +``ContentDataStore`` requires us to implement the following two methods: -* createTypeNames() -* createFeatureSource(ContentEntry entry) +* ``createTypeNames()`` +* ``createFeatureSource(ContentEntry entry)`` -The class *ContentEntry* is a bit of a scratch pad used to keep track of things for each type. +The class ``ContentEntry`` is a bit of a scratch pad used to keep track of things for each type. Our initial implementation will result in a read-only datastore for accessing CSV content: -#. Set up a org.geotools.tutorial.csv package in :file:`src/main/java`. +#. Set up a ``org.geotools.tutorial.csv`` package in :file:`src/main/java`. -#. To begin create the file CSVDataStore extending ContentDataStore +#. To begin create the file ``CSVDataStore`` extending ``ContentDataStore`` .. literalinclude:: /../src/main/java/org/geotools/tutorial/csv/CSVDataStore.java :language: java @@ -56,9 +56,9 @@ Our initial implementation will result in a read-only datastore for accessing CS :end-before: // reader end -#. Listing TypeNames +#. Listing ``TypeNames`` - A DataStore may provide access to several different data products. The method **createTypeNames** provides a list of the information being published. + A ``DataStore`` may provide access to several different data products. The method ``createTypeNames`` provides a list of the information being published. After all that lead-in you will be disappointed to note that our list will be a single value - the name of the CSV file. @@ -67,47 +67,47 @@ Our initial implementation will result in a read-only datastore for accessing CS :start-after: // createTypeNames start :end-before: // createTypeNames end -#. Next we have the **createFeatureSource** method. +#. Next we have the ``createFeatureSource`` method. - This is used to create a **FeatureSource** which is used by client code to access content. There is no cache for **FeatureSource** instances as they are managed directly by client code. Don't worry that is not as terrible as it sounds, we do track all the information and resources made available to a **FeatureSource** in a **ContentEntry** data structure. You can think of the **FeatureSource** instances sent out into the wild as light weight wrappers around **ContentEntry**. + This is used to create a ``FeatureSource`` which is used by client code to access content. There is no cache for ``FeatureSource`` instances as they are managed directly by client code. Don't worry that is not as terrible as it sounds, we do track all the information and resources made available to a ``FeatureSource`` in a ``ContentEntry`` data structure. You can think of the ``FeatureSource`` instances sent out into the wild as light weight wrappers around ``ContentEntry``. - It is worth talking a little bit about **ContentEntry** which is passed into this method as a parameter. **ContentEntry** is used as a scratchpad holding all recorded information about the content we are working with. + It is worth talking a little bit about ``ContentEntry`` which is passed into this method as a parameter. ``ContentEntry`` is used as a scratchpad holding all recorded information about the content we are working with. .. figure:: images/ContentEntry.png ContentEntry - **ContentEntry** also contains a back pointer to the **ContentDataStore** in case your implementation of **FeatureSource** needs to phone home. + ``ContentEntry`` also contains a back pointer to the ``ContentDataStore`` in case your implementation of ``FeatureSource`` needs to phone home. -#. Implement createFeatureSource. Technically the **ContentEntry** is provided as "parameter object" holding the type name requested by the user, and any other context known to the DataStore. +#. Implement ``createFeatureSource``. Technically the ``ContentEntry`` is provided as "parameter object" holding the type name requested by the user, and any other context known to the DataStore. .. literalinclude:: /../src/main/java/org/geotools/tutorial/csv/CSVDataStore.java :language: java :start-after: // createFeatureSource start :end-before: // createFeatureSource end -CSVFeatureSource -^^^^^^^^^^^^^^^^ +``CSVFeatureSource`` +^^^^^^^^^^^^^^^^^^^^^ -Next we can create the **CSVFeatureSource** mentioned above. This class is responsible for providing access to the contents of our CSVDataStore. +Next we can create the ``CSVFeatureSource`` mentioned above. This class is responsible for providing access to the contents of our ``CSVDataStore``. -.. note:: The distinction between DataStore and FeatureSource can be difficult to demonstrate as our example consists of a single file. If it helps DataStore is an object representing the file, service or database. FeatureSource meanwhile represents the contents, data product, or table being published. +.. note:: The distinction between ``DataStore`` and ``FeatureSource`` can be difficult to demonstrate as our example consists of a single file. If it helps ``DataStore`` is an object representing the file, service or database. ``FeatureSource`` meanwhile represents the contents, data product, or table being published. -#. Create the file CSVFeatureSource. +#. Create the file ``CSVFeatureSource``. .. literalinclude:: /../src/main/java/org/geotools/tutorial/csv/CSVFeatureSource.java :language: java :start-after: // header :end-before: // getDataStore start -#. To assist others we can type narrow our **getDataStore()** method to explicitly to return a **CSVDataStore**. In addition to being accurate, this prevents a lot of casts resulting in more readable code. +#. To assist others we can type narrow our ``getDataStore()`` method to explicitly to return a ``CSVDataStore``. In addition to being accurate, this prevents a lot of casts resulting in more readable code. .. literalinclude:: /../src/main/java/org/geotools/tutorial/csv/CSVFeatureSource.java :language: java :start-after: // getDataStore start :end-before: // getDataStore end -#. The method **getReaderInternal( Query )** used to provide streaming access to out data - reading one feature at a time. The **CSVFeatureReader** returned is similar to an iterator, and is implemented in the next section. +#. The method ``getReaderInternal(Query)`` used to provide streaming access to out data - reading one feature at a time. The ``CSVFeatureReader`` returned is similar to an iterator, and is implemented in the next section. .. literalinclude:: /../src/main/java/org/geotools/tutorial/csv/CSVFeatureSource.java :language: java @@ -116,20 +116,20 @@ Next we can create the **CSVFeatureSource** mentioned above. This class is respo .. note:: The DataStore interface provides a wide range of functionality for client code access feature content. - Here at the implementation level we provide a single implementation of **getReaderInternal**. This method is used by the superclass **ContentFeatureSource** to access our content. All the additional functionality from filtering to transaction independence is implemented using a combination of wrappers and post-processing. + Here at the implementation level we provide a single implementation of ``getReaderInternal``. This method is used by the super class ``ContentFeatureSource`` to access our content. All the additional functionality from filtering to transaction independence is implemented using a combination of wrappers and post-processing. -#. ContentFeatureSource supports two common optimisations out of the box. +#. ``ContentFeatureSource`` supports two common optimizations out of the box. - You are required to implement the abstract method **getCountInternal( Query )** using any tips or tricks available to return a count of available features. If there is no quick way to generate this information returning ``-1`` indicates that they Query must be handled feature by feature. + You are required to implement the abstract method ``getCountInternal(Query)`` using any tips or tricks available to return a count of available features. If there is no quick way to generate this information returning ``-1`` indicates that they Query must be handled feature by feature. - For CSV files we can check to see if the Query includes all features - in which case we can skip over the header and quickly count the number of lines in our file. This is much faster than reading and parsing each feature one at a time. + For CSV files we can check to see if the ``Query`` includes all features - in which case we can skip over the header and quickly count the number of lines in our file. This is much faster than reading and parsing each feature one at a time. .. literalinclude:: /../src/main/java/org/geotools/tutorial/csv/CSVFeatureSource.java :language: java :start-after: // count start :end-before: // count end -#. The second optimisation requires an implementation of **getBoundsInternal(Query)** making use of any spatial index, or header, record the data bounds. This value is used when rendering to determine the clipping area. +#. The second optimization requires an implementation of ``getBoundsInternal(Query)`` making use of any spatial index, or header, record the data bounds. This value is used when rendering to determine the clipping area. .. literalinclude:: /../src/main/java/org/geotools/tutorial/csv/CSVFeatureSource.java :language: java @@ -140,101 +140,101 @@ Next we can create the **CSVFeatureSource** mentioned above. This class is respo In database terms the schema for a table is defined by the columns and the order they are declared in. - The FeatureType generated here is based on the CSV Header, along with a few educated guesses to recognise LAT and LON columns as comprising a single Location. + The ``FeatureType`` generated here is based on the CSV Header, along with a few educated guesses to recognize ``LAT`` and ``LON`` columns as comprising a single Location. .. literalinclude:: /../src/main/java/org/geotools/tutorial/csv/CSVFeatureSource.java :language: java :start-after: // schema start :end-before: // schema end -CSVFeatureReader -^^^^^^^^^^^^^^^^ +``CSVFeatureReader`` +^^^^^^^^^^^^^^^^^^^^^ -FeatureReader is similar to the Java Iterator construct, with the addition of -FeatureType (and IOExceptions). +``FeatureReader`` is similar to the Java ``Iterator`` construct, with the addition of +``FeatureType`` (and ``IOExceptions``). .. figure:: images/CSVFeatureReader.png CSVFeatureReader and Support Classes -The class **ContentState** is available to store any state required. Out of the box **ContentState** provides a cache of FeatureType, count and bounds. You are encouraged to create your own subclass of **ContentState** to track additional state - examples include security credentials or a database connection. +The class ``ContentState`` is available to store any state required. Out of the box ``ContentState`` provides a cache of ``FeatureType``, count and bounds. You are encouraged to create your own subclass of ``ContentState`` to track additional state - examples include security credentials or a database connection. -.. note:: Subclassing ContentState is a key improvement made for ContentDataStore. In our earlier base class we noticed many developers creating HashMaps to cache individual results in an effort to improve performance. Inevitability there would be difficulty keeping these caches in sync. Breaking out an object to handle the state required for data access is vast improvement. +.. note:: Sub-classing ``ContentState`` is a key improvement made for ``ContentDataStore``. In our earlier base class we noticed many developers creating ``HashMaps`` to cache individual results in an effort to improve performance. Inevitability there would be difficulty keeping these caches in sync. Breaking out an object to handle the state required for data access is vast improvement. -FeatureReader interface: +``FeatureReader`` interface: -* FeatureReader.getFeatureType() -* FeatureReader.next() -* FeatureReader.hasNext() -* FeatureReader.close() +* ``FeatureReader.getFeatureType()`` +* ``FeatureReader.next()`` +* ``FeatureReader.hasNext()`` +* ``FeatureReader.close()`` -To implement our FeatureReader, we will need to do several things: open a File and read through it -line by line, parsing Features as we go. Because this class actually does some work, we are going to include a few more comments in the code to keep our heads on straight. +To implement our ``FeatureReader``, we will need to do several things: open a ``File`` and read through it +line by line, parsing ``Features`` as we go. Because this class actually does some work, we are going to include a few more comments in the code to keep our heads on straight. -1. Create the class **CSVFeatureReader** as follows: +1. Create the class ``CSVFeatureReader`` as follows: .. literalinclude:: /../src/main/java/org/geotools/tutorial/csv/CSVFeatureReader.java :language: java :end-before: // class definition end :append: } -2. Implement the iterator next() and hasNext() methods using a field to hold the value to return next. +2. Implement the iterator ``next()`` and ``hasNext()`` methods using a field to hold the value to return next. .. literalinclude:: /../src/main/java/org/geotools/tutorial/csv/CSVFeatureReader.java :language: java :start-after: // read start :end-before: // read end - .. note:: The next() and hasNext() methods are allowed to throw IOExceptions making these methods easy to implement. Most client code will use this implementation behind a **FeatureIterator** wrapper that converts any problems to a RuntimeException. A classic easy of implementation vs easy of use tradeoff. + .. note:: The ``next()`` and ``hasNext()`` methods are allowed to throw ``IOExceptions`` making these methods easy to implement. Most client code will use this implementation behind a ``FeatureIterator`` wrapper that converts any problems to a ``RuntimeException``. A classic ease of implementation vs ease of use trade-off. -3. Using the **CSVReader** library to parse the content saves a lot of work - and lets us focus on building features. The utility class **FeatureBuilder** gathers up state, employing a **FeatureFactory** on your behalf to construct each feature. +3. Using the ``CSVReader`` library to parse the content saves a lot of work - and lets us focus on building features. The utility class ``FeatureBuilder`` gathers up state, employing a ``FeatureFactory`` on your behalf to construct each feature. .. literalinclude:: /../src/main/java/org/geotools/tutorial/csv/CSVFeatureReader.java :language: java :start-after: // parse start :end-before: // parse end - .. note:: A key API contact is the construction of a unique **FeatureID** for each feature in the system. Our convention has been to prefix the typename ahead of any native identifier (in this case row number). Each **FeatureID** being unique is a consequence of following the OGC Feature Model used for Web Feature Server. These identifiers created here are employed in the generation of XML documents and need to follow the restrictions on XML identifiers. + .. note:: A key API contact is the construction of a unique ``FeatureID`` for each feature in the system. Our convention has been to prefix the ``typeName`` ahead of any native identifier (in this case row number). Each ``FeatureID`` being unique is a consequence of following the OGC Feature Model used for Web Feature Server. These identifiers created here are employed in the generation of XML documents and need to follow the restrictions on XML identifiers. -4. Finally we can **close()** the CSVFeatureReader when no longer used. Returning any system resources (in this case an open file handle). +4. Finally we can ``close()`` the ``CSVFeatureReader`` when no longer used. Returning any system resources (in this case an open file handle). .. literalinclude:: /../src/main/java/org/geotools/tutorial/csv/CSVFeatureReader.java :language: java :start-after: // close start :end-before: // close end - .. note:: The FeatureState is not closed or disposed - as several threads may be making concurrent use of the **CSVDataStore**. + .. note:: The ``FeatureState`` is not closed or disposed - as several threads may be making concurrent use of the ``CSVDataStore``. -CSVDataStoreFactory -^^^^^^^^^^^^^^^^^^^ +``CSVDataStoreFactory`` +^^^^^^^^^^^^^^^^^^^^^^^ Now that we have implemented accessing and reading content what could possibly be left? This is GeoTools so we need to wire in our new creation to the Factory Service Provider (SPI) plug-in system so that application can smoothly integrate our new creation. -To make your DataStore truly independent and pluggable, you must create a class implementing the -**DataStoreFactorySPI** interface. +To make your ``DataStore`` truly independent and pluggable, you must create a class implementing the +``DataStoreFactorySPI`` interface. -This allows the Service Provider Interface mechanism to dynamically plug in your new DataStore with -no implementation knowledge. Code that uses the DataStoreFinder can just add the new DataStore to +This allows the Service Provider Interface mechanism to dynamically plug in your new ``DataStore`` with +no implementation knowledge. Code that uses the ``DataStoreFinder`` can just add the new ``DataStore`` to the classpath and it will work! -The DataStoreFactorySpi provides information on the Parameters required for construction. -DataStoreFactoryFinder provides the ability to create DataStores representing existing +The ``DataStoreFactorySpi`` provides information on the ``Parameters`` required for construction. +``DataStoreFactoryFinder`` provides the ability to create ``DataStores`` representing existing information and the ability to create new physical storage. -1. Implementing DataStoreFactorySPI: +1. Implementing ``DataStoreFactorySPI``: * The "no argument" constructor is required as it will be used by the Factory Service Provider (SPI) plug-in system. - * getImplementationHints() is used to report on any "Hints" used for configuration - by our factory. As an example our Factory could allow people to specify a specific - FeatureFactory to use when creating a feature for each line. + * ``getImplementationHints()`` is used to report on any "Hints" used for configuration + by our factory. As an example our factory could allow people to specify a specific + ``FeatureFactory`` to use when creating a feature for each line. - Create CSVDataStoreFactory as follows: + Create ``CSVDataStoreFactory`` as follows: .. literalinclude:: /../src/main/java/org/geotools/tutorial/csv/CSVDataStoreFactory.java :language: java @@ -242,20 +242,20 @@ information and the ability to create new physical storage. 2. We have a couple of methods to describe the DataStore. - This *isAvailable* method is interesting in that it can become a performance bottleneck if not implemented efficiently. DataStoreFactorySPI factories are *all* called when a user attempts to connect, only the factories marked as *available* are shortlisted for further interaction. + This ``isAvailable`` method is interesting in that it can become a performance bottleneck if not implemented efficiently. ``DataStoreFactorySPI`` factories are *all* called when a user attempts to connect, only the factories marked as *available* are shortlisted for further interaction. .. literalinclude:: /../src/main/java/org/geotools/tutorial/csv/CSVDataStoreFactory.java :language: java :start-after: // metadata start :end-before: // metadata end -3. The user is expected to supply a Map of connection parameters when creating a datastore. +3. The user is expected to supply a ``Map`` of connection parameters when creating a datastore. - The allowable connection parameters are described using *Param[]*. Each *Param* describes a *key* used to store the value in the map, and the expected Java type for the value. Additional fields indicate if the value is required and if a default value is available. + The allowable connection parameters are described using ``Param[]``. Each ``Param`` describes a ``key`` used to store the value in the map, and the expected Java type for the value. Additional fields indicate if the value is required and if a default value is available. This array of parameters form an API contract used to drive the creation of user interfaces. - The API contract is open ended (we cannot hope to guess all the options needed in the future). The helper class **KVP** provides an easy to use implementation of **Map**. The keys used here are formally defined as static constants - complete with javadoc describing their use. If several authors agree on a new hint it will be added to these static constants. + The API contract is open ended (we cannot hope to guess all the options needed in the future). The helper class ``KVP`` provides an easy to use implementation of ``Map``. The keys used here are formally defined as static constants - complete with javadoc describing their use. If several authors agree on a new hint it will be added to these static constants. .. literalinclude:: /../src/main/java/org/geotools/tutorial/csv/CSVDataStoreFactory.java :language: java @@ -264,7 +264,7 @@ information and the ability to create new physical storage. .. note:: Does anything really use this? - The **gt-swing** module is able to construct a user interface based on these **Param** + The ``gt-swing`` module is able to construct a user interface based on these ``Param`` descriptions. The uDig and GeoServer projects have similar auto-generated screens. .. figure:: /tutorial/filter/images/shapeWizard1.png @@ -283,34 +283,34 @@ information and the ability to create new physical storage. :start-after: // canProcess start :end-before: // canProcess end -5. Armed with a map of connection parameters we can now create a Datastore for an **existing** csv file. +5. Armed with a map of connection parameters we can now create a ``Datastore`` for an **existing** CSV file. - Here is the code that finally calls our CSVDataStore constructor: + Here is the code that finally calls our ``CSVDataStore`` constructor: .. literalinclude:: /../src/main/java/org/geotools/tutorial/csv/CSVDataStoreFactory.java :language: java :start-after: // createDataStore start :end-before: // createDataStore end -6. How about creating a DataStore for a **new** csv file? +6. How about creating a DataStore for a **new** CSV file? - Since initially our DataStore is read-only we will just throw an UnsupportedOperationException at this time. + Since initially our ``DataStore`` is read-only we will just throw an ``UnsupportedOperationException`` at this time. .. literalinclude:: /../src/main/java/org/geotools/tutorial/csv/CSVDataStoreFactory.java :language: java :start-after: // createNewDataStore start :end-before: // createNewDataStore end -6. The Factory Service Provider (SPI) system operates by looking at the META-INF/services - folder and checking for implementations of DataStoreFactorySpi +6. The Factory Service Provider (SPI) system operates by looking at the `META-INF/services` + folder and checking for implementations of ``DataStoreFactorySpi`` - To "register" our CSVDataStoreFactory please create the following in `src/main/resources/`: + To "register" our ``CSVDataStoreFactory`` please create the following in `src/main/resources/`: - * META-INF/services/org.geotools.data.DataStoreFactorySpi + * ``META-INF/services/org.geotools.data.DataStoreFactorySpi`` - This file requires the filename of the factory that implements the DataStoreSpi interface. + This file requires the file name of the factory that implements the ``DataStoreSpi`` interface. - Fill in the following content for your **org.geotools.data.DataStoreFactorySpi** file:: + Fill in the following content for your ``org.geotools.data.DataStoreFactorySpi`` file:: org.geotools.tutorial.csv.CSVDataStoreFactory diff --git a/docs/user/tutorial/datastore/store.rst b/docs/user/tutorial/datastore/store.rst index 41f35449be9..05d333dc098 100644 --- a/docs/user/tutorial/datastore/store.rst +++ b/docs/user/tutorial/datastore/store.rst @@ -3,34 +3,34 @@ :Version: |release| :License: Creative Commons with attribution -Implementing FeatureStore -------------------------- +Implementing ``FeatureStore`` +------------------------------ -In this part we will complete the CSVDataStore. At the end of this section we -will have a full functional CSVDataStore supporting both read and write operations. +In this part we will complete the ``CSVDataStore``. At the end of this section we +will have a full functional ``CSVDataStore`` supporting both read and write operations. .. figure:: images/CSVDataStoreWrite.png - CSVDataStore Read-Write + ``CSVDataStore`` Read-Write -The DataStore API provides three categories of public methods involved in making content writeable. +The ``DataStore`` API provides three categories of public methods involved in making content writable. -* DataStore.createSchema( featureType ) - sets up a new entry for content of the provided type -* DataStore.getFeatureWriter( typeName ) - a low-level iterator that allows writing -* DataStore.getFeatureSource( typeName ) - read-only FeatureSource or FeatureStore for read-write +* ``DataStore.createSchema(featureType)`` - sets up a new entry for content of the provided type +* ``DataStore.getFeatureWriter(typeName)`` - a low-level iterator that allows writing +* ``DataStore.getFeatureSource(typeName)`` - read-only ``FeatureSource`` or ``FeatureStore`` for read-write The infrastructure to support this functionality is quite extensive. A few highlights from the above diagram: -* ContentState.listeners - event notification for changed content -* ContentState.tx - transaction object used by clients to stash session callbacks -* ContentState.transactionState: provides transaction independence between threads working on the same content. +* ``ContentState.listeners`` - event notification for changed content +* ``ContentState.tx`` - transaction object used by clients to stash session callbacks +* ``ContentState.transactionState:`` provides transaction independence between threads working on the same content. -CSVDataStoreFactory -^^^^^^^^^^^^^^^^^^^ +``CSVDataStoreFactory`` +^^^^^^^^^^^^^^^^^^^^^^^ -Now that we are going to be writing files we can fill in the createNewDataStore method. +Now that we are going to be writing files we can fill in the ``createNewDataStore`` method. -1. Open up CSVDataStoreFactory and fill in the method **createNewDataStore( Map params )** which we skipped over earlier. +1. Open up ``CSVDataStoreFactory`` and fill in the method ``createNewDataStore(Map params)`` which we skipped over earlier. .. literalinclude:: /../src/main/java/org/geotools/tutorial/csv2/CSVDataStoreFactory.java :language: java @@ -38,68 +38,68 @@ Now that we are going to be writing files we can fill in the createNewDataStore :end-before: // createNewDataStore end :prepend: private static final Logger LOGGER = Logging.getLogger("org.geotools.data.csv"); -2. The above code snippet introduces a GeoTools Logger we can use for warnings. +2. The above code snippet introduces a GeoTools ``Logger`` we can use for warnings. Because GeoTools is a well mannered library it can be configured to use different logging engines. This allows it to integrate smoothly with larger projects. #. To see this change in context review :download:`CSVDataStoreFactory.java ` - from the **gt-csv** plugin. + from the ``gt-csv`` plugin. -There is no DataStoreFinder method for creating new content. We expect this method to be called -from a content creation wizard that already is making use of the DataStoreFactory. +There is no ``DataStoreFinder`` method for creating new content. We expect this method to be called +from a content creation wizard that already is making use of the ``DataStoreFactory``. -CSVDataStore -^^^^^^^^^^^^ +``CSVDataStore`` +^^^^^^^^^^^^^^^^^ -Returning to CSVDataStore we have a number of new methods to override to support write +Returning to ``CSVDataStore`` we have a number of new methods to override to support write functionality. -1. Introduce the createSchema( featureType ) method used to set up a new file. +1. Introduce the ``createSchema(featureType)`` method used to set up a new file. Our CSV format has several limitations: - * Representing Points, using LAT and LON columns - * Attributes are assumed to be Strings (this is a text format after all) - * CoordinateReferenceSystem is limited to WGS84 + * Representing ``Points``, using ``LAT`` and ``LON`` columns + * Attributes are assumed to be ``Strings`` (this is a text format after all) + * ``CoordinateReferenceSystem`` is limited to WGS84 - Add createSchema( featureType ): + Add ``createSchema(featureType)``: .. literalinclude:: /../src/main/java/org/geotools/tutorial/csv2/CSVDataStore.java :language: java :start-after: // createSchema start :end-before: // createSchema end -2. And revise our implementation of **createFeatureSource( ContentEntry )**. +2. And revise our implementation of ``createFeatureSource(ContentEntry)``. - While we will still return a **FeatureSource**, we have the option of returning the subclass - **FeatureStore** for read-write files. + While we will still return a ``FeatureSource``, we have the option of returning the subclass + ``FeatureStore`` for read-write files. - The **FeatureStore** interface provides additional methods allowing the modification of content. + The ``FeatureStore`` interface provides additional methods allowing the modification of content. .. literalinclude:: /../src/main/java/org/geotools/tutorial/csv2/CSVDataStore.java :language: java :start-after: // createFeatureSource start :end-before: // createFeatureSource end -#. If you would like to review the **gt-csv** plugin has the completed :download:`CSVDataStore.java ` +#. If you would like to review the ``gt-csv`` plugin has the completed :download:`CSVDataStore.java ` file. -CSVFeatureStore -^^^^^^^^^^^^^^^ +``CSVFeatureStore`` +^^^^^^^^^^^^^^^^^^^ -CSVFFeatureStore has an interesting design constraint: +``CSVFFeatureStore`` has an interesting design constraint: -* It implements FeatureStore, which extends FeatureSource -* It extends the base class ContentFeatureStore, which handles most of the heavy lifting +* It implements ``FeatureStore``, which extends ``FeatureSource`` +* It extends the base class ``ContentFeatureStore``, which handles most of the heavy lifting So what is the trouble? Java only allows single inheritance - forcing us to account for all the -work we did reading features in CSVFeatureSource. +work we did reading features in ``CSVFeatureSource``. -Many first generation DataStore implementations practised cut and paste coding, meaning fixes would +Many first generation DataStore implementations practiced cut and paste coding, meaning fixes would often get applied in one spot and not another making for a frustrating debugging experience. -Instead we are going to use a **delegate** CSVFeatureSource, hidden from public +Instead we are going to use a **delegate** ``CSVFeatureSource``, hidden from public view, simply to call its methods for reading. This prevents code duplication, making the code easier to maintain, at the cost of some up front complexity. @@ -107,10 +107,10 @@ making the code easier to maintain, at the cost of some up front complexity. CSVFeatureStore -We have to play a few tickets to ensure both the CSVFeatureStore and its hidden CSVFeatureSource +We have to play a few tickets to ensure both the ``CSVFeatureStore`` and its hidden ``CSVFeatureSource`` are always on the same transaction, but other than that this approach is working well. - #. Create **CSVFeatureStore**: + #. Create ``CSVFeatureStore``: .. literalinclude:: /../src/main/java/org/geotools/tutorial/csv2/CSVFeatureStore.java :language: java @@ -118,8 +118,7 @@ are always on the same transaction, but other than that this approach is working :end-before: // header end :prepend: package org.geotools.tutorial.csv; - #. Our first responsibility is to implement a CSVFeatureWriter for internal use. Transaction and Event - Notification are handled by wrappers applied to our CSVFeatureWriter. + #. Our first responsibility is to implement a ``CSVFeatureWriter`` for internal use. ``Transaction`` and Event Notification are handled by wrappers applied to our ``CSVFeatureWriter``. .. literalinclude:: /../src/main/java/org/geotools/tutorial/csv2/CSVFeatureStore.java :language: java @@ -127,69 +126,62 @@ are always on the same transaction, but other than that this approach is working :end-before: // getWriter end .. note:: + In general the "Gang of Four" decorator pattern is used to layer functionality around the raw ``FeatureReader`` and ``FeatureWriters`` you provided. This is very similar to the design of the ``java-io`` library (where a BufferedInputStream can be wrapped around a raw FileInputStream). + You can control which decorators/wrappers are applied, by as shown in the following table. - In general the "Gang of Four" decorator pattern is used to layer functionality around the - raw **FeatureReader** and **FeatureWriters** you provided. This is very similar to the design - of the **java-io** library (where a BufferedInputStream can be wrapped around a raw - FileInputStream). - - You can control which decorators/wrappers are applied, by as shown in the following table. - - ==================== =============== - Handle Override - ==================== =============== - reprojection canReproject() - filtering canFilter() - max feature limiting canLimit() - sorting canSort() - locking canLock() - ==================== =============== + ==================== =================== + Handle Override + ==================== =================== + reprojection ``canReproject()`` + filtering ``canFilter()`` + max feature limiting ``canLimit()`` + sorting ``canSort()`` + locking ``canLock()`` + ==================== =================== - As an example if your data format supported an attribute index you would be - in position to override canSort() to return true if an index was available - for sorting. + As an example if your data format supported an attribute index you would be in position to override ``canSort()`` to return true if an index was available for sorting. - #. Next we can set up our delegate, taking care to ensure both use the same Transaction. + #. Next we can set up our delegate, taking care to ensure both use the same ``Transaction``. .. literalinclude:: /../src/main/java/org/geotools/tutorial/csv2/CSVFeatureStore.java :language: java :start-after: // transaction start :end-before: // transaction end - #. Use the delegate to implement the internal ContentDataStore methods. In Eclipse you can use Source->Generate Delegate Methods to speed this up. + #. Use the delegate to implement the internal ``ContentDataStore`` methods. In Eclipse you can use :menuselection:`Source > Generate Delegate Methods` to speed this up. .. literalinclude:: /../src/main/java/org/geotools/tutorial/csv2/CSVFeatureStore.java :language: java :start-after: // internal start :end-before: // internal end - #. We have to do one "fix" to allow handle visitor method to be called - add the following to **CSVFeatureSource**. + #. We have to do one "fix" to allow handle visitor method to be called - add the following to ``CSVFeatureSource``. .. literalinclude:: /../src/main/java/org/geotools/tutorial/csv2/CSVFeatureSource.java :language: java :start-after: // visitor start :end-before: // visitor end - .. warning:: Double check you are adding the above to CSVFeature **Source**. + .. warning:: Double check you are adding the above to **CSVFeatureSource**. .. note:: Why does this work - because Java visibility rules are insane. Even though the method is marked *protected* it now has *package* - visibility can be called by its peer CSVFeatureStore. + visibility can be called by its peer ``CSVFeatureStore``. - #. Use the delegate to implement the public FeatureSource methods. + #. Use the delegate to implement the public ``FeatureSource`` methods. .. literalinclude:: /../src/main/java/org/geotools/tutorial/csv2/CSVFeatureStore.java :language: java :start-after: // public start :end-before: // public end - #. You can see what this looks like in context by reviewing the :download:`CSVFeatureStore.java ` from the **gt-csv** plugin. + #. You can see what this looks like in context by reviewing the :download:`CSVFeatureStore.java ` from the ``gt-csv`` plugin. -CSVFeatureWriter -^^^^^^^^^^^^^^^^ +``CSVFeatureWriter`` +^^^^^^^^^^^^^^^^^^^^^ This class uses an interesting trick to simulate updating a file in place, while still supporting streaming operation. We will be outputting content to a temporary file, leaving the original for @@ -197,33 +189,33 @@ concurrent processes such as rendering. When streaming is closed the temporary f .. figure:: images/CSVFeatureWriter.png - CSVFeatureWriter + ``CSVFeatureWriter`` -To avoid duplicating all the work we put into **CSVFeatureReader** this code uses the same delegate +To avoid duplicating all the work we put into ``CSVFeatureReader`` this code uses the same delegate trick encountered earlier. A couple common questions: -* Q: How do you make a Transaction out of our simple reader? +* Q: How do you make a ``Transaction`` out of our simple reader? - ContentFeatureSource uses wrappers (or delegates) to process the data on the fly as it is read off disk. Wrappers can do all kinds of work, from cutting off reading when "max feature limit" is hit, or in the case of transactions modifying the content as it is read to match any edits that have been made. + ``ContentFeatureSource`` uses wrappers (or delegates) to process the data on the fly as it is read off disk. Wrappers can do all kinds of work, from cutting off reading when "max feature limit" is hit, or in the case of transactions modifying the content as it is read to match any edits that have been made. * Q: How do you know what wrappers to use? - ContentFeatureSource checks to see if a wrapper is needed. + ``ContentFeatureSource`` checks to see if a wrapper is needed. - For example a query with a "max feature limit" is implemented using the MaxFeatureReader wrapper. + For example a query with a "max feature limit" is implemented using the ``MaxFeatureReader`` wrapper. .. code-block:: java // max feature limit - if ( !canLimit() ) { - if (query.getMaxFeatures() != -1 && query.getMaxFeatures() < Integer.MAX_VALUE ) { + if (!canLimit()) { + if (query.getMaxFeatures() != -1 && query.getMaxFeatures() < Integer.MAX_VALUE) { reader = new MaxFeatureReader(reader, query.getMaxFeatures()); } } - MaxFeatureWrapper counts the features that are returned, and returns hasNext() false + ``MaxFeatureWrapper`` counts the features that are returned, and returns ``hasNext()`` false once the configured limit has been reached: .. code-block:: java @@ -234,8 +226,8 @@ A couple common questions: * Q: How does that work with transactions? - ContentState manages a DiffTransactionState used to capture each modification. Each change is - recorded by FeatureId (a feature recorded for each add or modification, or null + ``ContentState`` manages a ``DiffTransactionState`` used to capture each modification. Each change is + recorded by ``FeatureId`` (a feature recorded for each add or modification, or null for a delete). .. figure:: images/Transaction.png @@ -246,43 +238,40 @@ A couple common questions: and dynamically modifies the content to match any outstanding edits. When it reaches the end of your file, it keeps going listing any features that were added. -* Q: That is fine for transaction independence, what if two FeatureSources are using the - same Transaction? +* Q: That is fine for transaction independence, what if two ``FeatureSources`` are using the same ``Transaction``? - Those two FeatureSources would be configured with the same ContentState, and thus have the same - view of the world. + Those two ``FeatureSources`` would be configured with the same ``ContentState``, and thus have the same view of the world. - The ContentDataStore API is divided into two levels: + The ``ContentDataStore`` API is divided into two levels: - * Public classes focused on ease of use for client code - examples include DataStore, - FeatureSource, Transaction. + * Public classes focused on ease of use for client code - examples include ``DataStore``, + ``FeatureSource``, Transaction. .. image:: images/public.png - * Private classes focused on ease of development for DataStore developers - examples include - ContentEntry, ContentEntry, BatchFeatureEvent + * Private classes focused on ease of development for ``DataStore`` developers - examples include + ``ContentEntry``, ``ContentEntry``, ``BatchFeatureEvent`` .. image:: images/Internal.png .. note:: - Our first generation DataStore implementations tried to produce a similar effect using a - series of HashMaps, with suitably scary consequences for code readability. If any additional - information is required by your DataStore implementation you are actively encouraged to - subclass ContentState. + Our first generation ``DataStore`` implementations tried to produce a similar effect using a + series of ``HashMaps``, with suitably scary consequences for code readability. If any additional + information is required by your ``DataStore`` implementation you are actively encouraged to + subclass ``ContentState``. -* Q: Wait what about when I am not using a Transaction? How do I get a ContentState? +* Q: Wait what about when I am not using a ``Transaction``? How do I get a ``ContentState``? - When the use has not specified a Transaction we default to the use of Transaction.AUTO_COMMIT. + When the use has not specified a ``Transaction`` we default to the use of ``Transaction.AUTO_COMMIT``. - This makes the ContentState recorded for Transaction.AUTO_COMMIT special in that it represents - the point of truth on the files current status. The bounds recorded for Transaction.AUTO_COMMIT - are the bounds of the file. The number of features recorded for Transaction.AUTO_COMMIT are the + This makes the ``ContentState`` recorded for ``Transaction.AUTO_COMMIT`` special in that it represents + the point of truth on the files current status. The bounds recorded for ``Transaction.AUTO_COMMIT`` are the bounds of the file. The number of features recorded for ``Transaction.AUTO_COMMIT`` are the number of features recorded in the file. -Now that we have some idea of what is riding on top, lets implement our CSVFeatureWriter: +Now that we have some idea of what is riding on top, lets implement our ``CSVFeatureWriter``: -#. Create the file CSVFeatureWriter.java: +#. Create the file ``CSVFeatureWriter.java``: .. literalinclude:: /../src/main/java/org/geotools/tutorial/csv2/CSVFeatureWriter.java :language: java @@ -294,11 +283,11 @@ Now that we have some idea of what is riding on top, lets implement our CSVFeatu #. Our construct is responsible for a lot of activities: * Setting up a temporary file for output - * Creating a CsvWriter for output + * Creating a ``CsvWriter`` for output * Quickly making a copy of the file if we are just interested in appending * Starting the file off with a copy of the headers * Creating a delegate to read the original file - * Check if the columns are lat,lon or lon,lat for when we write them out. + * Check if the columns are ``lat,lon`` or ``lon,lat`` for when we write them out. Putting all that together: @@ -307,14 +296,14 @@ Now that we have some idea of what is riding on top, lets implement our CSVFeatu :start-after: // constructor start :end-before: // constructor end -#. Add FeatureWriter.getFeatureType() implementation: +#. Add ``FeatureWriter.getFeatureType()`` implementation: .. literalinclude:: /../src/main/java/org/geotools/tutorial/csv2/CSVFeatureWriter.java :language: java :start-after: // featureType start :end-before: // featureType end -#. Add hasNext() implementation, making use of delegate before switching over to +#. Add ``hasNext()`` implementation, making use of delegate before switching over to returning false when appending. .. literalinclude:: /../src/main/java/org/geotools/tutorial/csv2/CSVFeatureWriter.java @@ -322,14 +311,14 @@ Now that we have some idea of what is riding on top, lets implement our CSVFeatu :start-after: // hasNext start :end-before: // hasNext end -#. The *next()* method is used for two purposes: +#. The ``next()`` method is used for two purposes: - * To access Features for modification or removal (when working through existing content) - * To create new Features (when working past the end of the file) + * To access ``Features`` for modification or removal (when working through existing content) + * To create new ``Features`` (when working past the end of the file) - The *next()* implementation has a couple of interesting tricks: + The ``next()`` implementation has a couple of interesting tricks: - * Care is taken to write out the currentFeature if required + * Care is taken to write out the ``currentFeature`` if required * The next feature is fetched from the delegate; or * when appending a new feature is created for the user to fill in with attributes @@ -345,18 +334,18 @@ Now that we have some idea of what is riding on top, lets implement our CSVFeatu There are a large number of utility classes to perform common functions, take a look around before building something yourself. - * DataUtilities: Mix of methods helping developers use DataStore, with a few methods to help - implementors perform common tasks. Acts as Facade for a wide range of services - * SimpleFeatureBuilder: used to ease interaction with FeatureFactory + * ``DataUtilities``: Mix of methods helping developers use DataStore, with a few methods to help + implementers perform common tasks. Acts as Facade for a wide range of services + * ``SimpleFeatureBuilder``: used to ease interaction with ``FeatureFactory`` -7. Add remove() implementation, marking the currentFeature as null. +7. Add ``remove()`` implementation, marking the ``currentFeature`` as null. .. literalinclude:: /../src/main/java/org/geotools/tutorial/csv2/CSVFeatureWriter.java :language: java :start-after: // remove start :end-before: // remove end -6. Add write() implementation, note how we have to keep track of the axis order (surprisingly this is not fixed): +6. Add ``write()`` implementation, note how we have to keep track of the axis order (surprisingly this is not fixed): .. literalinclude:: /../src/main/java/org/geotools/tutorial/csv2/CSVFeatureWriter.java :language: java @@ -369,19 +358,19 @@ Now that we have some idea of what is riding on top, lets implement our CSVFeatu copy would be compared to the original to see if any change had been made. Why? So that an appropriate event notification could be sent out. - This is another case where a wrapper has been created, and applied by ContentFeatureStore. + This is another case where a wrapper has been created, and applied by ``ContentFeatureStore``. -8. Like the constructor the implementation of *close()* has a number of responsibilities. +8. Like the constructor the implementation of ``close()`` has a number of responsibilities. - To implement close() we must remember to write out any remaining features in the delegate + To implement ``close()`` we must remember to write out any remaining features in the delegate before closing our new file. - The last thing our FeatureWriter must do is replace the existing File with our new one. + The last thing our ``FeatureWriter`` must do is replace the existing ``File`` with our new one. .. literalinclude:: /../src/main/java/org/geotools/tutorial/csv2/CSVFeatureWriter.java :language: java :start-after: // close start :end-before: // close end -#. You can see what this looks like in context by reviewing the :download:`CSVFeatureWriter.java ` from the **gt-csv** plugin. +#. You can see what this looks like in context by reviewing the :download:`CSVFeatureWriter.java ` from the ``gt-csv`` plugin. diff --git a/docs/user/tutorial/datastore/strategy.rst b/docs/user/tutorial/datastore/strategy.rst index e673ce55ac4..51d7057a7d4 100644 --- a/docs/user/tutorial/datastore/strategy.rst +++ b/docs/user/tutorial/datastore/strategy.rst @@ -6,7 +6,7 @@ Strategy Patterns ----------------- -Since this tutorial has been written the result has been broken out into a distinct **gt-csv** module. The work has also been forked into service as part of the GeoServer importer module. Originally in GeoServer's fork, a nifty CSVStrategy was added (with implementations for CSVAttributesOnlyStrategy, CSVLatLonStrategy, CSVSpecifiedLatLngStrategy and CSVSpecifiedWKTStrategy). In this section we'll discuss the new implementation which is a cleaning up and improvement on the strategy pattern they implemented, with read and write functionality. If you want to follow along with the code, it is available as an unsupported plugin: +Since this tutorial has been written the result has been broken out into a distinct ``gt-csv`` module. The work has also been forked into service as part of the GeoServer importer module. Originally in GeoServer's fork, a nifty ``CSVStrategy`` was added (with implementations for ``CSVAttributesOnlyStrategy``, ``CSVLatLonStrategy``, ``CSVSpecifiedLatLngStrategy`` and ``CSVSpecifiedWKTStrategy``). In this section we'll discuss the new implementation which is a cleaning up and improvement on the strategy pattern they implemented, with read and write functionality. If you want to follow along with the code, it is available as an unsupported plugin: * :download:`CSVDataStore.java ` * :download:`CSVDataStoreFactory.java ` @@ -21,34 +21,34 @@ Since this tutorial has been written the result has been broken out into a disti * :download:`CSVLatLonStrategy.java ` * :download:`CSVSpecifiedWKTStrategy.java ` -CSVDataStore -^^^^^^^^^^^^ +``CSVDataStore`` +^^^^^^^^^^^^^^^^ -CSVDataStore now uses a CSVStrategy and CSVFileState. The CSVFileState holds information about the file we are reading from. CSVStrategy is an abstract class for the strategy objects CSVDataStore can use. +``CSVDataStore`` now uses a ``CSVStrategy`` and ``CSVFileState``. The ``CSVFileState`` holds information about the file we are reading from. ``CSVStrategy`` is an abstract class for the strategy objects ``CSVDataStore`` can use. .. literalinclude:: /../../modules/unsupported/csv/src/main/java/org/geotools/data/csv/CSVDataStore.java :language: java :start-after: import org.opengis.filter.Filter; :end-before: public Name getTypeName() { -Using the CSVFileState to do work for us, the **getTypeName()** method to create Name is much simpler. +Using the ``CSVFileState`` to do work for us, the ``getTypeName()`` method to create ``Name`` is much simpler. .. literalinclude:: /../../modules/unsupported/csv/src/main/java/org/geotools/data/csv/CSVDataStore.java :language: java :start-after: // docs start getTypeName :end-before: // docs end getTypeName -CSVDataStore now implements the FileDataStore interface to ensure a standard for operations which are performed by FileDataStores. As such, it must override its methods. Note the use of the CSVStrategy in order to determine the schema. Depending on the strategy defined, the schema for this store will be different. The implementation of **createFeatureSource()** checks to make sure the file is writable before allowing the writing of features. If it is, it actually uses a CSVFeatureStore instead of a CSVFeatureSource, which is a data structure that will allow being written to as well as read from. +``CSVDataStore`` now implements the ``FileDataStore`` interface to ensure a standard for operations which are performed by ``FileDataStores``. As such, it must override its methods. Note the use of the ``CSVStrategy`` in order to determine the schema. Depending on the strategy defined, the schema for this store will be different. The implementation of ``createFeatureSource()`` checks to make sure the file is writable before allowing the writing of features. If it is, it actually uses a ``CSVFeatureStore`` instead of a ``CSVFeatureSource``, which is a data structure that will allow being written to as well as read from. .. literalinclude:: /../../modules/unsupported/csv/src/main/java/org/geotools/data/csv/CSVDataStore.java :language: java :start-after: // docs start dataStoreOperations :end-before: // docs end dataStoreOperations -CSVDataStoreFactory -^^^^^^^^^^^^^^^^^^^ +``CSVDataStoreFactory`` +^^^^^^^^^^^^^^^^^^^^^^^ -The new architecture with the added strategy objects expands the CSVDataStoreFactory's capabilities. It contains a few more :code:`Param` fields now. +The new architecture with the added strategy objects expands the ``CSVDataStoreFactory``'s capabilities. It contains a few more :code:`Param` fields now. Much of the class's structure is improved to be more compartmentalized. The metadata is mostly the same with some data now being held in class fields rather than literals. .. literalinclude:: /../../modules/unsupported/csv/src/main/java/org/geotools/data/csv/CSVDataStoreFactory.java @@ -57,209 +57,210 @@ Much of the class's structure is improved to be more compartmentalized. The meta :end-before: @Override -The method **isAvailable()** just attempts to read the class, and if it succeeds, returns true. +The method ``isAvailable()`` just attempts to read the class, and if it succeeds, returns true. .. literalinclude:: /../../modules/unsupported/csv/src/main/java/org/geotools/data/csv/CSVDataStoreFactory.java :language: java :start-after: // docs start isAvailable :end-before: // docs end isAvailable -The **canProcess(Map params)** method was made more tolerant, now accepting URL and File params through the **fileFromParams(Map params)** method. It will try File first, then URL before giving up. +The ``canProcess(Map params)`` method was made more tolerant, now accepting URL and File parameters through the ``fileFromParams(Map params)`` method. It will try File first, then URL before giving up. .. literalinclude:: /../../modules/unsupported/csv/src/main/java/org/geotools/data/csv/CSVDataStoreFactory.java :language: java :start-after: // docs start canProcess :end-before: // docs end canProcess -Finally, the different strategies are implemented in the **createDataStoreFromFile()** method. The method is overloaded to make some parameters optional, which the class will then fill in for us. +Finally, the different strategies are implemented in the ``createDataStoreFromFile()`` method. The method is overloaded to make some parameters optional, which the class will then fill in for us. .. literalinclude:: /../../modules/unsupported/csv/src/main/java/org/geotools/data/csv/CSVDataStoreFactory.java :language: java :start-after: // docs start createDataStoreFromFile :end-before: // docs end createDataStoreFromFile -CSVFeatureReader -^^^^^^^^^^^^^^^^ +``CSVFeatureReader`` +^^^^^^^^^^^^^^^^^^^^^ -The CSVFeatureReader now delegates much of the functionality to a new class called CSVIterator as well as the CSVStrategy. The resulting code is very clean and short. +The ``CSVFeatureReader`` now delegates much of the functionality to a new class called ``CSVIterator`` as well as the ``CSVStrategy``. The resulting code is very clean and short. .. literalinclude:: /../../modules/unsupported/csv/src/main/java/org/geotools/data/csv/CSVFeatureReader.java :language: java :start-after: import org.opengis.feature.simple.SimpleFeatureType; -CSVFeatureSource -^^^^^^^^^^^^^^^^ +``CSVFeatureSource`` +^^^^^^^^^^^^^^^^^^^^^ -CSVFeatureSource retains the same basic structure, but the code is assisted by the new classes. It now overloads the constructor: +``CSVFeatureSource`` retains the same basic structure, but the code is assisted by the new classes. It now overloads the constructor: .. literalinclude:: /../../modules/unsupported/csv/src/main/java/org/geotools/data/csv/CSVFeatureSource.java :language: java :start-after: import org.opengis.feature.simple.SimpleFeatureType; :end-before: public CSVDataStore getDataStore() { -The **getBoundsInternal(Query query)** method is now implemented by making use of the methods provided by ContentFeatureSource. A new ReferencedEnvelope is created to store the bounds for this feature source. It uses the feature type (**getSchema()**) to determine the CRS (**getCoordinateReferenceSystem()**) - this information is used to construct the bounds for the feature. The FeatureReader is now created by using the Query and CSVStrategy - the **getReader()** method calls **getReaderInternal(Query query)** which shows how it is created. Finally, using the reader, the features are cycled through and included in the bounds in order to calculate the bounds for this entire datastore. +The ``getBoundsInternal(Query query)`` method is now implemented by making use of the methods provided by ``ContentFeatureSource``. A new ``ReferencedEnvelope`` is created to store the bounds for this feature source. It uses the feature type (``getSchema()``) to determine the CRS (``getCoordinateReferenceSystem()``) - this information is used to construct the bounds for the feature. The ``FeatureReader`` is now created by using the ``Query`` and ``CSVStrategy`` - the ``getReader()`` method calls ``getReaderInternal(Query query)`` which shows how it is created. Finally, using the reader, the features are cycled through and included in the bounds in order to calculate the bounds for this entire datastore. .. literalinclude:: /../../modules/unsupported/csv/src/main/java/org/geotools/data/csv/CSVFeatureSource.java :language: java :start-after: // docs start getBoundsInternal :end-before: // docs end getBoundsInternal -The **getReaderInternal(Query query)** method now utilizes the strategy of the CSVDataStore rather than state to reflect the changes to the CSVFeatureReader design. +The ``getReaderInternal(Query query)`` method now utilizes the strategy of the ``CSVDataStore`` rather than state to reflect the changes to the ``CSVFeatureReader`` design. .. literalinclude:: /../../modules/unsupported/csv/src/main/java/org/geotools/data/csv/CSVFeatureSource.java :language: java :start-after: // docs start getReaderInternal :end-before: // docs end getReaderInternal -The **getCountInternal(Query query)** method uses the same idea as **getBoundsInternal(Query query)** - it now utilizes the Query and CSVStrategy to obtain a FeatureReader, then simply counts them. +The ``getCountInternal(Query query)`` method uses the same idea as ``getBoundsInternal(Query query)`` - it now utilizes the Query and ``CSVStrategy`` to obtain a ``FeatureReader``, then simply counts them. .. literalinclude:: /../../modules/unsupported/csv/src/main/java/org/geotools/data/csv/CSVFeatureSource.java :language: java :start-after: // docs start getCountInternal :end-before: // docs end getCountInternal -The **buildFeatureType()** method is now very simple using **getSchema()** to grab the feature type of the datastore. +The ``buildFeatureType()`` method is now very simple using ``getSchema()`` to grab the feature type of the datastore. .. literalinclude:: /../../modules/unsupported/csv/src/main/java/org/geotools/data/csv/CSVFeatureSource.java :language: java :start-after: // docs start buildFeatureType :end-before: // docs end buildFeatureType -CSVFeatureStore -^^^^^^^^^^^^^^^ +``CSVFeatureStore`` +^^^^^^^^^^^^^^^^^^^^ -CSVFeatureStore essentially acts as a read/write version of CSVFeatureSource. Where CSVFeatureSource is only readable, CSVFeatureStore adds the ability to write through the use of a CSVFeatureWriter. The code is updated to use the strategy pattern which it must pass to the writer. +``CSVFeatureStore`` essentially acts as a read/write version of ``CSVFeatureSource``. Where ``CSVFeatureSource`` is only readable, ``CSVFeatureStore`` adds the ability to write through the use of a ``CSVFeatureWriter``. The code is updated to use the strategy pattern which it must pass to the writer. .. literalinclude:: /../../modules/unsupported/csv/src/main/java/org/geotools/data/csv/CSVFeatureStore.java :language: java :start-after: import org.opengis.feature.type.Name; -CSVFeatureWriter -^^^^^^^^^^^^^^^^ +``CSVFeatureWriter`` +^^^^^^^^^^^^^^^^^^^^^ -The CSVFeatureWriter handles the writing functionality for our CSVFeatureStore. With the new architecture, a new class called CSVIterator is used as our delegate (**private CSVIterator iterator;**) rather than the CSVFeatureReader. +The ``CSVFeatureWriter`` handles the writing functionality for our ``CSVFeatureStore``. With the new architecture, a new class called ``CSVIterator`` is used as our delegate (``private CSVIterator iterator;``) rather than the ``CSVFeatureReader``. .. literalinclude:: /../../modules/unsupported/csv/src/main/java/org/geotools/data/csv/CSVFeatureWriter.java :language: java :start-after: import com.csvreader.CsvWriter; :end-before: public CSVFeatureWriter(CSVFileState csvFileState, CSVStrategy csvStrategy) -The feature type we grab for writing is dependent on our strategy; therefore, we must feed CSVFeatureWriter our CSVStrategy and grab the feature type from it. We'll also get our iterator, which reads the file, from our CSVStrategy. Finally, we'll set up a CsvWriter to write to a new file, temp, with the same headers from our current file. +The feature type we grab for writing is dependent on our strategy; therefore, we must feed ``CSVFeatureWriter`` our ``CSVStrategy`` and grab the feature type from it. We'll also get our iterator, which reads the file, from our ``CSVStrategy``. Finally, we'll set up a ``CSVWriter`` to write to a new file, temp, with the same headers from our current file. .. literalinclude:: /../../modules/unsupported/csv/src/main/java/org/geotools/data/csv/CSVFeatureWriter.java :language: java :start-after: // docs start CSVFeatureWriter :end-before: // docs end CSVFeatureWriter -The **hasNext()** method will first check if we're appending content, in which case we are done reading - there is nothing next. Otherwise, it passes off to the CSVIterator's implementation. +The ``hasNext()`` method will first check if we're appending content, in which case we are done reading - there is nothing next. Otherwise, it passes off to the ``CSVIterator``'s implementation. .. literalinclude:: /../../modules/unsupported/csv/src/main/java/org/geotools/data/csv/CSVFeatureWriter.java :language: java :start-after: // featureType start :end-before: // hasNext end -The **next()** method will also check if we are appending. If we're not done reading, we grab the next from our iterator; otherwise, we are done so we want to append content. In this case, it will build the next feature we wish to append. **remove()** will just mark the current feature to be written as null, preventing it from being written. +The ``next()`` method will also check if we are appending. If we're not done reading, we grab the next from our iterator; otherwise, we are done so we want to append content. In this case, it will build the next feature we wish to append. ``remove()`` will just mark the current feature to be written as null, preventing it from being written. .. literalinclude:: /../../modules/unsupported/csv/src/main/java/org/geotools/data/csv/CSVFeatureWriter.java :language: java :start-after: // next start :end-before: // remove end -Finally, the **write()** method takes our current feature and uses the strategy to **encode** it. The encoding gives us back this feature as a CsvRecord, which our writer then writes out to the file. Finally, we take the temp file we've written to and copy its contents into the file our store holds in CSVFileState. +Finally, the ``write()`` method takes our current feature and uses the strategy to ``encode`` it. The encoding gives us back this feature as a ``CSVRecord``, which our writer then writes out to the file. Finally, we take the temporary file we've written to and copy its contents into the file our store holds in ``CSVFileState``. .. literalinclude:: /../../modules/unsupported/csv/src/main/java/org/geotools/data/csv/CSVFeatureWriter.java :language: java :start-after: // write start -CSVIterator -^^^^^^^^^^^ +``CSVIterator`` +^^^^^^^^^^^^^^^^ -The CSVIterator is a helper class primarily for CSVFeatureReader. Much of the old code is now implemented here, and has the added benefit of allowing an iterator to be instantiated for use elsewhere, making the code more general than before. With the addition of the CSVFileState, the class now reads from it instead of the CSVDataStore. +The ``CSVIterator`` is a helper class primarily for ``CSVFeatureReader``. Much of the old code is now implemented here, and has the added benefit of allowing an iterator to be instantiated for use elsewhere, making the code more general than before. With the addition of the ``CSVFileState``, the class now reads from it instead of the ``CSVDataStore``. .. literalinclude:: /../../modules/unsupported/csv/src/main/java/org/geotools/data/csv/parse/CSVIterator.java :language: java :start-after: import com.csvreader.CsvReader; :end-before: private SimpleFeature buildFeature(String[] csvRecord) { -Because we're now using strategy objects to implement functionality, the **readFeature()** method no longer makes any assumptions about the nature of the data. It is delegated to the strategy to make such a decision. The resulting method is shorter, just passing what it reads off to builders to implement based on the strategy. +Because we're now using strategy objects to implement functionality, the ``readFeature()`` method no longer makes any assumptions about the nature of the data. It is delegated to the strategy to make such a decision. The resulting method is shorter, just passing what it reads off to builders to implement based on the strategy. .. literalinclude:: /../../modules/unsupported/csv/src/main/java/org/geotools/data/csv/parse/CSVIterator.java :language: java :start-after: // docs start readFeature :end-before: // docs end readFeature -CSVFileState -^^^^^^^^^^^^ +``CSVFileState`` +^^^^^^^^^^^^^^^^^ -The CSVFileState is a new class to assist with File manipulation in our CSVDataStore. It will hold some information about our :file:`.csv` file and allow it to be opened for reading. +The ``CSVFileState`` is a new class to assist with File manipulation in our ``CSVDataStore``. It will hold some information about our :file:`.csv` file and allow it to be opened for reading. .. literalinclude:: /../../modules/unsupported/csv/src/main/java/org/geotools/data/csv/CSVFileState.java :language: java :start-after: import com.csvreader.CsvReader; :end-before: public CsvReader openCSVReader() throws IOException { -The class opens the file for reading, ensures it is the correct CSV format, and gives back a CSVReader to read the file through a stream. +The class opens the file for reading, ensures it is the correct CSV format, and gives back a ``CSVReader`` to read the file through a stream. .. literalinclude:: /../../modules/unsupported/csv/src/main/java/org/geotools/data/csv/CSVFileState.java :language: java :start-after: // docs start openCSVReader :end-before: // docs end openCSVReader -The **readCSVHeaders()** and **getCSVHeaders()** methods grab the headers from the file (thus, leaving just the data). +The ``readCSVHeaders()`` and ``getCSVHeaders()`` methods grab the headers from the file (thus, leaving just the data). .. literalinclude:: /../../modules/unsupported/csv/src/main/java/org/geotools/data/csv/CSVFileState.java :language: java :start-after: // docs start getCSVHeaders :end-before: // docs end readCSVHeaders -CSVStrategy -^^^^^^^^^^^ +``CSVStrategy`` +^^^^^^^^^^^^^^^^ -CSVStrategy defines the API used internally by CSVDataStore when converting from CSV Records to Features (and vice versa). +``CSVStrategy`` defines the API used internally by ``CSVDataStore`` when converting from CSV ``Records`` to ``Features`` (and vice versa). .. literalinclude:: /../../modules/unsupported/csv/src/main/java/org/geotools/data/csv/parse/CSVStrategy.java :language: java :start-after: // docs start CSVStrategy :end-before: // docs end CSVStrategy -The name "strategy" comes form the strategy pattern - where an object (the strategy) is injected into our CSVDataStore to configure it for use. CSVDataStore will call the strategy object as needed (rather than have a bunch of switch/case statements inside each method). +The name "strategy" comes form the strategy pattern - where an object (the strategy) is injected into our ``CSVDataStore`` to configure it for use. ``CSVDataStore`` will call the strategy object as needed (rather than have a bunch of switch/case statements inside each method). -Subclasses of CSVStrategy will need to implement: +Sub-classes of ``CSVStrategy`` will need to implement: -* **buildFeatureType()** - generate a FeatureType (from the CSV file headers - and possibly a scan off the data) -* **createSchema(SimpleFeatureType)** - create a new file using the provided feature type -* **decode(String, String[])** - decode a record from the csv file -* **encode(SimpleFeature)** - encode a feature as a record (to be written to the csv file) +* ``buildFeatureType()`` - generate a ``FeatureType`` (from the CSV file headers - and possibly a scan off the data) +* ``createSchema(SimpleFeatureType)`` - create a new file using the provided feature type +* ``decode(String, String[])`` - decode a record from the CSV file +* ``encode(SimpleFeature)`` - encode a feature as a record (to be written to the CSV file) -This API is captured as an abstract class which can be subclassed for specific strategies. The strategy objects are used by the CSVDataStore to determine how certain methods will operate: by passing the strategy objects into the CSVDataStore, their implementation is used. Through this design, we can continue extending the abilities of the CSVDataStore in the future much more easily. +This API is captured as an abstract class which can be sub-classed for specific strategies. The strategy objects are used by the ``CSVDataStore`` to determine how certain methods will operate: by passing the strategy objects into the ``CSVDataStore``, their implementation is used. Through this design, we can continue extending the abilities of the ``CSVDataStore`` in the future much more easily. -The base class has some support methods available for use by all the strategy objects. The **createBuilder()** methods are helpers that set some of the common portions for the SimpleFeatureBuilder utility object, such as the type name, coordinate reference system, namespace URI, and then the column headers. +The base class has some support methods available for use by all the strategy objects. The ``createBuilder()`` methods are helpers that set some of the common portions for the ``SimpleFeatureBuilder`` utility object, such as the type name, coordinate reference system, namespace URI, and then the column headers. .. literalinclude:: /../../modules/unsupported/csv/src/main/java/org/geotools/data/csv/parse/CSVStrategy.java :language: java :start-after: // docs start CSVStrategy :end-before: // docs end CSVStrategy -The **findMostSpecificTypesFromData(CsvReader csvReader, String[] headers)** method attempts to find the type of the data being read. It attempts to read it as an Integer first, and if the format is incorrect, it tries a Double next, and if the format is still incorrect, it just defaults to a String type. It scans the entire file when doing so to ensure that later on the values do not change to a different type. +The ``findMostSpecificTypesFromData(CsvReader csvReader, String[] headers)`` method attempts to find the type of the data being read. It attempts to read it as an Integer first, and if the format is incorrect, it tries a Double next, and if the format is still incorrect, it just defaults to a String type. It scans the entire file when doing so to ensure that later on the values do not change to a different type. .. literalinclude:: /../../modules/unsupported/csv/src/main/java/org/geotools/data/csv/parse/CSVStrategy.java :language: java :start-after: // docs start createBuilder :end-before: // docs end findMostSpecificTypesFromData -CSVAttributesOnlyStrategy -^^^^^^^^^^^^^^^^^^^^^^^^^ +``CSVAttributesOnlyStrategy`` +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The CSVAttributesOnlyStrategy is the simplest implementation. It directly reads the file and obtains the values as attributes for the feature. The feature type is built using helper methods from a support class which will be visited later. The headers from the :file:`.csv` file are read in as attributes for this feature. Each header is an attribute defined in that column, and each row provides the values for all the attributes of one feature. The csvRecord parameter contains one line of data read in from the file, and each String is mapped to its attribute. The SimpleFeatureBuilder utility class uses all the data to build this feature. +The ``CSVAttributesOnlyStrategy`` is the simplest implementation. It directly reads the file and obtains the values as attributes for the feature. The feature type is built using helper methods from a support class which will be visited later. The headers from the :file:`.csv` file are read in as attributes for this feature. Each header is an attribute defined in that column, and each row provides the values for all the attributes of one feature. The ``csvRecord`` parameter contains one line of data read in from the file, and each String is mapped to its attribute. The ``SimpleFeatureBuilder`` utility class uses all the data to build this feature. .. literalinclude:: /../../modules/unsupported/csv/src/main/java/org/geotools/data/csv/parse/CSVAttributesOnlyStrategy.java :language: java :start-after: import com.csvreader.CsvWriter; -CSVLatLonStrategy -^^^^^^^^^^^^^^^^^ +``CSVLatLonStrategy`` +^^^^^^^^^^^^^^^^^^^^^ -The CSVLatLonStrategy provides the additional component of supplanting Latitude and Longitude fields with a Point geometry. We search through the headers to see if there is a match for both Latitude and Longitude, and if so, we remove those attributes and replace it with the Point geometry. The user can specify the strings to use to search for the Lat and Lon columns (for example, "LAT" and "LON"). Otherwise, the class will attempt to parse for a valid lat/lon spelling. The user can also choose to name the geometry column, or else it will default to "location". Using this information, it builds the feature type. +The ``CSVLatLonStrategy`` provides the additional component of supplanting Latitude and Longitude fields with a Point geometry. We search through the headers to see if there is a match for both Latitude and Longitude, and if so, we remove those attributes and replace it with the Point geometry. The user can specify the strings to use to search for the latitude and longitude + columns (for example, ``LAT`` and ``LON``). Otherwise, the class will attempt to parse for a valid ``lat/lon`` spelling. The user can also choose to name the geometry column, or else it will default to "location". Using this information, it builds the feature type. .. literalinclude:: /../../modules/unsupported/csv/src/main/java/org/geotools/data/csv/parse/CSVLatLonStrategy.java :language: java @@ -273,54 +274,54 @@ When encoding the feature, the geometry will grab the Y value first (latitude) a :start-after: // docs start encode :end-before: // docs end encode -When decoding a CsvRecord into a feature, we parse for the latField and lngField and store those values. At the end if we've successfully grabbed both a latitude and longitude, we create it as a Point in our feature. +When decoding a ``CsvRecord`` into a feature, we parse for the ``latField`` and ``lngField`` and store those values. At the end if we've successfully grabbed both a latitude and longitude, we create it as a ``Point`` in our feature. .. literalinclude:: /../../modules/unsupported/csv/src/main/java/org/geotools/data/csv/parse/CSVLatLonStrategy.java :language: java :start-after: // docs start decode :end-before: // docs end decode -For our **createSchema()** method, we search for the geometry column that we should have created - specified with **WGS84** as the CRS - and if successful, we add our specified latField and lngField to the header. If unsuccessful, we throw an IOException. The rest of the columns just use the names they were given. If we find a GeometryDescriptor, we skip it because that was our Lat/Lon column. Everything else in this strategy is just stored as an Attribute. Finally, the header is written using the CsvWriter. +For our ``createSchema()`` method, we search for the geometry column that we should have created - specified with **WGS84** as the CRS - and if successful, we add our specified ``latField`` and ``lngField`` to the header. If unsuccessful, we throw an ``IOException``. The rest of the columns just use the names they were given. If we find a ``GeometryDescriptor``, we skip it because that was our Lat/Lon column. Everything else in this strategy is just stored as an Attribute. Finally, the header is written using the ``CsvWriter``. .. literalinclude:: /../../modules/unsupported/csv/src/main/java/org/geotools/data/csv/parse/CSVLatLonStrategy.java :language: java :start-after: // docs start createSchema :end-before: // docs end createSchema -CSVSpecifiedWKTStrategy -^^^^^^^^^^^^^^^^^^^^^^^ +``CSVSpecifiedWKTStrategy`` +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -CSVSpecifiedWKTStrategy is the strategy used for a Well-Known-Text (WKT) format. A specified WKT must be passed to the strategy to be used to parse for the WKT. +``CSVSpecifiedWKTStrategy`` is the strategy used for a Well-Known-Text (WKT) format. A specified WKT must be passed to the strategy to be used to parse for the WKT. -Similar to the CSVLatLonStrategy, a specified WKT must be passed to the strategy to be used to parse for the WKT. If found, it attaches the Geometry class to the WKT in the header. +Similar to the ``CSVLatLonStrategy``, a specified WKT must be passed to the strategy to be used to parse for the WKT. If found, it attaches the Geometry class to the WKT in the header. .. literalinclude:: /../../modules/unsupported/csv/src/main/java/org/geotools/data/csv/parse/CSVSpecifiedWKTStrategy.java :language: java :start-after: import org.locationtech.jts.io.WKTWriter; :end-before: @Override -To build the feature type with this strategy, the only thing that needs to be changed is updating the specified WKT field. Instead of reading this data as an Integer, Double or String (as in the base CSVStrategy class's **createBuilder()** method), we want to use a Geometry class to store the information in the WKT Field's column. To do this, we create an AttributeBuilder, set our CRS to **WGS84** and the binding to :file:`Geometry.class`. We get an AttributeDescriptor from this builder, suppling it with the wktField specified as its name. Then we set the featureBuilder with this AttributeDescriptor, it overwrites it with the new information. +To build the feature type with this strategy, the only thing that needs to be changed is updating the specified WKT field. Instead of reading this data as an ``Integer``, ``Double`` or ``String`` (as in the base ``CSVStrategy`` class's ``createBuilder()`` method), we want to use a ``Geometry`` class to store the information in the WKT Field's column. To do this, we create an ``AttributeBuilder``, set our CRS to **WGS84** and the binding to :file:`Geometry.class`. We get an ``AttributeDescriptor`` from this builder, supplying it with the ``wktField`` specified as its name. Then we set the ``featureBuilder`` with this ``AttributeDescriptor``, it overwrites it with the new information. .. literalinclude:: /../../modules/unsupported/csv/src/main/java/org/geotools/data/csv/parse/CSVSpecifiedWKTStrategy.java :language: java :start-after: // docs start buildFeatureType :end-before: // docs end buildFeatureType -For creating the schema, the only thing we search for is a GeometryDescriptor, which we will know is our wktField. Otherwise, we just use the names they were given. +For creating the schema, the only thing we search for is a ``GeometryDescriptor``, which we will know is our ``wktField``. Otherwise, we just use the names they were given. .. literalinclude:: /../../modules/unsupported/csv/src/main/java/org/geotools/data/csv/parse/CSVSpecifiedWKTStrategy.java :language: java :start-after: // docs start createSchema :end-before: // docs end createSchema -When encoding a feature, we simply parse for the wktField described by the strategy. If found, we use a WKTWriter to correctly write out the Geometry as a WKT field, which is then added to our CsvRecord. Otherwise, the value is passed to a utility method **convert()** which will write the value out as a String. +When encoding a feature, we simply parse for the ``wktField`` described by the strategy. If found, we use a ``WKTWriter`` to correctly write out the Geometry as a WKT field, which is then added to our ``CsvRecord``. Otherwise, the value is passed to a utility method ``convert()`` which will write the value out as a ``String``. .. literalinclude:: /../../modules/unsupported/csv/src/main/java/org/geotools/data/csv/parse/CSVSpecifiedWKTStrategy.java :language: java :start-after: // docs start encode :end-before: // docs end encode -When decoding a CsvRecord, we check if we are in the WKT column (current header value is the wktField specified) and if we have a GeometryDescriptor in our featureType. If both are true, we create a WKTReader to read the value as a Geometry type so that we can build our feature with this Geometry. If it fails for some reason, the exception is caught and the attribute is treated as null. +When decoding a ``CsvRecord``, we check if we are in the WKT column (current header value is the ``wktField`` specified) and if we have a ``GeometryDescriptor`` in our ``featureType``. If both are true, we create a ``WKTReader`` to read the value as a Geometry type so that we can build our feature with this Geometry. If it fails for some reason, the exception is caught and the attribute is treated as null. .. literalinclude:: /../../modules/unsupported/csv/src/main/java/org/geotools/data/csv/parse/CSVSpecifiedWKTStrategy.java :language: java diff --git a/docs/user/tutorial/datastore/write.rst b/docs/user/tutorial/datastore/write.rst index 0fde9b7fa10..afdde047362 100644 --- a/docs/user/tutorial/datastore/write.rst +++ b/docs/user/tutorial/datastore/write.rst @@ -3,73 +3,73 @@ :Version: |release| :License: Creative Commons with attribution -Using FeatureStore ------------------- +Using ``FeatureStore`` +---------------------- -Now that we have completed our CSVDataStore implementation, we can explore the remaining +Now that we have completed our ``CSVDataStore`` implementation, we can explore the remaining capabilities of the DataStore API. -DataStore actually extends DataAccess which was introduced to allow GeoTools to work with more +DataStore actually extends ``DataAccess`` which was introduced to allow GeoTools to work with more general feature content including properties, attributes and associations. .. figure:: images/DataAccess.png DataAccess -DataStore, along with a few subclasses, are limited to work with SimpleFeature (values only, order +``DataStore``, along with a few sub-classes, are limited to work with ``SimpleFeature`` (values only, order significant). .. figure:: images/DataStore.png DataStore -CSVDataStore API for data modification: +``CSVDataStore`` API for data modification: -* CSVDataStore.createSchema( featureType ) -* CSVDataStore.getFeatureWriter( typeName, filter, Transaction ) -* CSVDataStore.getFeatureWriter( typeName, Transaction ) -* CSVDataStore.getFeatureWriterAppend( typeName, Transaction ) -* CSVDataStore.getFeatureSource( typeName ) +* ``CSVDataStore.createSchema(featureType)`` +* ``CSVDataStore.getFeatureWriter(typeName, filter, Transaction)`` +* ``CSVDataStore.getFeatureWriter(typeName, Transaction)`` +* ``CSVDataStore.getFeatureWriterAppend(typeName, Transaction)`` +* ``CSVDataStore.getFeatureSource(typeName)`` -FeatureSource -^^^^^^^^^^^^^ +``FeatureSource`` +^^^^^^^^^^^^^^^^^ -The DataStore.getFeatureSource( typeName ) method is the gateway to our high level api, as -provided by an instance of FeatureSource, FeatureStore or FeatureLocking. +The ``DataStore.getFeatureSource(typeName)`` method is the gateway to our high level API, as +provided by an instance of ``FeatureSource``, ``FeatureStore`` or ``FeatureLocking``. Now that we have implemented writing operations, the result of this method supports: -* FeatureSource: the query operations outlined in the :doc:`../filter/query` -* FeatureStore: modification and transaction support -* FeatureLocking: Interaction with a Feature-based Locking +* ``FeatureSource``: the query operations outlined in the :doc:`../filter/query` +* ``FeatureStore``: modification and transaction support +* ``FeatureLocking``: Interaction with a Feature-based Locking -FeatureStore -'''''''''''' +``FeatureStore`` +'''''''''''''''' -FeatureStore provides Transaction support and modification operations. FeatureStore is an -extension of FeatureSource. +``FeatureStore`` provides ``Transaction`` support and modification operations. ``FeatureStore`` is an +extension of ``FeatureSource``. -You may check the result of getFeatureSource( typeName ) with the :code:`instanceof` operator. +You may check the result of ``getFeatureSource(typeName)`` with the :code:`instanceof` operator. -Example of FeatureStore use: +Example of ``FeatureStore`` use: .. literalinclude:: /../src/main/java/org/geotools/tutorial/csv2/CSVWriteTest.java :language: java :start-after: // featureStoreExample start :end-before: // featureStoreExample end -FeatureStore defines: +``FeatureStore`` defines: -* FeatureStore.addFeatures( featureReader) -* FeatureStore.removeFeatures( filter ) -* FeatureStore.modifyFeatures( type, value, filter ) -* FeatureStore.modifyFeatures( types, values, filter ) -* FeatureStore.setFeatures( featureReader ) -* FeatureStore.setTransaction( transaction ) +* ``FeatureStore.addFeatures(featureReader)`` +* ``FeatureStore.removeFeatures(filter)`` +* ``FeatureStore.modifyFeatures(type, value, filter)`` +* ``FeatureStore.modifyFeatures(types, values, filter)`` +* ``FeatureStore.setFeatures(featureReader)`` +* ``FeatureStore.setTransaction(transaction)`` -Once again, many DataStores are able to provide optimized implementations of these operations. +Once again, many ``DataStores`` are able to provide optimized implementations of these operations. -Transaction Example: +``Transaction`` Example: .. literalinclude:: /../src/main/java/org/geotools/tutorial/csv2/CSVWriteTest.java :language: java @@ -102,44 +102,44 @@ Resulting in the following file: * Notice how the transactions only reflect the changes the user made relative to the current file contents. - This is shown after t1 commit, where transaction t2 is seeing 4 features (ie the + This is shown after t1 commit, where transaction t2 is seeing 4 features (i.e. the current file contents plus the one feature that has been added on t2). - * This really shows that FeatureSource and FeatureStore are "views" into your data. + * This really shows that ``FeatureSource`` and ``FeatureStore`` are "views" into your data. - If you configure two FeatureStores with the same transaction they will act the same. + If you configure two ``FeatureStores`` with the same transaction they will act the same. - Transaction is important and represents what you are working on FeatureStore is not as + ``Transaction`` is important and represents what you are working on ``FeatureStore`` is not as important and is just used to make working with your data easier (or more efficient) - than direct use of FeatureWriter. + than direct use of ``FeatureWriter``. -FeatureLocking -'''''''''''''' - -FeatureLocking is the last extension to our high-level API. It provides support for preventing -modifications to features for the duration of a Transaction, or a period of time. - -FeatureLocking defines: - -* FeatureLocking.setFeatureLock( featureLock ) -* FeatureLocking.lockFeatures( query ) - lock features specified by query -* FeatureLocking.lockFeatures( filter ) - lock according to constraints -* FeatureLocking.lockFeatures() - lock all -* FeatureLocking.unLockFeatures( query ) -* FeatureLocking.unLockFeatures( filter ) -* FeatureLocking.unLockFeatures() -* FeatureLocking.releaseLock( string ) -* FeatureLocking.refreshLock( string ) - -The concept of a FeatureLock matches the description provided in the OGC Web Feature Server -Specification. Locked Features can only be used via Transactions that have been provided with +``FeatureLocking`` +''''''''''''''''''' + +``FeatureLocking`` is the last extension to our high-level API. It provides support for preventing +modifications to features for the duration of a ``Transaction``, or a period of time. + +``FeatureLocking`` defines: + +* ``FeatureLocking.setFeatureLock(featureLock)`` +* ``FeatureLocking.lockFeatures(query)`` - lock features specified by query +* ``FeatureLocking.lockFeatures(filter)`` - lock according to constraints +* ``FeatureLocking.lockFeatures()`` - lock all +* ``FeatureLocking.unLockFeatures(query)`` +* ``FeatureLocking.unLockFeatures(filter)`` +* ``FeatureLocking.unLockFeatures()`` +* ``FeatureLocking.releaseLock(string)`` +* ``FeatureLocking.refreshLock(string)`` + +The concept of a ``FeatureLock`` matches the description provided in the OGC Web Feature Server +Specification. Locked Features can only be used via ``Transactions`` that have been provided with the correct authorization. -FeatureWriter -^^^^^^^^^^^^^ +``FeatureWriter`` +^^^^^^^^^^^^^^^^^^ -The **DataStore.getFeatureWriter( typeName, filter, transaction )** method -creates a FeatureWriter used to modify features indicated by a constraint. +The ``DataStore.getFeatureWriter(typeName, filter, transaction)`` method +creates a ``FeatureWriter`` used to modify features indicated by a constraint. Example - removing all features: @@ -163,11 +163,11 @@ And the following file: :end-before: removeAllExample contents end -This FeatureWriter does not allow the addition of new content. It can be used for modification -and removal only. DataStores can often provide an optimized implementation. +This ``FeatureWriter`` does not allow the addition of new content. It can be used for modification +and removal only. ``DataStores`` can often provide an optimized implementation. -The **DataStore.getFeatureWriter( typeName, transaction )** method creates a general purpose -FeatureWriter. New content may be added after iterating through the +The ``DataStore.getFeatureWriter(typeName, transaction)`` method creates a general purpose +``FeatureWriter``. New content may be added after iterating through the provided content. Example - completely replace all features: @@ -184,7 +184,7 @@ The modified file: :start-after: replaceAll contents start :end-before: replaceAll contents end -The **DataStore.getFeatureWriterAppend( typeName, transaction )** method creates a FeatureWriter +The ``DataStore.getFeatureWriterAppend(typeName, transaction)`` method creates a ``FeatureWriter`` for adding content. Example - making a copy: @@ -201,4 +201,4 @@ The modified file: :start-after: appendContent contents start :end-before: appendContent contents end -DataStores can often provide an optimized implementation of this method. +``DataStores`` can often provide an optimized implementation of this method. diff --git a/docs/user/tutorial/factory.rst b/docs/user/tutorial/factory.rst index 6a09739305e..7aae5db6c6e 100644 --- a/docs/user/tutorial/factory.rst +++ b/docs/user/tutorial/factory.rst @@ -5,7 +5,7 @@ Factory Tutorial ---------------- -We are going to use FunctionFactory as an introduction to the GeoTools plug-in system. +We are going to use ``FunctionFactory`` as an introduction to the GeoTools plug-in system. In the :doc:`/welcome/architecture` we saw the difference between the core GeoTools library and plug-ins that contribute functionality. One thing that makes a plug-in work is the "Factory SPI" plug-ins system @@ -23,14 +23,14 @@ Review Each plugin jar has: -* META-INF/services folder +* ``META-INF/services`` folder The folder contains a list of files (one for each interface name) * The files contain a list of classes that implement that interface This page is where we explain how this all works. -GeoTools is extended using the **Factory** and **FactoryRegistry** classes. The standard Factory +GeoTools is extended using the ``Factory`` and ``FactoryRegistry`` classes. The standard Factory Pattern gives us a clue about what is about to happen: FACTORY PATTERN @@ -49,7 +49,7 @@ interface already provided by GeoTools. GeoTools loves to work with interfaces, and this is the reason why (it is the first step of making a plug-in based library). -We are going to use **Function** as an example for this discussion:: +We are going to use ``Function`` as an example for this discussion:: public interface Function extends Expression { String getName(); @@ -58,7 +58,7 @@ We are going to use **Function** as an example for this discussion:: } public interface Expression { Object evaluate(Object object); - T evaluate( Object object, Class context ); + T evaluate(Object object, Class context); Object accept(ExpressionVisitor visitor, Object extraData); } @@ -67,20 +67,20 @@ We are going to use **Function** as an example for this discussion:: .. literalinclude:: /../src/main/java/org/geotools/tutorial/function/SnapFunction.java :language: java -2. The mechanics of using a LocationIndexLine are covered in :doc:`/library/jts/snap` +2. The mechanics of using a ``LocationIndexLine`` are covered in :doc:`/library/jts/snap` if you are interested. -3. One thing to notice is the definition of FunctionName used to describe valid parameters to +3. One thing to notice is the definition of ``FunctionName`` used to describe valid parameters to user of our new function. - By convention we define this as a static final SnapFunction.NAME, this is however only a + By convention we define this as a static final ``SnapFunction.NAME``, this is however only a convention (which will help in implementing the next section). Step 2 Factory ^^^^^^^^^^^^^^ -Interfaces are not allowed to have constructors, so anything that would been a Constructor is -defined as a Factory interface. +Interfaces are not allowed to have constructors, so anything that would been a constructor is +defined as a ``Factory`` interface. To continue with our example:: @@ -89,119 +89,119 @@ To continue with our example:: Function function(String name, List args, Literal fallback); } -The factory above describes what functions are available, and allows for Function -creation. So far everything looks normal. The above is exactly how the plain "Factory Pattern" +The factory above describes what functions are available, and allows for ``Function`` creation. So far everything looks normal. The above is exactly how the plain "Factory Pattern" usually works - hopefully it is familiar to you? .. note:: - Factories are named after the interface they are responsible for; thus FunctionFactory. + Factories are named after the interface they are responsible for; thus ``FunctionFactory``. Variations: * Many factories just have a single create method (this is called the factory method) - We have a couple of examples of this in GeoTools including DataStoreFactorySpi + We have a couple of examples of this in GeoTools including ``DataStoreFactorySpi`` * Some factories have several create method allowing a compatible set of objects to be created - together. We have a couple of examples of these abstract factories, such as FeatureTypeFactory. + together. We have a couple of examples of these abstract factories, such as + ``FeatureTypeFactory``. .. note:: - Some GeoTools factories extend the Factory interface, but this is optional. This Factory - interface is useful only for factories that can be configured through a set of Hints. + Some GeoTools factories extend the ``Factory`` interface, but this is optional. This ``Factory`` + interface is useful only for factories that can be configured through a set of ``Hints``. -To continue with our implementation we will define ExampleFunctionFactory: +To continue with our implementation we will define ``ExampleFunctionFactory``: -1. Create ExampleFunctionFactory implementing FunctionFactory +1. Create ``ExampleFunctionFactory`` implementing ``FunctionFactory`` 2. Fill in the information as shown: .. literalinclude:: /../src/main/java/org/geotools/tutorial/function/ExampleFunctionFactory.java :language: java -3. We make reference to the static final SnapFunction.NAME. +3. We make reference to the static final ``SnapFunction.NAME``. While we mentioned this as only a convention, you are free to create a - new new FunctionNameImpl("snap", "point", "line") as part of the getFunctionNames() method. - This has the advantage of avoiding loading SnapFunction until a user requests it by name. + new ``FunctionNameImpl("snap", "point", "line")`` as part of the + ``getFunctionNames()`` method. + This has the advantage of avoiding loading ``SnapFunction`` until a user requests it by name. 4. We can now register our factory. Create the file: - * META_INF/services/org.geotools.filter.FunctionFactory + * ``META_INF/services/org.geotools.filter.FunctionFactory`` 5. Fill in the following contents (one implementation class per line):: - or.geotools.tutorial.function.ExampleFunctionFactory + org.geotools.tutorial.function.ExampleFunctionFactory -6. That is it SnapFunction is now published! +6. That is it ``SnapFunction`` is now published! Step 3 FactoryRegistry ^^^^^^^^^^^^^^^^^^^^^^^ -Geotools 2.2 uses javax.imageio.ServiceRegistry magic (where this plug-in system originated from). -Please note that the FactoryRegistry will cache the factories already found. Since factories +GeoTools 2.2 uses ``javax.imageio.ServiceRegistry`` magic (where this plug-in system originated from). +Please note that the ``FactoryRegistry`` will cache the factories already found. Since factories are stateless this should not be a problem. Direct use of FactoryRegistry ''''''''''''''''''''''''''''' -1. You can directly use FactoryRegistry in your own code:: +1. You can directly use ``FactoryRegistry`` in your own code:: Set categories = Collections.singleton(new Class[] {FunctionFactory.class,}); FactoryRegistry registry = new FactoryRegistry(categories); Iterator iterator = registry.getProviders(FunctionFactory.class); -2. Internally The **FactoryRegistry** will look up key in System properties. +2. Internally The ``FactoryRegistry`` will look up key in System properties. - * If key doesn't exist or a SecurityException is thrown, fall through. - * Otherwise attempt to instantiate the given class. + * If key doesn't exist or a ``SecurityException`` is thrown, fall through. + * Otherwise attempt to instantiate the given class. -3. Then FactoryRegistry will search the resource paths for the key in META-INF/services. +3. Then ``FactoryRegistry`` will search the resource paths for the key in ``META-INF/services``. * If the resource is found, the file is read and the class is instantiated. * If the resource does not exist, fall through. -4. This means that FactoryRegistry will be able find any FunctionFactory that is provied on - the CLASSPATH. +4. This means that ``FactoryRegistry`` will be able find any ``FunctionFactory`` that is provided on the CLASSPATH. .. note:: - GeoTools already has a FactoryRegistry for handling FunctionFactory, as part of - CommonFactory finder. There is however nothing stopping you from using your - own FactoryRegistry (other than wasting resources). + GeoTools already has a ``FactoryRegistry`` for handling ``FunctionFactory``, as part of + ``CommonFactory`` finder. There is however nothing stopping you from using your + own ``FactoryRegistry`` (other than wasting resources). Defining your own FactoryFinder ''''''''''''''''''''''''''''''' -It is noted that FactoryRegistry is not synchronized, to protect for this you can wrap the -direct use up in a FactoryFinder, which also provide type-safety. +It is noted that ``FactoryRegistry`` is not synchronized, to protect for this you can wrap the +direct use up in a ``FactoryFinder``, which also provide type-safety. .. note:: - Finders are named after the interface they are responsible for; thus FunctionFinder. + Finders are named after the interface they are responsible for; thus ``FunctionFinder``. -Here is an use of FactoryRegistry as part of FactoryFinder: +Here is an use of ``FactoryRegistry`` as part of ``FactoryFinder``: -1. Create the FactoryRegistry in a lazy fashion, listing the interfaces you are interested +1. Create the ``FactoryRegistry`` in a lazy fashion, listing the interfaces you are interested in obtaining (known as categories). -2. GeoTools traditionally holds a FactoryRegistry in a "Finder" class: +2. GeoTools traditionally holds a ``FactoryRegistry`` in a "Finder" class: - * Create ExampleFinder + * Create ``ExampleFinder`` 3. Fill in the following details: .. literalinclude:: /../src/main/java/org/geotools/tutorial/function/ExampleFinder.java :language: java -4. The above is an example only, please use FunctionFinder +4. The above is an example only, please use ``FunctionFinder`` -Tips for implementing your own FactoryFinder: +Tips for implementing your own ``FactoryFinder``: -* The code example makes use of LazySet, this keeps us from having to check the classpath each time. -* The utility method addDefaultHints is used to apply the global GeoTools configuration to the hints +* The code example makes use of ``LazySet``, this keeps us from having to check the classpath each time. +* The utility method ``addDefaultHints`` is used to apply the global GeoTools configuration to the hints supplied by the user. * As shown above you can add some helper methods for client code. Often this is used to perform searches based on some criteria, or used to locate the "best" factory for a given task. @@ -209,13 +209,13 @@ Tips for implementing your own FactoryFinder: FactoryIteratorProviders '''''''''''''''''''''''' -FactoryIteratorProviders is used to support other Plugin mechanisms. +``FactoryIteratorProviders`` is used to support other plugin mechanisms. By default the "Factory SPI" mechanism is used to locate the Factories provided by a -FactoryFinder (and FactoryRegistry). However in order to support other plugin mechanisms -the Factories has a method addFactoryIteratorProvider(...). This method allows a developer +``FactoryFinder`` (and ``FactoryRegistry``). However in order to support other plugin mechanisms +the factories has a method ``addFactoryIteratorProvider(...)``. This method allows a developer to add an iterator that knows how to process another extension mechanism. For example, in -eclipse one would add a FactoryIteratorProvider that returns a provider that knows how to +Eclipse one would add a ``FactoryIteratorProvider`` that returns a provider that knows how to process eclipse extension points and can create factories from the eclipse extensions. Abstract @@ -224,15 +224,15 @@ Abstract Now that we have helped client code make use of our interface, the next step is to provide an abstract class to help those developing an implementation. -Most Geotools Factories are kind enough to give you an Abstract superclass to start your -implementation efforts from. When making your own Factories this is a good example to follow. +Most GeoTools Factories are kind enough to give you an abstract super class to start your +implementation efforts from. When making your own factories this is a good example to follow. .. note:: By asking developers to extend an abstract class you can help protect them from any additional methods that are added to the interface in the future. -1. Here is an example **AbstractFunction** to get a feel for what is involved. +1. Here is an example ``AbstractFunction`` to get a feel for what is involved. This is not part of GeoTools (yet) - it just shows the approach used: @@ -258,36 +258,36 @@ Plugin Checklist 1. Define an interface - Example: Foo + Example: ``Foo`` 2. Define factory interface - Example: FooFactory + Example: ``FooFactory`` -3. Define FactoryFinder +3. Define ``FactoryFinder`` - Example: FooFactoryFinder + Example: ``FooFactoryFinder`` -4. Define an Abstract class for implementors +4. Define an abstract class for implementers - Example: AbstractFoo + Example: ``AbstractFoo`` **To allow client code access to plug-ins** -1. Make your FactoryFinder public +1. Make your ``FactoryFinder`` public - Example: FooFinder + Example: ``FooFinder`` **When implementing a Plugin** 1. Create your implementation - Example: MyFoo + Example: ``MyFoo`` 2. Create you extension factory - Example: MyFooFactory + Example: ``MyFooFactory`` -3. Register with META-INF/services +3. Register with ``META-INF/services`` - Example: META-INF/services/Foo + Example: ``META-INF/services/Foo`` diff --git a/docs/user/tutorial/feature/csv2shp.rst b/docs/user/tutorial/feature/csv2shp.rst index b93461fddc1..11eb6819ce2 100644 --- a/docs/user/tutorial/feature/csv2shp.rst +++ b/docs/user/tutorial/feature/csv2shp.rst @@ -36,8 +36,8 @@ a shapefile from scratch so you get to see every last thing that goes into creat The tutorial covers the following: -* Creating a FeatureType, FeatureCollection and Features -* Using a GeometryFactory to build Points +* Creating a ``FeatureType``, ``FeatureCollection`` and ``Features`` +* Using a ``GeometryFactory`` to build Points * Writing out a Shapefile * Forcing a Projection @@ -48,7 +48,7 @@ Comma Separated Value To start with you will need a CSV file. -#. Create a text file location.csv and copy and paste the following locations into it: +#. Create a text file ``location.csv`` and copy and paste the following locations into it: .. literalinclude:: artifacts/locations.csv @@ -58,7 +58,7 @@ To start with you will need a CSV file. Dependencies ------------ -Please ensure your pom.xml includes the following: +Please ensure your ``pom.xml`` includes the following: .. literalinclude:: ./artifacts/pom.xml :language: xml @@ -70,7 +70,7 @@ Note that the jars mentioned above will pull in a host of other dependencies Main Application ---------------- -1. Please create the package **org.geotools.tutorial.feature** and class **Csv2Shape.java** . +1. Please create the package ``org.geotools.tutorial.feature`` and class ``Csv2Shape.java`` . 2. Copy and paste in the following code: .. literalinclude:: /../src/main/java/org/geotools/tutorial/feature/Csv2Shape.java @@ -83,10 +83,10 @@ Now we look at the rest of the main method in sections... Create a FeatureType -------------------- -We create a FeatureType to describe the data that we are importing from the CSV file and writing +We create a ``FeatureType`` to describe the data that we are importing from the CSV file and writing to a shapefile. -Here we use the DataUtilities convenience class: +Here we use the ``DataUtilities`` convenience class: .. literalinclude:: /../src/main/java/org/geotools/tutorial/feature/Csv2Shape.java :language: java @@ -98,8 +98,8 @@ Create features We can now read the CSV file and create a feature for each record. Please note the following: -* Use of GeometryFactory to create new Points -* Creation of features (SimpleFeature objects) using SimpleFeatureBuilder +* Use of ``GeometryFactory`` to create new Points +* Creation of features (``SimpleFeature`` objects) using ``SimpleFeatureBuilder`` .. literalinclude:: /../src/main/java/org/geotools/tutorial/feature/Csv2Shape.java :language: java @@ -109,17 +109,17 @@ We can now read the CSV file and create a feature for each record. Please note t .. note:: If you have used previous versions of GeoTools you might be used to creating a new - FeatureCollection and using the add method to accumulate features. This usage has now been - deprecated and we encourage you to treat FeatureCollections as immutable views or result sets. + ``FeatureCollection`` and using the add method to accumulate features. This usage has now been + deprecated and we encourage you to treat ``FeatureCollections`` as immutable views or result sets. Create a shapefile From a FeatureCollection ------------------------------------------- Things to note as we create the shapefile: -* Use of DataStoreFactory with a parameter indicating we want a spatial index -* The use of createSchema( SimpleFeatureType ) method to set up the shapefile - (We will create the getNewShapeFile method in the next section) +* Use of ``DataStoreFactory`` with a parameter indicating we want a spatial index +* The use of ``createSchema(SimpleFeatureType)`` method to set up the shapefile + (We will create the ``getNewShapeFile`` method in the next section) .. literalinclude:: /../src/main/java/org/geotools/tutorial/feature/Csv2Shape.java :language: java @@ -131,12 +131,12 @@ Write the feature data to the shapefile Things to note: -* We check that we have read and **write** access by confirming our FeatureSource object - implements the FeatureStore methods +* We check that we have read and **write** access by confirming our ``FeatureSource`` object + implements the ``FeatureStore`` methods * Take a moment to check how closely the shapefile was able to match our - template (the SimpleFeatureType TYPE). Compare this output to see how they are different. -* The SimpleFeatureStore that we use to do this expects a FeatureCollection object, - so we wrap our list of features in a ListFeatureCollection. + template (the ``SimpleFeatureType`` ``TYPE``). Compare this output to see how they are different. +* The ``SimpleFeatureStore`` that we use to do this expects a ``FeatureCollection`` object, + so we wrap our list of features in a ``ListFeatureCollection``. * The use of :code:`transaction.commit()` to safely write out the features in one go. .. literalinclude:: /../src/main/java/org/geotools/tutorial/feature/Csv2Shape.java @@ -149,7 +149,7 @@ This completes the main method. Prompt for the output shapefile ------------------------------- -This method prompts the user for an appropriate shapefile to write out to. The original csv file is +This method prompts the user for an appropriate shapefile to write out to. The original CSV file is used to determine a good default shapefile name. .. literalinclude:: /../src/main/java/org/geotools/tutorial/feature/Csv2Shape.java @@ -177,23 +177,23 @@ Things to Try Another way to build a SimpleFeatureType ---------------------------------------- -Although the DataUtilities class used above provided a quick and easy way to build a -SimpleFeatureType. For any *real* application you will want to use the more -flexible and flexible **SimpleFeatureTypeBuilder**. +Although the ``DataUtilities`` class used above provided a quick and easy way to build a +``SimpleFeatureType``. For any *real* application you will want to use the more +flexible and flexible ``SimpleFeatureTypeBuilder``. -Here is how to use SimpleFeatureTypeBuilder to accomplish the same result: +Here is how to use ``SimpleFeatureTypeBuilder`` to accomplish the same result: .. literalinclude:: /../src/main/java/org/geotools/tutorial/feature/Csv2Shape.java :language: java :start-after: // start createFeatureType :end-before: // end createFeatureType -Note the use of an upper-case constant to hold the SimpleFeatureType. Because the SimpleFeatureType +Note the use of an upper-case constant to hold the ``SimpleFeatureType``. Because the ``SimpleFeatureType`` class is immutable, tracking them as final variables can help you to remember that they cannot be modified once created. -With this method our SimpleFeatureType contains a CoordinateReferenceSystem so there's no need to -call forceSchemaCRS to generate the ".prj" file. Also, we are now limiting the *Name* field to 15 +With this method our ``SimpleFeatureType`` contains a ``CoordinateReferenceSystem`` so there's no need to +call ``forceSchemaCRS`` to generate the ``.prj`` file. Also, we are now limiting the *Name* field to 15 characters. Other things to try @@ -204,12 +204,12 @@ Other things to try LAT, LON, CITY, NUMBER - You should be able to use the SimpleFeatureTypeBuilder. + You should be able to use the ``SimpleFeatureTypeBuilder``. .. instructor note: this is the real key to the exercise and why simple feature type builder exists ... allowing you to generate your own shapefile dynamically -* Use the Geometry "buffer" method to create circles based on the population size of the each city. +* Use the ``Geometry`` ``buffer`` method to create circles based on the population size of the each city. .. code-block:: java @@ -218,14 +218,14 @@ Other things to try .. instructor note: the code above is a trick; to see if they can correctly change their feature type to be a polgon -* It is easy to write a quick CSVReader as we have done here; but harder to write a good one that - can handle quotation marks correctly. JavaCSV is an open source library to read CSV files with +* It is easy to write a quick ``CSVReader`` as we have done here; but harder to write a good one that + can handle quotation marks correctly. ``JavaCSV`` is an open source library to read CSV files with a variety of options. * To quickly find dependencies you can use the website http://mvnrepository.com/. Sites like this will directly provide you a maven dependency that you can cut and paste into - your pom.xml. + your ``pom.xml``. .. code-block:: xml @@ -238,7 +238,7 @@ Other things to try For a working example of how to use this library visit the http://www.csvreader.com/ website. * Use the same techniques to create shapefiles from data in other structured file formats such as - geojson + GeoJson * The earth has just passed through a meteor storm – generate 100 circles of different sizes across the globe. Was your town hit? @@ -248,8 +248,7 @@ Other things to try .. instructor note: either they display two shapefiles and look to see if their town was hit or they can do a contains test for their town against each circle -* Read up about the other Geometry classes supported by shapefiles: MultiLineString for linear - features and MultiPolygon for area features and modify this example to work with these. +* Read up about the other ``Geometry`` classes supported by shapefiles: ``MultiLineString`` for linear features and ``MultiPolygon`` for area features and modify this example to work with these. Feature ======== @@ -275,10 +274,10 @@ into fields. .. image:: images/key.png :width: 200 -Occasionally you have two features that have a lot in common. You may have the LAX airport in Los -Angeles and the SYD airport in Sydney. Because these two features have a couple of things in common -it is nice to group them together - in Java we would create a Class called Airport. On a map we -will create a Feature Type called Airport. +Occasionally you have two features that have a lot in common. You may have the ``LAX`` airport in Los +Angeles and the ``SYD`` airport in Sydney. Because these two features have a couple of things in common +it is nice to group them together - in Java we would create a ``Class`` called ``Airport``. On a map we +will create a ``FeatureType`` called ``Airport``. .. image:: images/airport.png @@ -291,55 +290,54 @@ You will also occasionally find the same real world thing represented a couple o Here is a handy cheat sheet: ====================== ============================= - Java GeoSpatial + Java Geospatial ====================== ============================= - Object Feature - Class FeatureType - Field Attribute - Method Operation + ``Object`` ``Feature`` + ``Class`` ``FeatureType`` + ``Field`` ``Attribute`` + ``Method`` ``Operation`` ====================== ============================= -The Feature model is actually a little bit more crazy than us Java programmers are used to since -it considers both attribute and operation to be "properties" of a Feature. Perhaps when Java +The ``Feature`` model is actually a little bit more crazy than us Java programmers are used to since +it considers both attribute and operation to be "properties" of a ``Feature``. Perhaps when Java gets closures we may be able to catch up. The really interesting thing for me is that map makers were sorting out all this stuff back in the 1400s and got every bit as geeky as programmers do now. So although we would love to teach them -about object oriented programing they already have a rich set of ideas to describe the world. On +about object oriented programming they already have a rich set of ideas to describe the world. On the bright side, map makers are starting to use UML diagrams. FeatureClass ------------ -In GeoTools we have an interface for Feature, FeatureType and Attribute provided by the GeoAPI +In GeoTools we have an interface for ``Feature``, ``FeatureType`` and ``Attribute`` provided by the GeoAPI project. In general GeoAPI provides a very strict interface and GeoTools will provide a class. .. image:: images/feature.png -It is very common for a Feature to have only simple Attributes (String, Integer, Date and so on) -rather than references to other Features, or data structures such as List. Features that +It is very common for a ``Feature`` to have only simple ``Attributes`` (``String``, ``Integer``, ``Date`` and so on) +rather than references to other ``Features``, or data structures such as ``List``. ``Features`` that meet this requirement are so common we have broken out a sub-class to represent them called -SimpleFeature. +``SimpleFeature``. -At the Java level the Feature API provided by GeoTools is similar to how java.util.Map is used – it -is a Java data structure used to hold information. You can look up attribute values by key; and -the list of keys is provided by the FeatureType. +At the Java level the ``Feature`` API provided by GeoTools is similar to how ``java.util.Map`` is used – it is a Java data structure used to hold information. You can look up attribute values by key; and +the list of keys is provided by the ``FeatureType``. Geometry -------- -The other difference between an Object and a Feature is that a Feature has some form of location +The other difference between an ``Object`` and a ``Feature`` is that a ``Feature`` has some form of location information (if not we would not be able to draw it on a map). The location information is going -to be captured by a "Geometry" (or shape) that is stored in an attribute. +to be captured by a ``Geometry`` (or shape) that is stored in an attribute. .. image:: images/geometry.png -We make use of the JTS Topology Suite (JTS) to represent Geometry. The JTS library provides an -excellent implementation of Geometry – and gets geeky points for having a recursive acronym ! JTS +We make use of the JTS Topology Suite (JTS) to represent ``Geometry``. The JTS library provides an +excellent implementation of ``Geometry`` – and gets geeky points for having a recursive acronym! JTS is an amazing library and does all the hard graph theory to let you work with geometry in a productive fashion. -Here is an example of creating a Point using the Well-Known-Text (WKT) format. +Here is an example of creating a ``Point`` using the Well-Known-Text (WKT) format. .. code-block:: java @@ -348,7 +346,7 @@ Here is an example of creating a Point using the Well-Known-Text (WKT) format. WKTReader reader = new WKTReader( geometryFactory ); Point point = (Point) reader.read("POINT (1 1)"); -You can also create a Point by hand using the GeometryFactory directly. +You can also create a ``Point`` by hand using the ``GeometryFactory`` directly. .. code-block:: java @@ -361,15 +359,15 @@ You can also create a Point by hand using the GeometryFactory directly. DataStore ========= -We ran into DataStore already in our Quickstart. The DataStore api is used to represent a File, -Database or Service that has spatial data in it. The API has a couple of moving parts as shown +We ran into ``DataStore`` already in our Quickstart. The ``DataStore`` API is used to represent a ``File``, +``Database`` or ``Service`` that has spatial data in it. The API has a couple of moving parts as shown below. .. image:: images/datastore.png -The FeatureSource is used to read features, the subclass FeatureStore is used for read/write access. +The ``FeatureSource`` is used to read features, the sub-class ``FeatureStore`` is used for read/write access. -The way to tell if a File can be written to in GeoTools is to use an instanceof check. +The way to tell if a ``File`` can be written to in GeoTools is to use an ``instanceof`` check. .. code-block:: java @@ -382,6 +380,6 @@ The way to tell if a File can be written to in GeoTools is to use an instanceof store.modifyFeature( attribute, value, filter ); } -We decided to handle write access as a sub-class (rather than an isWritable method) in order to keep +We decided to handle write access as a sub-class (rather than an ``isWritable`` method) in order to keep methods out of the way unless they could be used. diff --git a/docs/user/tutorial/filter/query.rst b/docs/user/tutorial/filter/query.rst index 7ae0ec3425f..bd869025e0d 100644 --- a/docs/user/tutorial/filter/query.rst +++ b/docs/user/tutorial/filter/query.rst @@ -26,12 +26,12 @@ in with GeoTools jars and all their dependencies. We will list the maven dependencies required at the start of the workbook. This tutorial illustrates how to query spatial data in GeoTools. In the earlier tutorials we -have been working with shapefiles. The focus of this workbook is the Filter API used to query -DataStores, such as shapefiles, databases and Web Feature Servers. So in this lab we will bring +have been working with shapefiles. The focus of this workbook is the ``Filter`` API used to query +``DataStores``, such as shapefiles, databases and Web Feature Servers. So in this lab we will bring out the big guns - a real spatial database. If you are working in an enterprise that has as spatial database (e.g. Oracle, DB2) or geospatial -middleware (e.g. ArcSDE) you can use GeoTools to connect to your existing infrastructure. Here we +middle ware (e.g. ArcSDE) you can use GeoTools to connect to your existing infrastructure. Here we will use `PostGIS `_ which is a spatially-enabled extension of PostgreSQL supporting *Simple Features for SQL*. We will build an application that can connect to both a PostGIS database and shapefiles. @@ -43,21 +43,21 @@ Query Lab Application ===================== The :download:`QueryLab.java ` -example will go through using a Filter to select a FeatureCollection from a shapefile or other -DataStore. +example will go through using a ``Filter`` to select a ``FeatureCollection`` from a shapefile or other +``DataStore``. -We are going to be using connection parameters to connect to our DataStore this time; +We are going to be using connection parameters to connect to our ``DataStore`` this time; and you will have a chance to try it out using PostGIS or a Web Feature Server at the end of this example. -1. Please ensure your pom.xml includes the following: +1. Please ensure your ``pom.xml`` includes the following: .. literalinclude:: artifacts/pom.xml :language: xml :start-after: http://maven.apache.org :end-before: -2. Create the package **org.geotools.tutorial.filter** and class **QueryLab** class and copy and paste the following to get going: +2. Create the package ``org.geotools.tutorial.filter`` and class ``QueryLab`` class and copy and paste the following to get going: .. literalinclude:: /../src/main/java/org/geotools/tutorial/filter/QueryLab.java :language: java @@ -82,14 +82,14 @@ Here is the code to create the controls: 2. Next we add menu items and Actions to the File menu to connect to either a shapefile or a PostGIS database: - Each Action is calling the same method but passing in a different DataStore factory + Each ``Action`` is calling the same method but passing in a different ``DataStoreFactory`` .. literalinclude:: /../src/main/java/org/geotools/tutorial/filter/QueryLab.java :language: java :start-after: // docs start file menu :end-before: // docs end file menu -3. Now let us look at the Data menu items and Actions: +3. Now let us look at the ``Data`` menu items and ``Actions``: .. literalinclude:: /../src/main/java/org/geotools/tutorial/filter/QueryLab.java :language: java @@ -100,15 +100,15 @@ Here is the code to create the controls: Connect to DataStore --------------------- -In the quickstart we made use of **FileDataStoreFinder** to connect to a specific file. This time -we will be using the more general **DataStoreFinder** which takes a map of connection parameters. +In the quickstart we made use of ``FileDataStoreFinder`` to connect to a specific file. This time +we will be using the more general ``DataStoreFinder`` which takes a map of connection parameters. -Note the same code can be used to connect to quite different types of data stores as specified by the the -DataStoreFactorySpi (*Service Provider Interface*) parameter. The file menu actions call this -method with an instance of the either **ShapefileDataStoreFactory** or **PostgisNGDataStoreFactory**. +Note the same code can be used to connect to quite different types of data stores as specified by the +``DataStoreFactorySpi`` (*Service Provider Interface*) parameter. The file menu actions call this +method with an instance of the either ``ShapefileDataStoreFactory`` or ``PostgisNGDataStoreFactory``. -The **JDataStoreWizard** displays a dialog with entry fields appropriate to either a shapefile or -PostGIS database. It requires a few more lines of code than **JFileDataStoreChooser** which was +The ``JDataStoreWizard`` displays a dialog with entry fields appropriate to either a shapefile or +PostGIS database. It requires a few more lines of code than ``JFileDataStoreChooser`` which was used in the Quickstart to prompt the user for a shapefile, but allows greater control. @@ -129,44 +129,44 @@ used in the Quickstart to prompt the user for a shapefile, but allows greater co Query ----- -A **Filter** is similar to the where clause of an SQL statement; defining a condition that each +A ``Filter`` is similar to the where clause of an SQL statement; defining a condition that each feature needs to meet in order to be selected. Here is our strategy for displaying the selected features: - * Get the feature type name selected by the user and retrieve the corresponding FeatureSource - from the DataStore. + * Get the feature type name selected by the user and retrieve the corresponding ``FeatureSource`` + from the ``DataStore``. * Get the query condition that was entered in the text field and use the CQL class to create a - Filter object. + ``Filter`` object. - * Pass the filter to the getFeatures method which returns the features matching the query - as a FeatureCollection. + * Pass the ``Filter`` to the ``getFeatures`` method which returns the features matching the query + as a ``FeatureCollection``. - * Create a FeatureCollectionTableModel for our dialog's JTable. This GeoTools - class takes a FeatureCollection and retrieves the feature attribute names and the data for + * Create a ``FeatureCollectionTableModel`` for our dialog's ``JTable``. This GeoTools + class takes a ``FeatureCollection`` and retrieves the feature attribute names and the data for each feature. With this strategy in mind here is the implementation: -1. Getting feature data using featureSource.getFeatures( filter ) +1. Getting feature data using ``featureSource.getFeatures(filter)`` .. literalinclude:: /../src/main/java/org/geotools/tutorial/filter/QueryLab.java :language: java :start-after: // docs start filterFeatures :end-before: // docs end filterFeatures -2. The FeatureCollection behaves as a predefined query or result set and does not load the data +2. The ``FeatureCollection`` behaves as a predefined query or result set and does not load the data into memory. - You can ask questions of the FeatureCollection as a whole using the available methods. + You can ask questions of the ``FeatureCollection`` as a whole using the available methods. .. literalinclude:: /../src/main/java/org/geotools/tutorial/filter/QueryLab.java :language: java :start-after: // docs start countFeatures :end-before: // docs end countFeatures -4. By using the **Query** data structure you are afforded greater control over your request +4. By using the ``Query`` data structure you are afforded greater control over your request allowing you to select just the attributes needed; control how many features are returned; and ask for a few specific processing steps such as reprojection. @@ -185,8 +185,8 @@ Now we can run the application and try out some of these ideas: 1. Start the application and select either *Open shapefile...* from the File menu. - The **JDataStoreWizard** will prompt you for a file. Please select the **cities.shp** - shapefile available as part of the `uDig sample dataset `_ used in previous tutorials. + The ``JDataStoreWizard`` will prompt you for a file. Please select the ``cities.shp`` + shapefile available as part of the `uDig sample data set `_ used in previous tutorials. .. image:: images/shapeWizard1.png @@ -195,7 +195,7 @@ Now we can run the application and try out some of these ideas: .. image:: images/shapeWizard1.png -4. Once you have successfully connected to your shapefile the combobox in the menubar will display +4. Once you have successfully connected to your shapefile the ``ComboBox`` in the ``MenuBar`` will display the names of the available feature types. A single type for a shapefile is not that exciting but when you use PostGIS you should be able to choose which table to work with here. @@ -210,7 +210,7 @@ Now we can run the application and try out some of these ideas: .. image:: images/citiesInclude.png -6. Common query language allows for simple tests such as selecting features where the CNTRY_NAME +6. Common query language allows for simple tests such as selecting features where the ``CNTRY_NAME`` attribute is 'France': .. code-block:: sql @@ -221,7 +221,7 @@ Now we can run the application and try out some of these ideas: .. image:: images/citiesFrance.png -7. Comparisons are supported such as features with value >= 5 for the POP_RANK attribute: +7. Comparisons are supported such as features with value ``>= 5`` for the ``POP_RANK`` attribute: .. code-block:: sql @@ -243,12 +243,16 @@ Now we can run the application and try out some of these ideas: area bounded by 110 - 155 |deg| W, 10 - 45 |deg| S (a loose box around Australia). Notice that we name the geometry attribute which, for the *cities* shapefile, is - Point type. + ``Point`` type. + + .. note:: + The geometry of a Shapefile is always called ``the_geom``, for other + data stores we would need to look up the name of the geometry attribute. Things to Try ============== -* Try connecting to a public postgis instance. +* Try connecting to a public PostGIS instance. Select *Connect to PostGIS database...* from the file menu and fill in the following parameters. @@ -258,15 +262,15 @@ Things to Try `Refractions Research `_ with the following credentials: :host: - www.refractions.net + ``www.refractions.net`` :port: - 5432 + ``5432`` :database: - demo-bc + ``demo-bc`` :user: - demo + ``demo`` :passwd: - demo + ``demo`` Next the wizard will display a second page of optional parameters. For this example you can leave this blank and just click the *Finish* button. @@ -277,23 +281,23 @@ Things to Try .. code-block:: java Configuration configuration = new org.geotools.filter.v1_0.OGCConfiguration(); - Parser parser = new Parser( configuration ); + Parser parser = new Parser(configuration); ... - Filter filter = (Filter) parser.parse( inputstream ); + Filter filter = (Filter) parser.parse(inputstream); - If you need an xml file to start from you can write one out using. + If you need an XML file to start from you can write one out using. .. code-block:: java Configuration = new org.geotools.filter.v1_0.OGCConfiguration(); - Encoder encoder = new org.geotools.xsd.Encoder( configuration ); + Encoder encoder = new org.geotools.xsd.Encoder(configuration); - encoder.encode( filter, org.geotools.filter.v1_0.OGC.FILTER, outputstream ); + encoder.encode(filter, org.geotools.filter.v1_0.OGC.FILTER, outputstream); For these examples to work you will need a dependency on *gt-xml*. -* Earlier we covered the use FeatureIterator to sift through the contents of a FeatureCollection. - Using this idea with **Query** allows you to work with just the geometry when determining the +* Earlier we covered the use ``FeatureIterator`` to sift through the contents of a ``FeatureCollection``. + Using this idea with ``Query`` allows you to work with just the geometry when determining the center of a collection of features. .. literalinclude:: /../src/main/java/org/geotools/tutorial/filter/QueryLab.java @@ -308,66 +312,61 @@ Filter CQL is defined in OGC Catalog specification; the standard comes from library science. -To request information from a FeatureSource we are going to need to describe (or select) what -information we want back. The data structure we use for this is called a Filter. +To request information from a ``FeatureSource`` we are going to need to describe (or select) what +information we want back. The data structure we use for this is called a ``Filter``. -We have a nice parser in GeoTools that can be used to create a Filter in a human readable form: +We have a nice parser in GeoTools that can be used to create a ``Filter`` in a human readable form: .. code-block:: java Filter filter = CQL.toFilter("POPULATION > 30000"); We can also make spatial filters using CQL |hyphen| geometry is expressed using the same Well Known Text -format employed earlier for JTS Geometry: +format employed earlier for JTS Geometry:: -.. code-block:: java Filter pointInPolygon = CQL.toFilter("CONTAINS(THE_GEOM, POINT(1 2))"); Filter clickedOn = CQL.toFilter("BBOX(ATTR1, 151.12, 151.14, -33.5, -33.51)"; -You may also skip CQL and make direct use of a FilterFactory: +You may also skip CQL and make direct use of a ``FilterFactory``: .. code-block:: java - FilterFactory ff = CommonFactoryFinder.getFilterFactory( null ); + FilterFactory ff = CommonFactoryFinder.getFilterFactory(null); - Filter filter = ff.propertyGreaterThan( ff.property( "POPULATION"), ff.literal( 12 ) ); - -Your IDE should provide command completion allowing you to quickly see what is available from -FilterFactory. + Filter filter = ff.propertyGreaterThan(ff.property("POPULATION"), ff.literal(12)); -Note, filter is a real live java object that you can use do to work: +Your IDE should provide command completion allowing you to quickly see what is available from ``FilterFactory``. -.. code-block:: java +Note, filter is a real live java object that you can use to do work:: - if( filter.evaluate( feature ) ){ - System.out.println( "Selected "+ feature.getId(); + if(filter.evaluate(feature)){ + System.out.println("Selected "+ feature.getId(); } -The implementation in GeoTools is very flexible and able to work on Features, HashMaps and -JavaBeans. +The implementation in GeoTools is very flexible and able to work on ``Features``, ``HashMaps`` and ``JavaBeans``. .. HINT:: - You may have noticed that Filter is actually an interface. Because the Filter data structure is - defined by a specification we cannot support the definition of new kinds of Filter objects and + You may have noticed that ``Filter`` is actually an interface. Because the ``Filter`` data structure is + defined by a specification we cannot support the definition of new kinds of ``Filter`` objects and expect them to be understood by the external services we communicate with. - The good news is that Filter can be extended with new Functions; and our implementation can be - taught how to work on new kinds of data using *PropertyAccessors*. + The good news is that ``Filter`` can be extended with new ``Functions``; and our implementation can be + taught how to work on new kinds of data using ``PropertyAccessors``. Expression ---------- You may have missed it in the last section; but we also described how to access data using an -expression. +``Expression``. Here are some examples: .. code-block:: java - ff.property( "POPULATION" ); // expression used to access the attribute POPULATION from a feature - ff.literal( 12 ); // the number 12 + ff.property("POPULATION"); // expression used to access the attribute POPULATION from a feature + ff.literal(12); // the number 12 You can also make function calls using the expression library. @@ -375,44 +374,43 @@ Here are some examples: .. code-block:: java - CQL.toExpression("buffer( THE_GEOM)"); - CQL.toExpression("strConcat( CITY_NAME, POPULATION)"); - CQL.toExpression("distance( THE_GEOM, POINT(151.14,-33.51) )"); + CQL.toExpression("buffer(THE_GEOM)"); + CQL.toExpression("strConcat(CITY_NAME, POPULATION)"); + CQL.toExpression("distance(THE_GEOM, POINT(151.14,-33.51))"); Query ----- -The Query data structure is used to offer finer grain control on the results returned. The -following query will request THE_GEOM and POPULATION from a FeatureSource "cities": +The ``Query`` data structure is used to offer finer grain control on the results returned. The +following query will request ``THE_GEOM`` and ``POPULATION`` from a ``FeatureSource`` "cities": .. code-block:: java - Query query = new Query( "cities", filter, new String[]{ "THE_GEOM", "POPULATION" } ); + Query query = new Query("cities", filter, new String[]{ "THE_GEOM", "POPULATION" }); FeatureCollection ----------------- -Previously we added features to a FeatureCollection during the Csv2Shp example. This was easy as the -FeatureCollection was in memory at the time. When working with spatial data we try to not have a -FeatureCollection in memory because spatial data gets big in a hurry. +Previously we added features to a ``FeatureCollection`` during the CSV2SHP example. This was easy as the +``FeatureCollection`` was in memory at the time. When working with spatial data we try to not have a +``FeatureCollection`` in memory because spatial data gets big in a hurry. -Special care is needed when stepping through the contents of a FeatureCollection with a -FeatureIterator. A FeatureIterator will actually be streaming the data off disk and we need to +Special care is needed when stepping through the contents of a ``FeatureCollection`` with a +``FeatureIterator``. A ``FeatureIterator`` will actually be streaming the data off disk and we need to remember to close the stream when we are done. -Even though a FeatureCollection is a :code:`Collection` it is very lazy and does not load +Even though a ``FeatureCollection`` is a :code:`Collection` it is very lazy and does not load anything until you start iterating through the contents. -The closest Java concepts I have to FeatureCollection and FeatureIterator come from JDBC as show -below. - - ================== ==================== - GeoTools JDBC - ================== ==================== - FeatureSource View - FeatureStore Table - FeatureCollection PreparedStatement - FeatureIterator ResultSet - ================== ==================== +The closest Java concepts I have to ``FeatureCollection`` and ``FeatureIterator`` come from JDBC as shown below. + + ====================== ==================== + GeoTools JDBC + ====================== ==================== + ``FeatureSource`` ``View`` + ``FeatureStore`` ``Table`` + ``FeatureCollection`` ``PreparedStatement`` + ``FeatureIterator`` ``ResultSet`` + ====================== ==================== If that is too much just remember |hyphen| please close your feature iterator when you are done. If not you will leak resources and get into trouble. diff --git a/docs/user/tutorial/function.rst b/docs/user/tutorial/function.rst index 8f70ce83a57..7d23b7c792e 100644 --- a/docs/user/tutorial/function.rst +++ b/docs/user/tutorial/function.rst @@ -5,7 +5,7 @@ Function Tutorial ----------------- -Adding a Function to GeoTools a very useful introduction to extending the library. This is often +Adding a ``Function`` to GeoTools a very useful introduction to extending the library. This is often used to generate values when styling that you cannot otherwise accomplish using expressions. SnapFunction @@ -16,32 +16,33 @@ SnapFunction .. literalinclude:: /../src/main/java/org/geotools/tutorial/function/SnapFunction.java :language: java -2. The mechanics of using a LocationIndexLine are covered in :doc:`/library/jts/snap` +2. The mechanics of using a ``LocationIndexLine`` are covered in :doc:`/library/jts/snap` if you are interested. -3. One thing to notice is the definition of FunctionName used to describe valid parameters to +3. One thing to notice is the definition of ``FunctionName`` used to describe valid parameters to user of our new function. - By convention we define this as a static final SnapFunction.NAME, this is however only a + By convention we define this as a static final ``SnapFunction.NAME``, this is however only a convention (which will help in implementing the next section). -4. Create ExampleFunctionFactory implementing FunctionFactory +4. Create ``ExampleFunctionFactory`` implementing ``FunctionFactory`` 5. Fill in the information as shown: .. literalinclude:: /../src/main/java/org/geotools/tutorial/function/ExampleFunctionFactory.java :language: java -6. We make reference to the static final SnapFunction.NAME. +6. We make reference to the static final ``SnapFunction.NAME``. While we mentioned this as only a convention, you are free to create a - new new FunctionNameImpl("snap", "point", "line") as part of the getFunctionNames() method. - This has the advantage of avoiding loading SnapFunction until a user requests it by name. + new ``FunctionNameImpl("snap", "point", "line")`` as part of the + ``getFunctionNames()`` method. + This has the advantage of avoiding loading ``SnapFunction`` until a user requests it by name. 7. We can now register our factory by adding a file to our jar under :file:`META-INF/services/`. - Create the following file for inclusion in your jar:: + Create the following file for inclusion in your jar: - * src/main/resources/META-INF/services/org.geotools.filter.FunctionFactory + * ``src/main/resources/META-INF/services/org.geotools.filter.FunctionFactory`` Maven collections the contents of :file:`src/main/resources` into our jar, @@ -49,7 +50,7 @@ SnapFunction org.geotools.tutorial.function.ExampleFunctionFactory -9. That is it SnapFunction is now published! +9. That is it ``SnapFunction`` is now published! You can use the "snap" function from your SLD documents; or in normal java programs. @@ -59,40 +60,40 @@ Things to Try * Create a quick test case to show that the above function is available using:: FilterFactory ff = CommonFactoryFinder.getFilterFactory(); - Expression expr = ff.function( "snap", ff.property("the_geom"), ff.literal( lines ) ); + Expression expr = ff.function("snap", ff.property("the_geom"), ff.literal(lines)); -* The function should be very slow as written (when called to snap thousands of points). +* The function will be very slow as written (when called to snap thousands of points). - Have a check if you can detect the use of a literal MultiLineStinrg; and cache your - LocationIndexedLine between calls to the function. A lot of GeoTools functions have been - optimised in this fashion. + Have a check if you can detect the use of a literal ``MultiLineStinrg``; and cache your + ``LocationIndexedLine`` between calls to the function. A lot of GeoTools functions have been + optimized in this fashion. * A fair bit of the code above is "boilerplate" and could be simplified with an appropriate - "AbstractFunction" class. + ``AbstractFunction`` class. - GeoTools does provide a couple Abstract classes you can extend when defining your own functions. - Have a look **FunctionImpl** and see if you find it easier then just starting from scratch. + GeoTools does provide a couple abstract classes you can extend when defining your own functions. + Have a look ``FunctionImpl`` and see if you find it easier then just starting from scratch. * Functions are used to process their parameters and produce an answer:: public Object evaluate(Object feature) { Expression geomExpression = parameters.get(0); - Geometry geom = geomExpression.evaulate( feature, Geometry.class ); + Geometry geom = geomExpression.evaulate(feature, Geometry.class); return geom.centroid(); } - When a function is used as part of a Style users often want to calculate a value based - on the attributes of the Feature being drawn. The Expression PropertyName is used in this - fashion to extract values out of a Feature and pass them into the function for evaluation + When a function is used as part of a ``Style`` users often want to calculate a value based + on the attributes of the Feature being drawn. The ``Expression`` ``PropertyName`` is used in this + fashion to extract values out of a ``Feature`` and pass them into the function for evaluation - **IMPORTANT**: When using your function with a Style we try and be efficient. If the style - calls your function without any reference to PropertyName it will only be called once. + **IMPORTANT**: When using your function with a ``Style`` we try and be efficient. If the style + calls your function without any reference to ``PropertyName`` it will only be called once. The assumption is that the function will produce the same value each time it is called, and thus will produce the same value for all features. By only calling the function once (and remembering the result) the rendering engine is able to perform much faster. - If this is not the functionality you are after please implement **VolatileFunction**:: + If this is not the functionality you are after please implement ``VolatileFunction``:: public class MagicFunction extends FunctionExpressionImpl implements VolatileFunction { Random random; @@ -118,7 +119,7 @@ Function ^^^^^^^^ Normally we have a little background information on the concepts covered; in this case there is an -article on how GeoTools uses Factories; and the steps to consider when creating your own +article on how GeoTools uses factories; and the steps to consider when creating your own factory system for others to use. * :doc:`factory` diff --git a/docs/user/tutorial/geometry/geometrycrs.rst b/docs/user/tutorial/geometry/geometrycrs.rst index 6ea00986a53..a4820be34fb 100644 --- a/docs/user/tutorial/geometry/geometrycrs.rst +++ b/docs/user/tutorial/geometry/geometrycrs.rst @@ -13,7 +13,7 @@ Welcome ========= -Welcome to Geospatial for Java. This workbook is aimed at Java developers who +Welcome to geospatial for Java. This workbook is aimed at Java developers who are new to geospatial and would like to get started. .. _quickstarts: ../quickstart/index.html @@ -37,21 +37,21 @@ This tutorial gives a visual demonstration of coordinate reference systems by displaying a shapefile and shows how changing the map projection morphs the geometry of the features. -1. Please ensure your pom.xml includes the following: +1. Please ensure your ``pom.xml`` includes the following: .. literalinclude:: ./artifacts/pom.xml :language: xml :start-after: :end-before: -2. Create the package **org.geotools.tutorial.crs** and class **CRSLab.java** file and copy and paste the following code: +2. Create the package ``org.geotools.tutorial.crs`` and class ``CRSLab.java`` file and copy and paste the following code: .. literalinclude:: /../src/main/java/org/geotools/tutorial/crs/CRSLab.java :language: java :start-after: // docs start source :end-before: // docs end main -3. Notice that we are customizing the JMapFrame by adding two buttons to its +3. Notice that we are customizing the ``JMapFrame`` by adding two buttons to its toolbar: one to check that feature geometries are valid (e.g. polygon boundaries are closed) and one to export reprojected feature data. @@ -60,7 +60,7 @@ the geometry of the features. :start-after: // docs start display :end-before: // docs end display -4. Here is how we have configured JMapFrame: +4. Here is how we have configured ``JMapFrame``: * We have enabled a status line; this contains a button allowing the map coordinate reference system to be changed. @@ -74,7 +74,7 @@ Validate Geometry Our toolbar action is implemented as a nested class, with most of the work being done by a helper method in the parent class. -1. Create the **ValidateGeometryAction** mentioned in the previous section +1. Create the ``ValidateGeometryAction`` mentioned in the previous section as an inner class. .. literalinclude:: /../src/main/java/org/geotools/tutorial/crs/CRSLab.java @@ -93,7 +93,7 @@ done by a helper method in the parent class. Export Reprojected Shapefile ----------------------------- -.. sidebar:: FeatureIterator +.. sidebar:: ``FeatureIterator`` Please close feature iterator after use to prevent resource leaks. @@ -101,16 +101,16 @@ The next action will form a little utility that can read in a shapefile and write out a shapefile in a different coordinate reference system. One important thing to pick up from this lab is how easy it is to create a -MathTransform between two CoordinateReferenceSystems. You can use the -MathTransform to transform points one at a time; or use the JTS utility class -to create a copy of a Geometry with the points modified. +``MathTransform`` between two ``CoordinateReferenceSystems``. You can use the +``MathTransform`` to transform points one at a time; or use the ``JTS`` utility class +to create a copy of a ``Geometry`` with the points modified. -We use similar steps to export a shapefile as used by the Csv2Shape example. +We use similar steps to export a shapefile as used by the CSV2SHAPE example. In this case we are reading the contents from an existing shapefile using -a **FeatureIterator**; and writing out the contents one at a time -using a **FeatureWriter**. Please close these objects after use. +a ``FeatureIterator``; and writing out the contents one at a time +using a ``FeatureWriter``. Please close these objects after use. -1. The action is a nested class that delegates to the exportToShapefile +1. The action is a nested class that delegates to the ``exportToShapefile`` method in the parent class. .. literalinclude:: /../src/main/java/org/geotools/tutorial/crs/CRSLab.java @@ -139,9 +139,9 @@ using a **FeatureWriter**. Please close these objects after use. :start-after: // grab all features :end-before: // And create a new Shapefile with a slight modified schema -5. To create a new shapefile we will need to produce a FeatureType that is +5. To create a new shapefile we will need to produce a ``FeatureType`` that is similar to our original. The only difference will be the - CoordinateReferenceSystem of the geometry descriptor. + ``CoordinateReferenceSystem`` of the geometry descriptor. .. literalinclude:: /../src/main/java/org/geotools/tutorial/crs/CRSLab.java :language: java @@ -163,7 +163,7 @@ To switch between map projections: 1. When you start the application you will be prompted for a shapefile to display. In the screenshots below we are using the *bc_border* map which can be - downloaded as part of the `uDig sample dataset `_ + downloaded as part of the `uDig sample data set `_ .. image:: images/CRSLab_start.png :width: 60% @@ -172,7 +172,7 @@ To switch between map projections: EPSG reference numbers. For our example shapefile, an appropriate alternative map projection is *BC Albers*. - You can find this quickly in the chooser list by typing 3005. + You can find this quickly in the chooser list by typing **3005**. When you click OK the map is displayed in the new projection: @@ -190,8 +190,7 @@ To switch between map projections: Exporting the reprojected data: -1. When you change the map projection for the display the shapefile remains - unchanged. +1. When you change the map projection for the display the data in the shapefile remains unchanged. With the *bc_border* shapefile, the feature data are still in degrees but when we select the *BC Albers* projection the features are reprojected on @@ -200,7 +199,7 @@ Exporting the reprojected data: 2. Set the display of reprojected data (e.g. 3005 BC Albers for the *bc_border* shapefile). -3. Click the *Validate geometry* button to check feature geometries are ok. +3. Click the *Validate geometry* button to check feature geometries are OK. 4. If there are no geometry problems, click the *Export* button and enter a name and path for the new shapefile. @@ -215,12 +214,12 @@ Here are a couple things to try with the above application. * Make a button to print out the map coordinate reference system as human readable "Well Known Text". This is the same text format used by a - shapefile's "prj" side car file. + shapefile's ``prj`` side car file. -* It is bad manners to keep the user waiting; the SwingWorker class is part of +* It is bad manners to keep the user waiting; the ``SwingWorker`` class is part of Java. - Replace your ValidateGeometryAction with the following: + Replace your ``ValidateGeometryAction`` with the following: .. literalinclude:: /../src/main/java/org/geotools/tutorial/crs/CRSLab.java :language: java @@ -236,19 +235,19 @@ Here are a couple things to try with the above application. .. _TopologyPreservingSimplifier: https://locationtech.github.io/jts/javadoc/org/locationtech/jts/simplify/TopologyPreservingSimplifier.html .. _DouglasPeuckerSimplifier: https://locationtech.github.io/jts/javadoc/org/locationtech/jts/simplify/DouglasPeuckerSimplifier.html - This exercise is a common form of data preparation. +This exercise is a common form of data preparation. * One thing that can be dangerous about geometry, especially ones you make yourself, is that they can be invalid. There are many tricks to fixing an invalid geometry. An easy place to start - is to use geometry.buffer(0). Use this tip to build your own shapefile + is to use ``geometry.buffer(0)``. Use this tip to build your own shapefile data cleaner. * An alternate to doing all the geometry transformations by hand is to ask for the data in the projection required. - This version of the export method shows how to use a **Query** object to + This version of the export method shows how to use a ``Query`` object to retrieve reprojected features and write them to a new shapefile instead of transforming the features 'by hand' as we did above. @@ -269,8 +268,8 @@ several representations of the same thing. We can represent the city of Sydney: -* as a single location, ie. a point -* as the city limits (so you can tell when you are inside Sydney), ie. a polygon +* as a single location, i.e. a point +* as the city limits (so you can tell when you are inside Sydney), i.e. a polygon Point ----- @@ -278,38 +277,38 @@ Here is an example of creating a point using the Well-Known-Text (WKT) format. .. code-block:: java - GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory( null ); + GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory(null); - WKTReader reader = new WKTReader( geometryFactory ); + WKTReader reader = new WKTReader(geometryFactory); Point point = (Point) reader.read("POINT (1 1)"); -You can also create a Point by hand using the GeometryFactory directly. +You can also create a ``Point`` by hand using the ``GeometryFactory`` directly. .. code-block:: java - GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory( null ); - Coordinate coord = new Coordinate( 1, 1 ); - Point point = geometryFactory.createPoint( coord ); + GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory(null); + Coordinate coord = new Coordinate(1, 1); + Point point = geometryFactory.createPoint(coord); Line ---- -Here is an example of a WKT LineString. +Here is an example of a WKT ``LineString``. .. code-block:: java - GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory( null ); + GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory(null); - WKTReader reader = new WKTReader( geometryFactory ); + WKTReader reader = new WKTReader(geometryFactory); LineString line = (LineString) reader.read("LINESTRING(0 2, 2 0, 8 6)"); -A LineString is a sequence of segments in the same manner as a java String is a +A ``LineString`` is a sequence of segments in the same manner as a java String is a sequence of characters. -Here is an example using the Geometry Factory. +Here is an example using the ``GeometryFactory``. .. code-block:: java - GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory( null ); + GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory(null); Coordinate[] coords = new Coordinate[] {new Coordinate(0, 2), new Coordinate(2, 0), new Coordinate(8, 6) }; @@ -320,37 +319,37 @@ Here is an example using the Geometry Factory. Polygon ------- -A polygon is formed in WKT by constructing an outer ring, and then a series of holes. +A ``Polygon`` is formed in WKT by constructing an outer ring, and then a series of holes. .. code-block:: java - GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory( null ); - WKTReader reader = new WKTReader( geometryFactory ); + GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory(null); + WKTReader reader = new WKTReader(geometryFactory); Polygon polygon = (Polygon) reader.read("POLYGON((20 10, 30 0, 40 10, 30 20, 20 10))"); Why not use Java Shape ---------------------- -Java Shape is actually very useful and covers ideas mentioned above – it is -however very focused on drawing. Geometry allows us to handle the "information" +Java ``Shape`` is actually very useful and covers ideas mentioned above – it is +however very focused on drawing. ``Geometry`` allows us to handle the "information" part of Geographic Information System – we can use it to create new geometry and test the relationships between geometries. .. code-block:: java // Create Geometry using other Geometry - Geometry smoke = fire.buffer( 10 ); - Geometry evacuate = cities.intersection( smoke ); + Geometry smoke = fire.buffer(10); + Geometry evacuate = cities.intersection(smoke); // test important relationships - boolean onFire = me.intersects( fire ); - boolean thatIntoYou = me.disjoint( you ); - boolean run = you.isWithinDistance( fire, 2 ); + boolean onFire = me.intersects(fire); + boolean thatIntoYou = me.disjoint(you); + boolean run = you.isWithinDistance(fire, 2); // relationships actually captured as a fancy // String called an intersection matrix // - IntersectionMatrix matrix = he.relate( you ); + IntersectionMatrix matrix = he.relate(you); thatIntoYou = matrix.isDisjoint(); // it really is a fancy string; you can do @@ -364,18 +363,18 @@ You are encouraged to read the javadocs for JTS which contains helpful definitio The disjoint predicate has the following equivalent definitions: * The two geometries have no point in common - * The DE-9IM Intersection Matrix for the two geometries is FF*FF**** - * !g.intersects(this) (disjoint is the inverse of intersects) + * The DE-9IM Intersection Matrix for the two geometries is ``FF*FF****`` + * ``!g.intersects(this)`` (disjoint is the inverse of intersects) Coordinate Reference System =========================== Earlier we talked about the JTS library which provides our data model for -Geometry. This is the real rocket science for map making – the idea of a shape +``Geometry.`` This is the real rocket science for map making – the idea of a shape and enough math to do something fun with it. But there is one question we have not answered yet – what does a geometry mean? -You may think I am joking but the question is serious. A Geometry is just a +You may think I am joking but the question is serious. A ``Geometry`` is just a bunch of math (a set of points in the mathematical sense). They have no meaning on their own. @@ -383,7 +382,7 @@ An easier example is the number 3. The number 3 has no meaning on its own. It is only when you attach a "unit" that the number 3 can represent a concept. 3 metres. 3 feet. 3 score years. -In order to provide a Geometry with meaning we need to know what those +In order to provide a ``Geometry`` with meaning we need to know what those individual points mean. We need to know where they are located – and the data structure that tells us this is called the Coordinate Reference System. @@ -392,8 +391,8 @@ concepts for us: * It defines the axis used – along with the units of measure. - So you can have lat measured in degrees , and lon measured in degrees from the - equator. + So you can have latitude measured in degrees from the Equator, and longitude measured in degrees from the + Greenwich meridian. Or you can have x measured in metres, and y measured in metres which is very handy for calculating distances or areas. @@ -407,7 +406,7 @@ concepts for us: As a programmer I view the coordinate reference system idea as a neat hack. Everyone is really talking about points in 3D space here – and rather than having to record x,y,z all the time we are cheating and only recording two -points (lat,lon) and using a model of the shape of the earth in order to +points ``(lat,lon)`` and using a model of the shape of the Earth in order to calculate z. EPSG Codes @@ -423,14 +422,14 @@ EPSG:4326 .. image:: images/epsg4326.png :scale: 30 - This is the big one: information measured by lat/lon using decimal degrees. + This is the big one: information measured by latitude/longitude using decimal degrees. ``CRS.decode("EPSG:4326");`` - `DefaultGeographicCRS.WGS84;`` + ``DefaultGeographicCRS.WGS84;`` EPSG: 3785 - Popular Visualisation CRS / Mercator + Popular Visualization CRS / Mercator .. image:: images/epsg3785.png :scale: 30 @@ -453,11 +452,10 @@ EPSG:3005 ``CRS.decode("EPSG:3005");`` - Axis Order ---------- -.. sidebar:: Why +.. sidebar:: Why? When navigating by stars you can figure out latitude by the angle to the north star – but you need to guess for longitude based on how many days you @@ -481,7 +479,7 @@ So if you see some data in "EPSG:4326" you have no idea if it is in x/y order or in y/x order. We have finally sorted out an alternative; rather than EPSG:4326 we are supposed -to use "urn:ogc:def:crs:EPSG:6.6:4326". If you ever see that you can be sure +to use ``urn:ogc:def:crs:EPSG:6.6:4326``. If you ever see that you can be sure that a) someone really knows what they are doing and b) the data is recorded in exactly the order defined by the EPSG database. @@ -495,7 +493,7 @@ You can perform a workaround on a case by case basis:: Or you can set a global hint to force GeoTools to use x/y order:: - static void main( String args []){ + static void main(String args []){ System.setProperty("org.geotools.referencing.forceXY", "true"); .... @@ -506,7 +504,7 @@ For more Information `EPSG registry `_ This is *the* place to go to look up map projections. You can search by - geographic area, name and type and epsg code. + geographic area, name and type and EPSG code. `spatialreference.org `_ An easy to use service listing EPSG and OGC references code showing their representation in different software products. diff --git a/docs/user/tutorial/map/style.rst b/docs/user/tutorial/map/style.rst index a6a0a74c508..a292ee9abc4 100644 --- a/docs/user/tutorial/map/style.rst +++ b/docs/user/tutorial/map/style.rst @@ -17,7 +17,7 @@ Style is all about looking good. In this lab we are going to learn the basics of Style ====== -Please ensure your pom.xml includes the following: +Please ensure your ``pom.xml`` includes the following: .. literalinclude:: ./artifacts/pom.xml :language: xml @@ -35,7 +35,7 @@ The example code is available Main Application ---------------- -1. Create the package **org.geotools.tutorial.style** and class **StyleLab** . +1. Create the package ``org.geotools.tutorial.style`` and class ``StyleLab`` . 2. Copy and paste in the following code: .. literalinclude:: /../src/main/java/org/geotools/tutorial/style/StyleLab.java @@ -53,14 +53,14 @@ If you have worked through the previous labs, most of this method will look fami :start-after: // docs start display :end-before: // docs end display -The main thing to note is that we are calling a **createStyle** method to set a Style for the map layer. +The main thing to note is that we are calling a ``createStyle`` method to set a Style for the map layer. Let's look at this method next. Creating a style ---------------- This method first looks to see if there is an SLD document (Styled Layer Descriptor) associated with the shapefile. -If it finds one it processes that file to create the style. Otherwise, it displays a **JSimpleStyleDialog** to +If it finds one it processes that file to create the style. Otherwise, it displays a ``JSimpleStyleDialog`` to prompt the user for style choices: .. literalinclude:: /../src/main/java/org/geotools/tutorial/style/StyleLab.java @@ -80,11 +80,11 @@ Creating styles By Hand ------------------------ The methods that we've looked at so far are all we really need in this simple application. But now let's look at how to create a style programmatically. -This illustrates some of what is happening behind the scenes in the previous code. It also introduces you to **StyleFactory** and **FilterFactory** +This illustrates some of what is happening behind the scenes in the previous code. It also introduces you to ``StyleFactory`` and ``FilterFactory`` which provide a huge amount of flexibility in the styles that you can create. In the code below, the first method works out what type of geometry we have in our shapefile: points, lines or polygons. It then calls a geometry-specific -method to create a Style object. +method to create a ``Style`` object. .. literalinclude:: /../src/main/java/org/geotools/tutorial/style/StyleLab.java :language: java @@ -93,29 +93,29 @@ method to create a Style object. Things to note: -* Each of the geometry specific methods is creating a type of **Symbolizer**: the class that controls how features are rendered -* Each method wraps the symbolizer in a **Rule**, then a **FeatureTypeStyle**, and finally a **Style** -* In real life, it is common to have more than one Rule in a FeatureTypeStyle. For example, we might create one rule to draw features when the +* Each of the geometry specific methods is creating a type of ``Symbolizer``: the class that controls how features are rendered +* Each method wraps the symbolizer in a ``Rule``, then a ``FeatureTypeStyle``, and finally a ``Style`` +* In real life, it is common to have more than one ``Rule`` in a ``FeatureTypeStyle``. For example, we might create one rule to draw features when the map is zoomed out, and another for when we are displaying fine details. Selection ========== This tutorial brings together many of the techniques and classes that we've covered in the previous -examples. It is best if you have already worked through at least the quickstart, csv2shp and style +examples. It is best if you have already worked through at least the quickstart, CSV2SHP and style tutorials. We are going to: * Create a custom map cursor tool to select features when the user clicks the map - * Add a toolbar button to JMapFrame to launch this tool + * Add a toolbar button to ``JMapFrame`` to launch this tool * Use a Filter to find which features were under, or near the mouse click - * Create rendering styles to draw selected and unselected features in different colours + * Create rendering styles to draw selected and unselected features in different colors Dependencies ------------ -Please ensure your pom.xml includes the following:: +Please ensure your ``pom.xml`` includes the following:: 14.0 @@ -150,7 +150,7 @@ The example code is available Main Application ---------------- -1. Please create the file **SelectionLab.java** +1. Please create the file ``SelectionLab.java`` 2. Copy and paste in the following code: .. literalinclude:: /../src/main/java/org/geotools/tutorial/style/SelectionLab.java @@ -161,13 +161,13 @@ Main Application Much of this should look familiar to you from the style tutorial. We've added some constants and class variables that we'll use when creating styles. -A subtle difference is that we are now using FilterFactory2 instead of FilterFactory. This class +A subtle difference is that we are now using ``FilterFactory2`` instead of ``FilterFactory``. This class adds additional methods, one of which we'll need when selecting features based on a mouse click. Shapefile viewer with custom map tool ------------------------------------- -Next we add the displayShapefile method which is also very similar to the one that we used in +Next we add the ``displayShapefile`` method which is also very similar to the one that we used in style tutorial. .. literalinclude:: /../src/main/java/org/geotools/tutorial/style/SelectionLab.java @@ -175,8 +175,8 @@ style tutorial. :start-after: // docs start display shapefile :end-before: // docs end display shapefile -Note that we are customizing the JMapFrame by adding a button to its toolbar. When the user clicks this button a new -**CursorTool** is set for the map window. This tool has just one method that responds to a mouse click in the map area. +Note that we are customizing the ``JMapFrame`` by adding a button to its toolbar. When the user clicks this button a new +``CursorTool`` is set for the map window. This tool has just one method that responds to a mouse click in the map area. What features did the user click on ? ------------------------------------- @@ -184,7 +184,7 @@ What features did the user click on ? Next we'll add the method that is called when the user is in selection mode. Our custom toolbar button has been pressed, and the user has now clicked somewhere on the map. -The method first creates a 5x5 pixel wide rectangle around the mouse position to make it easier to +The method first creates a ``5x5`` pixel wide rectangle around the mouse position to make it easier to select point and line features. This is transformed from pixel coordinates to world coordinates and used to create a Filter to identify features under, or close to, the mouse click. @@ -200,15 +200,15 @@ this example... .. image:: images/selectionlab-bbox.png -The blue shapes are parts of a single MultiPolygon which is the standard geometry type for polygonal features in +The blue shapes are parts of a single ``MultiPolygon`` which is the standard geometry type for polygonal features in shapefiles. Using a bounding box filter, clicking in the orange shape would select it plus all of the blue shapes -because the click region is within their envelope (the grey rectangle). +because the click region is within their envelope (the gray rectangle). Creating a Style based on the selection --------------------------------------- -Once the method above has worked out which features were selected, if any, it passes their FeatureIds to the -**displaySelected** method. This calls one of two Style creating methods and then redisplays the map with the +Once the method above has worked out which features were selected, if any, it passes their ``FeatureIds`` to the +``displaySelected`` method. This calls one of two Style creating methods and then redisplays the map with the updated Style: .. literalinclude:: /../src/main/java/org/geotools/tutorial/style/SelectionLab.java @@ -219,7 +219,7 @@ updated Style: The default style ~~~~~~~~~~~~~~~~~ -This method creates a Style with a single **Rule** for all features using the line and fill constants defined at the top +This method creates a Style with a single ``Rule`` for all features using the line and fill constants defined at the top of the class: .. literalinclude:: /../src/main/java/org/geotools/tutorial/style/SelectionLab.java @@ -230,25 +230,25 @@ of the class: The selected style ~~~~~~~~~~~~~~~~~~ -This method creates a Style with one **Rule** for selected features, to paint them in a -highlight colour, and a second **Rule** for unselected features. Both rules are then wrapped in the Style object. +This method creates a Style with one ``Rule`` for selected features, to paint them in a +highlight color, and a second ``Rule`` for unselected features. Both rules are then wrapped in the ``Style`` object. .. literalinclude:: /../src/main/java/org/geotools/tutorial/style/SelectionLab.java :language: java :start-after: // docs start selected style :end-before: // docs end selected style -Note that the first Rule includes a **Filter**, created with the **FilterFactory2.id** method. This means the rule will +Note that the first Rule includes a ``Filter``, created with the ``FilterFactory2.id`` method. This means the rule will only apply to the selected features. -The second rule is flagged as an *alternative* (applies to all other features) with the **setElseFilter** method. +The second rule is flagged as an *alternative* (applies to all other features) with the ``setElseFilter`` method. Creating a Rule and Symbolizer ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ OK, we're nearly at the end ! -Here is the method **createRule**. This is where the **Symbolizer** is created that describes how to draw a feature. +Here is the method ``createRule``. This is where the ``Symbolizer`` is created that describes how to draw a feature. .. literalinclude:: /../src/main/java/org/geotools/tutorial/style/SelectionLab.java :language: java @@ -258,8 +258,8 @@ Here is the method **createRule**. This is where the **Symbolizer** is created t Geometry type of the shapefile features --------------------------------------- -Finally (yes, really) the createRule method above needs to know what sort of feature geometry we are dealing with to -create the appropriate class of Symbolizer. Here is the method that works that out: +Finally (yes, really) the ``createRule`` method above needs to know what sort of feature geometry we are dealing with to +create the appropriate class of ``Symbolizer``. Here is the method that works that out: .. literalinclude:: /../src/main/java/org/geotools/tutorial/style/SelectionLab.java :language: java @@ -269,7 +269,7 @@ create the appropriate class of Symbolizer. Here is the method that works that o Running the application ----------------------- -Here is the program displaying the **bc_voting_areas** shapefile (included in the `uDig sample data`__) with one feature +Here is the program displaying the ``bc_voting_areas`` shapefile (included in the `uDig sample data`__) with one feature (polygon) selected: .. _udigdata: http://udig.refractions.net/docs/data-v1_2.zip @@ -281,17 +281,17 @@ __ udigdata_ Things to try ============== -In Geometry and CRS tutorial we saw how to change the Coordinate Reference System of a MapContent. +In the Geometry and CRS tutorial we saw how to change the Coordinate Reference System of a ``MapContent``. Try the following: * Modify this application so that you can change the CRS in which the features are displayed. -* Display the **bc_voting_areas** shapefile and change the CRS to EPSG:4326 +* Display the ``bc_voting_areas`` shapefile and change the CRS to EPSG:4326 * Now try to use the selection tool. You will find that it no longer works ! See if you can you figure out why the tool isn't working and how to fix it. There is actually some amazing style generation code included with GeoTools. Add a dependency -on the **gt-brewer** module and having a look at the **ColorBrewer class**. +on the ``gt-brewer`` module and having a look at the ``ColorBrewer class``. The class works by first asking you to calculate a *categorization* using one of the categorization functions on a feature collection; you can then pass the resulting categorization on to color brewer @@ -345,22 +345,22 @@ Rendering occurs in the following stages: * Portrayal: actual drawing * Composition: putting everything together -The first line of defence is |ldquo| FeatureTypeStyle |rdquo|, it makes use of a constraint to select what -FeatureType you want to work with. If you don't care use the FeatureType with the name `Feature` +The first line of defense is ``FeatureTypeStyle``, it makes use of a constraint to select what +``FeatureType`` you want to work with. If you don't care use the ``FeatureType`` with the name `Feature` as kind of a wild card (since everything extends `Feature`). Next up we have Rules. Rules actually use Filter (from the Filter tutorial) to perform strict -checks about what is going to get drawn. In addition to checking feature attributes with Filter, +checks about what is going to get drawn. In addition to checking feature attributes with ``Filter``, a Rule is able to check the current scale of the map. Finally there is an `Other` rule to catch any features left over from earlier Rules. -Now that a Rule has selected features for us to work with we can get down to drawing in the -Portrayal step. The renderer will go through a list of symbolizers (for a Rule) and draw the +Now that a ``Rule`` has selected features for us to work with we can get down to drawing in the +Portrayal step. The renderer will go through a list of ``Symbolizers`` (for a ``Rule``) and draw the results. The symbolizers are just a list of draw instructions to be done in order. The symbolizers use expressions to define width and color |hyphen| allowing you to dynamically generate the appearance on a feature by feature basis! -The only symbolizer which is not drawn in order is TextSymbolizer which gathers up text labels for +The only symbolizer which is not drawn in order is ``TextSymbolizer`` which gathers up text labels for the next step. Finally in the composition step |hyphen| will take all the content drawn during portrayal and squish diff --git a/docs/user/tutorial/process.rst b/docs/user/tutorial/process.rst index 6f5050c2dde..8a38e54ee0b 100644 --- a/docs/user/tutorial/process.rst +++ b/docs/user/tutorial/process.rst @@ -11,14 +11,14 @@ application (or publish out via a "web processing service" such as GeoServer or When used with a Process Engine these individual processes can be chained together to make for interesting and useful scripts. -This process data structure is a lot more capable than the Functions we added to the geotools filter +This process data structure is a lot more capable than the Functions we added to the GeoTools filter system and is able to work on large quantities of data as needed. The general idea is similar in that you get to write some simple java code and package it up for the GeoTools library to use. We have a number of options: -* Annotations -* DataStructure +* ``Annotations`` +* ``DataStructure`` Reference: @@ -30,7 +30,7 @@ Process Annotations This is the fastest way to create a process; and is great (as long as your process produces a single result). -1. Add a dependency on **gt-process** to your project:: +1. Add a dependency on ``gt-process`` to your project:: org.geotools @@ -38,7 +38,7 @@ single result). ${geotools.version} -2. To start with we need to create a class that extends StaticMethodsProcessFactory: +2. To start with we need to create a class that extends ``StaticMethodsProcessFactory``: .. literalinclude:: /../src/main/java/org/geotools/tutorial/process/ProcessTutorial.java :language: java @@ -57,11 +57,11 @@ single result). return new OctagonalEnvelope(geom).toGeometry(geom.getFactory()); } -5. And then we can fill in the annotations to desribe our process, result and parameters. +5. And then we can fill in the annotations to describe our process, result and parameters. - * @DescribeProcess - * @DescribeParameter - * @DescribeResult + * ``@DescribeProcess`` + * ``@DescribeParameter`` + * ``@DescribeResult`` .. literalinclude:: /../src/main/java/org/geotools/tutorial/process/ProcessTutorial.java :language: java @@ -72,18 +72,18 @@ single result). Create the file: - * META-INF/services/org.geotools.process.ProcessFactory + * ``META-INF/services/org.geotools.process.ProcessFactory`` 7. Fill in the following contents (one implementation class per line):: org.geotools.tutorial.process.ProcessTutorial -8. That is it octagnalEnvelope is now published. +8. That is it ``octagnalEnvelope`` is now published. Things to Try ^^^^^^^^^^^^^ -* Try calling your process using the *Processors* utility class +* Try calling your process using the ``Processors`` utility class .. literalinclude:: /../src/main/java/org/geotools/tutorial/process/ProcessExample.java :language: java @@ -94,8 +94,8 @@ Things to Try .. image:: images/octagonal_envelope.png -* The Processors class can also list a Map allowing you to show a wizard - for data entry (just like when connecting to a DataStore). +* The ``Processors`` class can also list a ``Map`` allowing you to show a wizard + for data entry (just like when connecting to a ``DataStore``). .. literalinclude:: /../src/main/java/org/geotools/tutorial/process/ProcessExample.java :language: java diff --git a/docs/user/tutorial/quickstart/eclipse.rst b/docs/user/tutorial/quickstart/eclipse.rst index c296cb0c335..86bab2e5054 100644 --- a/docs/user/tutorial/quickstart/eclipse.rst +++ b/docs/user/tutorial/quickstart/eclipse.rst @@ -52,7 +52,7 @@ Imaging and Java Image IO section. By default this will install to: - C:\\Program Files\\Java\\jdk1.8.0\\ + ``C:\\Program Files\\Java\\jdk1.8.0\\`` #. **Optional**: Java Advanced Imaging is used by GeoTools for raster support. If you install JAI 1.1.3 performance will be improved: @@ -61,8 +61,8 @@ Imaging and Java Image IO section. Both a JDK and JRE installer are available: - * jai-1_1_3-lib-windows-i586-jdk.exe - * jai-1_1_3-lib-windows-i586-jre.exe + * ``jai-1_1_3-lib-windows-i586-jdk.exe`` + * ``jai-1_1_3-lib-windows-i586-jre.exe`` #. **Optional**: ImageIO Is used to read and write raster files. GeoTools uses version 1_1 of the ImageIO library: @@ -71,8 +71,8 @@ Imaging and Java Image IO section. Both a JDK and JRE installer are available: - * jai_imageio-1_1-lib-windows-i586-jdk.exe - * jai_imageio-1_1-lib-windows-i586-jre.exe + * ``jai_imageio-1_1-lib-windows-i586-jdk.exe`` + * ``jai_imageio-1_1-lib-windows-i586-jre.exe`` For more details of how to install these packages see `this page `_ @@ -89,24 +89,23 @@ development. For this tutorial we are doing straight up Java programming using t download available - if you already have an Eclipse download please go ahead and use it and switch to the "Java Perspective". -1. Visit the Eclipse download page (http://www.eclipse.org/downloads/eclipse-packages/) and download "Eclipse IDE for - Java developers". +1. Visit the Eclipse download page (http://www.eclipse.org/downloads/eclipse-packages/) and download "Eclipse IDE for Java developers". 2. Eclipse now provides an installer; however this tutorial targets the binary packages that you simply extract and run. 3. To start out with create the folder C:\\java to keep all our java development in one spot. -4. Unzip the downloaded eclipse-java-mars-R-win32.zip file to your C:\\java directory - the - folder C:\\java\\eclipse will be created. -5. Navigate to C:\\java\\eclipse and right-click on the eclipse.exe file and select +4. Unzip the downloaded ``eclipse-java-mars-R-win32.zip`` file to your ``C:\\java`` directory - the + folder ``C:\\java\\eclipse`` will be created. +5. Navigate to ``C:\\java\\eclipse`` and right-click on the ``eclipse.exe`` file and select Send To -> Desktop (create shortcut). -6. Open up the eclipse.ini file. +6. Open up the ``eclipse.ini`` file. - * Use our JDK directly by providing a -vm argument + * Use our JDK directly by providing a ``-vm`` argument 7. Double click on your desktop shortcut to start up eclipse. 8. When you start up eclipse for the first time it will prompt you for a workspace. To keep our java work in one spot you can type in: - C:\\java\\workspace + ``C:\\java\\workspace`` 9. On the Welcome view press Workbench along the right hand side and we can get started @@ -160,22 +159,22 @@ To use M2E plugin to create a create a new maven project: #. The archetype acts a template using the parameters we supply to create the project. - * Group Id: org.geotools - * Artifact Id: tutorial - * Version: 0.0.1-SNAPSHOT (default) - * Package: org.geotools.tutorial + * Group Id: ``org.geotools`` + * Artifact Id: ``tutorial`` + * Version: ``0.0.1-SNAPSHOT`` (default) + * Package: ``org.geotools.tutorial`` .. image:: images/artifact.png :scale: 60 #. Press *Finish* to create the new project. -#. You can see that an application has been created; complete with *App.java* and a JUnit test case -#. Open up src/main/java and select *org.geotools.tutorial.App* and press the *Run* button in the +#. You can see that an application has been created; complete with ``App.java`` and a JUnit test case +#. Open up ``src/main/java`` and select ``org.geotools.tutorial.App`` and press the *Run* button in the toolbar:: Hello World! -#. You may also open up src/main/test and run *org.geotools.tutorial.AppTest* as a **JUnit Test**. +#. You may also open up ``src/main/test`` and run ``org.geotools.tutorial.AppTest`` as a **JUnit Test**. Adding Jars to your Project @@ -184,7 +183,7 @@ Adding Jars to your Project .. sidebar:: Lab We are going to cheat in order to save time; the local maven repository has already been - populated with the latest copy of geotools allowing us to use offline mode. + populated with the latest copy of GeoTools allowing us to use offline mode. To turn on offline mode: @@ -194,7 +193,7 @@ Adding Jars to your Project This setting is useful when wanting to work quickly once everything is downloaded. -The *pom.xml* file is used to describe the care and feeding of your maven project; we are going to +The ``pom.xml`` file is used to describe the care and feeding of your maven project; we are going to focus on the dependencies needed for your project When downloading jars maven makes use of a "local repository" to store jars. @@ -219,9 +218,9 @@ such as GeoTools publish their work. 2. This editor allows you to describe all kinds of things; in the interest of time we are going to skip the long drawn out explanation and ask you to click on the :guilabel:`pom.xml` tab. -3. To make use of GeoTools we are going to add three things to this pom.xml file. +3. To make use of GeoTools we are going to add three things to this ``pom.xml`` file. -4. At the top after moduleVersion add a *properties* element defining the version of GeoTools we +4. At the top after ``moduleVersion`` add a ``properties`` element defining the version of GeoTools we want to use. This workbook was written for |release| although you may wish to try a different version. @@ -232,7 +231,7 @@ such as GeoTools publish their work. :start-after: http://maven.apache.org :end-before: - To make use of a nightly build set the `geotools.version` property to |branch|-SNAPSHOT . + To make use of a nightly build set the ``geotools.version`` property to |branch|-SNAPSHOT . .. literalinclude:: artifacts/pom2.xml :language: xml @@ -246,7 +245,7 @@ such as GeoTools publish their work. :start-after: :end-before: -6. Finally we need to list the external *repositories* where maven can download GeoTools and and +6. Finally we need to list the external *repositories* where maven can download GeoTools and other required jars from. .. literalinclude:: artifacts/pom.xml @@ -256,7 +255,7 @@ such as GeoTools publish their work. .. note:: Note the snapshot repository above is only required if you are using a nightly build (such as |branch|-SNAPSHOT) -7. GeoTools now requires Java 8 language level features (eg. lambdas) - you need to tell Maven to use the 1.8 source level. +7. GeoTools now requires Java 8 language level features (e.g. lambdas) - you need to tell Maven to use the 1.8 source level. .. literalinclude:: artifacts/pom2.xml :language: xml @@ -283,7 +282,7 @@ Now that your environment is setup we can put together a simple Quickstart. This #. Create the package ``org.geotools.tutorial.quickstart`` using your IDE. -#. Create the org.geotools.tutorial.quickstart.Quickstart class using your IDE. +#. Create the ``org.geotools.tutorial.quickstart.Quickstart`` class using your IDE. .. image:: images/class.png :scale: 60 @@ -300,7 +299,7 @@ Now that your environment is setup we can put together a simple Quickstart. This Please unzip the above data into a location you can find easily such as the desktop. -#. Run the application to open a file chooser. Choose a shapefile from the example dataset. +#. Run the application to open a file chooser. Choose a shapefile from the example data set. .. image:: images/QuickstartOpen.png :scale: 60 @@ -330,7 +329,7 @@ Here are some additional challenges for you to try: * Try out the different sample data sets * You can zoom in, zoom out and show the full extents and Use the select tool to examine individual - countries in the sample countries.shp file + countries in the sample ``countries.shp`` file * Download the largest shapefile you can find and see how quickly it can be rendered. You should find that the very first time it will take a while as a spatial index is generated. After that @@ -348,17 +347,19 @@ Here are some additional challenges for you to try: :start-after: // docs start cache :end-before: // docs end cache + For the above example to compile hit :kbd:`Control-Shift-O` to organise imports. + .. The ability to grab figure out what classes to import is a key skill; we are starting off here with a simple example with a single import. * Try and sort out what all the different "side car" files are - and what they are for. The sample - data set includes "shp", "dbf" and "shx". How many other side car files are there? + data set includes ``shp``, ``dbf`` and ``shx``. How many other side car files are there? .. This exercise asks users to locate the geotools user guide or wikipedia -* Advanced: The use of FileDataStoreFinder allows us to work easily with files. The other way to do +* Advanced: The use of ``FileDataStoreFinder`` allows us to work easily with files. The other way to do things is with a map of connection parameters. This techniques gives us a little more control over how we work with a shapefile and also allows us to connect to databases and web feature servers. @@ -369,7 +370,7 @@ Here are some additional challenges for you to try: * Important: GeoTools is an active open source project - you can quickly use maven to try out the - latest nightly build by changing your pom.xml file to use a "SNAPSHOT" release. + latest nightly build by changing your ``pom.xml`` file to use a "SNAPSHOT" release. At the time of writing |branch|-SNAPSHOT is under active development. @@ -378,7 +379,7 @@ Here are some additional challenges for you to try: :start-after: http://maven.apache.org :end-before: - You will also need to change your pom.xml file to include the following snapshot repository: + You will also need to change your ``pom.xml`` file to include the following snapshot repository: .. literalinclude:: artifacts/pom2.xml :language: xml @@ -398,7 +399,7 @@ Alternatives to M2Eclipse ========================= There are two alternatives to the use of the M2Eclipse plugin; you may find these better suit the -needs of your organisation. +needs of your organization. * :ref:`eclipse-mvn-start` * :ref:`eclipse-download-start` @@ -417,18 +418,18 @@ generating eclipse :file:`.project` and :file:`.classpath` files. The last version we tested with was: Maven 3.3.3 -2. Unzip the file apache-maven-2.2.1-bin.zip to C:\java\apache-maven-3.3.3 +2. Unzip the file ``apache-maven-3.3.3-bin.zip`` to ``C:\java\apache-maven-3.3.3`` 3. You need to have a couple of environmental variables set for maven to work. Use :menuselection:`Control Panel --> System --> Advanced --> Environmental Variables` to set the following System Variables: Add the following system variables: - * JAVA_HOME = :file:`C:\\Program Files (x86)\\Java\\jdk1.8.0_66` - * M2_HOME = :file:`C:\\java\\apache-maven-3.2.3` + * ``JAVA_HOME = :file:`C:\\Program Files (x86)\\Java\\jdk1.8.0_66``` + * ``M2_HOME = :file:`C:\\java\\apache-maven-3.2.3``` - And add the following to your PATH: + And add the following to your ``PATH``: - * PATH = :file:`%JAVA_HOME%\\bin;%M2_HOME%\\bin` + * ``PATH = :file:`%JAVA_HOME%\\bin;%M2_HOME%\\bin``` .. image:: images/env-variables.png :scale: 60 @@ -447,7 +448,7 @@ generating eclipse :file:`.project` and :file:`.classpath` files. .. image:: images/maven-version.png :scale: 60 -7. We can now generate our project from maven-archetype-quickstart with:: +7. We can now generate our project from ``maven-archetype-quickstart`` with:: C:>cd C:\java C:java> mvn archetype:generate -DgroupId=org.geotools -DartifactId=tutorial -Dversion=1.0-SNAPSHOT -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-quickstart @@ -467,7 +468,7 @@ generating eclipse :file:`.project` and :file:`.classpath` files. .. image:: images/classpath-variables.png :scale: 60 -12. Add an **M2_REPO** classpath variable pointing to your "local repository" +12. Add an ``M2_REPO`` classpath variable pointing to your "local repository" ================== ======================================================== PLATFORM LOCAL REPOSITORY @@ -485,10 +486,10 @@ generating eclipse :file:`.project` and :file:`.classpath` files. 15. Select the project you created: :file:`C:\java\tutorial` 16. Press :guilabel:`Finish` to import your project -17. Navigate to the pom.xml file and double click to open it up. +17. Navigate to the ``pom.xml`` file and double click to open it up. 18. We are going to start by defining the version number of GeoTools we wish to use. This workbook was written for |release| although you may wish to try a newer version, or make use of a - nightly build by using 15-SNAPSHOT. + nightly build by using something like ``15-SNAPSHOT``. .. literalinclude:: artifacts/pom.xml :language: xml @@ -516,7 +517,7 @@ generating eclipse :file:`.project` and :file:`.classpath` files. 21. You may find it easier to cut and paste into your existing file; or just :download:`download pom.xml` directly. - An easy way to pick up typing mistakes with tags is to Eclipse to format the xml file. + An easy way to pick up typing mistakes with tags is to Eclipse to format the XML file. 22. Return to the command line and maven to download the required jars and tell eclipse about it:: @@ -529,7 +530,7 @@ generating eclipse :file:`.project` and :file:`.classpath` files. .. image:: images/maven-refresh.png :scale: 60 -24. Using this technique of running mvn eclipse:eclipse and refreshing in eclipse you can proceed +24. Using this technique of running ``mvn eclipse:eclipse`` and refreshing in eclipse you can proceed through all the tutorial examples. .. _eclipse-download-start: @@ -545,7 +546,7 @@ We can also download the GeoTools project bundle from source forge and set up ou them. Please follow these steps carefully as not all the GeoTools jars can be used at the same time. -1. Download the GeoTools binrary release from http://sourceforge.net/projects/geotools/files +1. Download the GeoTools binary release from http://sourceforge.net/projects/geotools/files 2. We are now going to make a project for the required jars. By placing the jars into their own project is is easier to upgrade GeoTools. @@ -557,32 +558,32 @@ time. 5. Select General > Archive File and press Next -6. Navigate to the geotools-bin.zip download and import the contents into your project. +6. Navigate to the ``geotools-bin.zip`` download and import the contents into your project. 7. GeoTools includes a copy of the "EPSG" database; but also allows you to hook up your own copy of the EPSG database as an option.. However only one copy can be used at a time so we will need to remove the following jars from the Library Manager: - * gt-epsg-hsql - * gt-epsg-oracle - * gt-epsg-postgresql - * gt-epsg-wkt + * ``gt-epsg-hsql`` + * ``gt-epsg-oracle`` + * ``gt-epsg-postgresql`` + * ``gt-epsg-wkt`` -8. GeoTools allows you to work with many different databases; however to make them work you will need to download jdbc drivers from the manufacturer. +8. GeoTools allows you to work with many different databases; however to make them work you will need to download JDBC drivers from the manufacturer. For now remove the follow plugins from your Library Manager definition: - * gt-arcsde - * gt-arcsde-common - * gt-jdbc-db2 - * gt-jdbc-oracle + * ``gt-arcsde`` + * ``gt-arcsde-common`` + * ``gt-jdbc-db2`` + * ``gt-jdbc-oracle`` -9. Next we update our java build path to include the remaining jars. Choose Project > Properties from +9. Next we update our Java build path to include the remaining jars. Choose Project > Properties from the menu bar 10. Select Java Build Path property page; and switch to the library tab. -11. Press Add JARs button and add all the jars +11. Press ``Add JAR``\ s button and add all the jars 12. Switch to the Order and Export tab and press Select All @@ -590,7 +591,7 @@ time. 14. Use Project > Properties on your new Example project to open up the Java Build Path page. -15. Switch to the Projects tab and use the Add.. button to add GeoTools Downloads to the build path. +15. Switch to the Projects tab and use the ``Add..`` button to add GeoTools Downloads to the build path. 16. Our example project can now use all the GeoTools jars. diff --git a/docs/user/tutorial/quickstart/intellij.rst b/docs/user/tutorial/quickstart/intellij.rst index 16c661233f3..0b96aaaf1c4 100644 --- a/docs/user/tutorial/quickstart/intellij.rst +++ b/docs/user/tutorial/quickstart/intellij.rst @@ -24,7 +24,7 @@ Create a New Project -------------------- To start with we'll create a new project using the Maven quickstart archetype. -#. Choose File -> New Project from the menu. In the New Project dialog choose Maven project, ensure *Create from archetype* is selected, +#. Choose :menuselection:`File -> New Project` from the menu. In the New Project dialog choose Maven project, ensure *Create from archetype* is selected, and choose the *org.apache.maven.archetypes:maven-archetype-quickstart* archetype. Press *Next* .. image:: images/intellij/new_project_screen.png @@ -33,16 +33,16 @@ To start with we'll create a new project using the Maven quickstart archetype. #. The next screen asks us for basic identifying information for our project: - * GroupId: org.geotools - * ArtifactId: tutorial - * Version: 1.0-SNAPSHOT + * GroupId: ``org.geotools`` + * ArtifactId: ``tutorial`` + * Version: ``1.0-SNAPSHOT`` .. image:: images/intellij/new_project2.png :scale: 65 % :align: center #. Hit next. The following screen we should be able to leave with the defaults. For our purposes IntelliJ's bundled Maven should be - fine, unless the version is lower than 3, in which case you should consider using a new external verision. + fine, unless the version is lower than 3, in which case you should consider using a new external version. .. image:: images/intellij/new_project3.png :scale: 65 % @@ -80,11 +80,11 @@ Adding Jars to Your Project To turn on Offline Mode: - #. Open the *Settings*. On OS X this is IntelliJ -> Preferences, on other OSes it's under File -> Settings - #. Choose Build, Execution, Deployment -> Build Tools -> Maven + #. Open the *Settings*. On OS X this is :menuselection:`IntelliJ -> Preferences`, on other OSes it's under :menuselection:`File -> Settings` + #. Choose :menuselection:`Build, Execution, Deployment -> Build Tools -> Maven` #. Check the *Work Offline* option -The pom.xml file describes the structure, configuration, dependencies and many other facets of your project. We are going to focus +The ``pom.xml`` file describes the structure, configuration, dependencies and many other facets of your project. We are going to focus on the dependencies needed for your project. When downloading jars Maven makes use of a "local repository" to store copies if the dependencies it downloads. @@ -102,7 +102,7 @@ Maven downloads jars from public repositories on the internet where projects suc #. Open up the `pom.xml` file at the root of the project. You can see some of the information we entered through the wizard earlier. -#. We're going to add three things to this file. First, at the top of the file after moduleVersion we want to add a +#. We're going to add three things to this file. First, at the top of the file after ``moduleVersion`` we want to add a properties element defining the version of GeoTools we wish to use. This workbook was written for |release| although you may wish to try a different version. @@ -121,14 +121,14 @@ Maven downloads jars from public repositories on the internet where projects suc :end-before: #. We are going to add a dependence to GeoTools :file:`gt-main` and :file:`gt-swing` jars. Note we - are making use of the geotools.version defined above. + are making use of the ``geotools.version`` defined above. .. literalinclude:: artifacts/pom.xml :language: xml :start-after: :end-before: -#. Finally we need to list the external *repositories* where maven can download GeoTools and and +#. Finally we need to list the external *repositories* where maven can download GeoTools and other required jars from. .. literalinclude:: artifacts/pom.xml @@ -138,7 +138,7 @@ Maven downloads jars from public repositories on the internet where projects suc .. note:: Note the snapshot repository above is only required if you are using a nightly build (such as |branch|-SNAPSHOT) -#. If you'd like to use Java 8 language level features (eg. lambdas), you need to tell Maven to use the 1.8 source level +#. If you'd like to use Java 8 language level features (e.g. lambdas), you need to tell Maven to use the 1.8 source level .. literalinclude:: artifacts/pom2.xml :language: xml @@ -147,13 +147,13 @@ Maven downloads jars from public repositories on the internet where projects suc 8. For comparison here is the completed :download:`pom.xml ` file for download. - You may find cutting and pasting to be easier than typing, you can choose Code -> Reformat Code to + You may find cutting and pasting to be easier than typing, you can choose :menuselection:`Code -> Reformat Code` to fix indentation Tips: * If Maven isn't downloading dependencies automatically for some reason (maybe *Auto-Import* is turned off) - you can manually download dependencies by right-clicking on your project and choosing Maven -> Reimport. + you can manually download dependencies by right-clicking on your project and choosing :menuselection:`Maven -> Reimport`. * If you'd like to download the Javadoc for your dependencies you can again go to the Maven context menu and choose *Download Documentation* @@ -162,9 +162,9 @@ Quickstart Application Now that our environment is set up we can put together a simple Quickstart. This example will display a shapefile on the screen. -#. Let's create a class called `Quickstart` in the package `org.geotools.tutorial.quickstart`. IntelliJ can - create both the package and the class for us in one shot; right click on the org.geootools package in the Project panel - and in the context menu choose New -> Java Class. +#. Let's create a class called `Quickstart` in the package ``org.geotools.tutorial.quickstart``. IntelliJ can + create both the package and the class for us in one shot; right click on the ``org.geootools`` package in the Project panel + and in the context menu choose :menuselection:`New -> Java Class`. .. image:: images/intellij/new_class_menu.png :align: center @@ -184,7 +184,7 @@ shapefile on the screen. Please unzip the above data into a location you can find easily such as the desktop. -#. Run the application to open a file chooser. Choose a shapefile from the example dataset. +#. Run the application to open a file chooser. Choose a shapefile from the example data set. .. image:: images/QuickstartOpen.png :scale: 60 @@ -214,7 +214,7 @@ Here are some additional challenges for you to try: * Try out the different sample data sets * You can zoom in, zoom out and show the full extents and Use the select tool to examine individual - countries in the sample countries.shp file + countries in the sample ``countries.shp`` file * Download the largest shapefile you can find and see how quickly it can be rendered. You should find that the very first time it will take a while as a spatial index is generated. After that @@ -235,15 +235,16 @@ If you would like to ask GeoTools to cache the shapefile in memory try the follo This code won't compile initially because we're missing an import. IntelliJ should prompt to import the missing class immediately. Press Alt-Enter (^-Enter on OS X) to bring up a dialog to import the missing class. + .. The ability to grab figure out what classes to import is a key skill; we are starting off here with a simple example with a single import. * Try and sort out what all the different "side car" files are - and what they are for. The sample - data set includes "shp", "dbf" and "shx". How many other side car files are there? + data set includes ``shp``, ``dbf`` and ``shx``. How many other side car files are there? .. This exercise asks users to locate the geotools user guide or wikipedia -* Advanced: The use of FileDataStoreFinder allows us to work easily with files. The other way to do +* Advanced: The use of ``FileDataStoreFinder`` allows us to work easily with files. The other way to do things is with a map of connection parameters. This techniques gives us a little more control over how we work with a shapefile and also allows us to connect to databases and web feature servers. @@ -254,7 +255,7 @@ the missing class immediately. Press Alt-Enter (^-Enter on OS X) to bring up a d * Important: GeoTools is an active open source project - you can quickly use maven to try out the - latest nightly build by changing your pom.xml file to use a "SNAPSHOT" release. + latest nightly build by changing your ``pom.xml`` file to use a "SNAPSHOT" release. At the time of writing |branch|-SNAPSHOT is under active development. @@ -263,7 +264,7 @@ At the time of writing |branch|-SNAPSHOT is under active development. :start-after: http://maven.apache.org :end-before: -You will also need to change your pom.xml file to include the following snapshot repository: +You will also need to change your ``pom.xml`` file to include the following snapshot repository: .. literalinclude:: artifacts/pom2.xml :language: xml diff --git a/docs/user/tutorial/quickstart/java11.rst b/docs/user/tutorial/quickstart/java11.rst index bf2d4b12101..ce6dc978c9e 100644 --- a/docs/user/tutorial/quickstart/java11.rst +++ b/docs/user/tutorial/quickstart/java11.rst @@ -42,7 +42,7 @@ Instead of Java 8, we will want to install Java 11. #. At the time of writing the latest Java 11 release was: - * jdk-11.0.1 + * ``jdk-11.0.1`` #. Click through the installer you will need to set an acceptance a license agreement and so forth. By default this will install to: @@ -53,7 +53,7 @@ Instead of Java 8, we will want to install Java 11. * JAVA_HOME = :file:`C:\\Program Files\\Java\\jdk-11.0.1` -#. Verify mvn is using the correct Java version by running: +#. Verify ``mvn`` is using the correct Java version by running: .. code-block:: sh @@ -108,7 +108,7 @@ For a more detailed overview of the module system, refer to the `State of the Mo .. literalinclude:: artifacts/module-info.java :language: java - You'll notice the four geotools modules match those added as dependencies in the :file:`pom.xml`. We also include the ``java.desktop`` module, which contains user interface components required for the app to function. + You'll notice the four GeoTools modules match those added as dependencies in the :file:`pom.xml`. We also include the ``java.desktop`` module, which contains user interface components required for the app to function. Running the application ----------------------- diff --git a/docs/user/tutorial/quickstart/maven.rst b/docs/user/tutorial/quickstart/maven.rst index c5490847098..5d6610114b6 100644 --- a/docs/user/tutorial/quickstart/maven.rst +++ b/docs/user/tutorial/quickstart/maven.rst @@ -39,7 +39,7 @@ We are going to be making use of Java so if you don't have a Java Development Ki #. At the time of writing the latest Java 8 release was: - * jdk-8u66-windows-i586.exe + * ``jdk-8u66-windows-i586.exe`` GeoTools is not yet tested with Java 9, we are limited by build infrastructure and volunteers. @@ -66,11 +66,11 @@ definitely makes working with GeoTools much easier: * You only download as much of GeoTools as your application requires. -* Jars are downloaded into a single location in your home directory (e.g. C:\\Documents and - Settings\\\.m2\\ on Windows). This is your *local repository*. +* Jars are downloaded into a single location in your home directory (e.g. :file:`C:\\Documents and Settings\\\.m2` + on Windows). This is your *local repository*. * The correct versions of all of the third-party jars required by GeoTools will be downloaded for - you. This helps you to avoid obscure errors than can be caused by mis-matched dependencies which + you. This helps you to avoid obscure errors than can be caused by mismatched dependencies which can be very difficult to track down. * The single *local repository* makes it easier to work on other multiple open source projects. @@ -83,7 +83,7 @@ Installing Maven In this tutorial we refer to Maven version 3.2.3, we have had relatively little trouble with Maven version 3. -#. Unzip the file apache-maven-3.2.3-bin.zip +#. Unzip the file ``apache-maven-3.2.3-bin.zip`` #. You need to have a couple of environmental variables set for maven to work. Navigate to :menuselection:`Control Panel --> System --> Advanced`. Change to the :guilabel:`Advanced` tab and click :guilabel:`Environmental Variables` button. @@ -144,7 +144,7 @@ Creating a new project tutorial\src\test\java\org\geotools tutorial\src\test\java\org\geotools\AppTest.java - App.java and AppTest.java are just placeholder files not used in this tutorial. + ``App.java`` and ``AppTest.java`` are just placeholder files not used in this tutorial. #. During the build process your local maven repository will be used to store both downloaded jars, and those you build locally. @@ -159,8 +159,8 @@ Creating a new project Linux and Mac: :file:`~/.m2/repository` ================== ======================================================== -#. Open the **pom.xml** file in your favourite text editor. If your editor has an XML syntax mode - switch into that now because it will make it a lot easier to find errors such as mis-matched +#. Open the ``pom.xml`` file in your favorite text editor. If your editor has an XML syntax mode + switch into that now because it will make it a lot easier to find errors such as mismatched brackets. Some editors, such as `vim `_, will do this automatically on loading the file. @@ -212,14 +212,14 @@ Now we are ready to create the application. #. Crete the *org.geotools.tutorial.quickstart* package by navigating to the directory :file:`tutorial` and create the directory :file:`src\\main\\java\\org\\geotools\\tutorial\\quickstart` -#. In the new sub-directory, create a new file **Quickstart.java** using your text editor. +#. In the new sub-directory, create a new file ``Quickstart.java`` using your text editor. #. Fill in the following code: .. literalinclude:: /../src/main/java/org/geotools/tutorial/quickstart/Quickstart.java :language: java -#. Go back to the top project directory (the one that contains your pom.xml file) and build the +#. Go back to the top project directory (the one that contains your ``pom.xml`` file) and build the application with the command:: mvn clean install @@ -260,7 +260,7 @@ Things to Try * Try out the different sample data sets. * You can zoom in, zoom out and show the full extent and use the info tool to examine individual - countries in the sample countries.shp file. + countries in the sample ``countries.shp`` file. * Download the largest shapefile you can find and see how quickly it can be rendered. You should find that the very first time it will take a while as a spatial index is generated. After that @@ -277,18 +277,18 @@ Things to Try .. Note:: - When building you may see a message that CachingFeatureSource is deprecated. It's ok to ignore + When building you may see a message that ``CachingFeatureSource`` is deprecated. It's OK to ignore it, it's just a warning. The class is still under test but usable. .. The ability to figure out what classes to import is a key skill; we are starting off here with a simple example with a single import. * Try and sort out what all the different "side car" files are - and what they are for. The sample - data set includes "shp", "dbf" and "shx". How many other side car files are there? + data set includes ``shp``, ``dbf`` and ``shx``. How many other side car files are there? .. This exercise asks users to locate the geotools user guide or wikipedia -* Advanced: The use of FileDataStoreFinder allows us to work easily with files. The other way to do +* Advanced: The use of ``FileDataStoreFinder`` allows us to work easily with files. The other way to do things is with a map of connection parameters. This techniques gives us a little more control over how we work with a shapefile and also allows us to connect to databases and web feature servers. @@ -298,8 +298,8 @@ Things to Try :end-before: // end datastore * So what jars did maven actually use for the Quickstart application? Try the following on the - command line: + command line:: - mvn dependency:tree + mvn dependency:tree We will be making use of some of the project in greater depth in the remaining tutorials. diff --git a/docs/user/tutorial/quickstart/netbeans.rst b/docs/user/tutorial/quickstart/netbeans.rst index e69cf0e4ce2..996c6ba12c4 100644 --- a/docs/user/tutorial/quickstart/netbeans.rst +++ b/docs/user/tutorial/quickstart/netbeans.rst @@ -39,18 +39,18 @@ We are going to be making use of Java so if you don't have a Java Development Ki the time to do so. Even if you have Java installed already check out the optional Java Advanced Imaging and Java Image IO section – both of these libraries are used by GeoTools. -#. Download the latest JDK from the the java.sun.com website: +#. Download the latest JDK from the java.sun.com website: http://java.sun.com/javase/downloads/index.jsp #. At the time of writing the latest JDK was: - jdk-8u91-windows-i586.exe + ``jdk-8u91-windows-i586.exe`` #. Click through the installer you will need to set an acceptance a license agreement and so forth. By default this will install to: - C:\\Program Files\\Java\\jdk1.8.0_91\\ + ``C:\\Program Files\\Java\\jdk1.8.0_91\\`` #. **Optional**: Java Advanced Imaging is used by GeoTools for raster support. If you install JAI 1.1.3 performance will be improved: @@ -59,8 +59,8 @@ Imaging and Java Image IO section – both of these libraries are used by GeoToo Both a JDK and JRE installer are available: - * jai-1_1_3-lib-windows-i586-jdk.exe - * jai-1_1_3-lib-windows-i586-jre.exe + * ``jai-1_1_3-lib-windows-i586-jdk.exe`` + * ``jai-1_1_3-lib-windows-i586-jre.exe`` #. **Optional**: ImageIO Is used to read and write raster files. GeoTools uses version 1_1 of the ImageIO library: @@ -69,8 +69,8 @@ Imaging and Java Image IO section – both of these libraries are used by GeoToo Both a JDK and JRE installer are available: - * jai_imageio-1_1-lib-windows-i586-jdk.exe - * jai_imageio-1_1-lib-windows-i586-jre.exe + * ``jai_imageio-1_1-lib-windows-i586-jdk.exe`` + * ``jai_imageio-1_1-lib-windows-i586-jre.exe`` For more details of how to install these packages see `this page `_ @@ -83,7 +83,7 @@ The NetBeans IDE is a popular choice for Java development and features excellent http://www.netbeans.org/ -#. At the time of netbeans-7.0.1-ml-javase-windows.exe was the latest installer. +#. At the time of ``netbeans-7.0.1-ml-javase-windows.exe`` was the latest installer. #. Click through the steps of the installer. You will notice it will pick up on the JDK you installed earlier. @@ -101,13 +101,13 @@ The advantages of using Maven are: * You only download as much of GeoTools as your application requires * Jars are downloaded to a single location in your home directory - (in a hidden folder called .m2/repository) + (in a hidden folder called ``.m2/repository``) * Source code and javadocs are automatically downloaded and hooked up Although Maven is a build tool it works by describing the contents of a project. This is a different approach then used by the Make or Ant tools which list the steps required to build. -The description of a project inlcudes the required jars (called dependencies) and a repositor +The description of a project includes the required jars (called dependencies) and a repository on the internet where the jars can be downloaded. We will be using these facilities to bring GeoTools jars into our project as needed. @@ -129,8 +129,8 @@ Let's get started: 4. We can now fill in the blanks - * Project name: tutorial - * GroupId: org.geotools + * Project name: ``tutorial`` + * GroupId: ``org.geotools`` .. image:: images/nbNameAndLocation.png :Scale: 60 @@ -148,13 +148,13 @@ Adding Jars to Your Project .. sidebar:: Lab Your local maven repository has already been - populated with geotools allowing the use of "offline" mode. + populated with GeoTools allowing the use of "offline" mode. #. Open :menuselection:`Windows --> Preferences` #. Select :guilabel:`Maven` preference page #. Ensure :guilabel:`offline` is checked -The *pom.xml* file is used to describe the care and feeding of your maven project; we are going to +The ``pom.xml`` file is used to describe the care and feeding of your maven project; we are going to focus on the dependencies needed for your project When downloading jars maven makes use of a "local repository" to store jars. @@ -171,9 +171,9 @@ When downloading jars maven makes use of public maven repositories on the intern such as GeoTools publish their work. 1. The next step is for us to make it a GeoTools project by adding information to Maven's project - description file ("project object model" in Maven-speak) - pom.xml + description file ("project object model" in Maven-speak) - ``pom.xml`` - In the Projects panel open up the Project Files folder and double click on pom.xml to open it. + In the Projects panel open up the Project Files folder and double click on ``pom.xml`` to open it. 2. We are going to start by defining the version number of GeoTools we wish to use. This workbook was written for |release| although you may wish to try a different version. @@ -196,7 +196,8 @@ such as GeoTools publish their work. "" in the Projects window. You can choose "Format" as a quick way to check if the tags line up. Or just hit undo and try again. -3. Next we add two GeoTools modules to the dependencies section: gt-shapefile and gt-swing. +3. Next we add two GeoTools modules to the dependencies section: + ``gt-shapefile`` and ``gt-swing``. .. literalinclude:: artifacts/pom.xml :language: xml @@ -212,7 +213,7 @@ such as GeoTools publish their work. .. note:: Note the snapshot repository above is only required if you are using a nightly build (such as |branch|-SNAPSHOT) -5. If you'd like to use Java 8 language level features (eg. lambdas), you need to tell Maven to use the 1.8 source level +5. If you'd like to use Java 8 language level features (e.g. lambdas), you need to tell Maven to use the 1.8 source level .. literalinclude:: artifacts/pom2.xml :language: xml @@ -239,9 +240,9 @@ Quickstart Application Now that your environment is setup we can put together a simple Quickstart. This example will display a shapefile on screen. -#. Create the package org.geotools.tutorial.quickstart. +#. Create the package ``org.geotools.tutorial.quickstart.`` -#. Create the org.geotools.tutorial.quickstart.Quickstart class using your IDE. +#. Create the ``org.geotools.tutorial.quickstart.Quickstart`` class using your IDE. #. Fill in the following code: @@ -265,7 +266,7 @@ Running the Application Please unzip the above data into a location you can find easily such as the desktop. -#. Run the application to open a file chooser. Choose a shapefile from the example dataset. +#. Run the application to open a file chooser. Choose a shapefile from the example data set. .. image:: images/QuickstartOpen.jpg :scale: 60 @@ -296,7 +297,7 @@ Here are some additional challenges for you to try: * Try out the different sample data sets * You can zoom in, zoom out and show the full extents and Use the select tool to examine individual - countries in the sample countries.shp file + countries in the sample ``countries.shp`` file * Download the largest shapefile you can find and see how quickly it can be rendered. You should find that the very first time it will take a while as a spatial index is generated. After that @@ -313,14 +314,16 @@ Here are some additional challenges for you to try: :start-after: // docs start cache :end-before: // docs end cache + For the above example to compile you will need to add the necessary imports. + * Try and sort out what all the different "side car" files are – and what they are for. The sample - data set includes "shp", "dbf" and "shx". How many other side car files are there? + data set includes ``shp``, ``dbf`` and ``shx``. How many other side car files are there? .. This exercise asks users to locate the geotools user guide or wikipedia -* Advanced: The use of FileDataStoreFinder allows us to work easily with files. The other way to do +* Advanced: The use of ``FileDataStoreFinder`` allows us to work easily with files. The other way to do things is with a map of connection parameters. This techniques gives us a little more control over how we work with a shapefile and also allows us to connect to databases and web feature servers. @@ -331,7 +334,7 @@ Here are some additional challenges for you to try: * Important: GeoTools is an active open source project – you can quickly use maven to try out the - latest nightly build by changing your pom.xml file to use a "SNAPSHOT" release. + latest nightly build by changing your ``pom.xml`` file to use a "SNAPSHOT" release. At the time of writing |branch|-SNAPSHOT is under active development. @@ -340,7 +343,7 @@ Here are some additional challenges for you to try: :start-after: http://maven.apache.org :end-before: - You will also need to change your pom.xml file to include the following snapshot repository: + You will also need to change your ``pom.xml`` file to include the following snapshot repository: .. literalinclude:: artifacts/pom2.xml :language: xml @@ -361,7 +364,7 @@ The alternative to using Maven to download and manage jars for you is to manuall To start with we will obtain GeoTools from the website: 1. Download the GeoTools binary release from http://sourceforge.net/projects/geotools/files -2. Extract the geotools-2.6.0-bin.zip file to C:\\java\\geotools-2.6.0 folder. +2. Extract the ``geotools-2.6.0-bin.zip`` file to :file:`C:\\java\\geotools-2.6.0` folder. 3. If you open up the folder and have a look you will see GeoTools and all of the other jars that it uses including those from other libraries such as GeoAPI and JTS. @@ -383,27 +386,27 @@ To start with we will obtain GeoTools from the website: .. sidebar:: EPSG - The EPSG databaes is distributed as an Access database and has been converted into the pure java + The EPSG database is distributed as an Access database and has been converted into the pure java database HSQL for our use. - * gt-epsg-h2 - * gt-epsg-oracle - * gt-epsg-postgresql - * gt-epsg-wkt-2.6 + * ``gt-epsg-h2`` + * ``gt-epsg-oracle`` + * ``gt-epsg-postgresql`` + * ``gt-epsg-wkt-2.6`` 9. GeoTools allows you to work with many different databases; however to make them work you will need to download jdbc drivers from the manufacturer. For now remove the following plugins from the Library Manager: - * gt-arcsde - * gt-arcsde-common - * gt-db2 - * gt-jdbc-db2 - * gt-oracle-spatial - * gt-jdbc-oracle + * ``gt-arcsde`` + * ``gt-arcsde-common`` + * ``gt-db2`` + * ``gt-jdbc-db2`` + * ``gt-oracle-spatial`` + * ``gt-jdbc-oracle`` -10. We are now ready to proceed with creating an example project. Select File > New Project +10. We are now ready to proceed with creating an example project. Select :menuselection:`File > New Project` 11. Choose the default "Java Application" diff --git a/docs/user/tutorial/raster/image.rst b/docs/user/tutorial/raster/image.rst index eebab3b86d1..95ce0638827 100644 --- a/docs/user/tutorial/raster/image.rst +++ b/docs/user/tutorial/raster/image.rst @@ -41,18 +41,18 @@ In the earlier examples we looked at reading and displaying shapefiles. For going to add raster data into the mix by displaying a three-band global satellite image, and overlaying it with country boundaries from a shapefile. -1. Please ensure your pom.xml includes the following. +1. Please ensure your ``pom.xml`` includes the following. We have already encountered most of these dependencies in earlier examples. The new modules we - have added are **gt-geotiff** which allows us to read raster map data from a GeoTIFF file - and **gt-image** which allows us to read an Image+World format file set (e.g. jpg + jpw). + have added are ``gt-geotiff`` which allows us to read raster map data from a GeoTIFF file + and ``gt-image`` which allows us to read an Image+World format file set (e.g. ``jpg`` + ``jpw``). .. literalinclude:: artifacts/pom.xml :language: xml :start-after: :end-before: -2. Please create the package **org.geotools.tutorial.raster** and class **ImageLab** and copy and paste in the following code: +2. Please create the package ``org.geotools.tutorial.raster`` and class ``ImageLab`` and copy and paste in the following code: .. literalinclude:: /../src/main/java/org/geotools/tutorial/raster/ImageLab.java :language: java @@ -67,7 +67,7 @@ are created from a description of the parameters needed when connecting. We are going to use these same facilities now to prompt the user: -1. We will use **JParameterListWizard**, to prompt for the raster file and the shapefile that will +1. We will use ``JParameterListWizard``, to prompt for the raster file and the shapefile that will be displayed over it: .. literalinclude:: /../src/main/java/org/geotools/tutorial/raster/ImageLab.java @@ -75,7 +75,7 @@ We are going to use these same facilities now to prompt the user: :start-after: // docs start get layers :end-before: // docs end get layers -Observer the use of **Parameter** objects for each input file. The arguments passed to the Parameter +Observer the use of ``Parameter`` objects for each input file. The arguments passed to the Parameter constructor are: :key: an identifier for the Parameter @@ -90,7 +90,7 @@ constructor are: .. tip: KVP - The class **KVP** is a handy class for creating a Map of String:Object pair. + The class ``KVP`` is a handy class for creating a Map of String:Object pair. Here is an example of using a Hashmap:: @@ -98,17 +98,17 @@ constructor are: `map.add(Parameter.EXT, "jpg");` `map.add(Parameter.EXT, "tif");` - The same example can be done in a single line using **KVP**:: + The same example can be done in a single line using ``KVP``:: `KVP map = new KVP(Parameter.EXT, "jpg", Parameter.EXT, "tif");` Displaying the map ------------------ -To display the map on screen we create a **MapContent**, add the image and the shapefile to it, -and pass it to a **JMapFrame**. +To display the map on screen we create a ``MapContent``, add the image and the shapefile to it, +and pass it to a ``JMapFrame``. -1. Rather than using the static JMapFrame.showMap method, as we have in previous examples, we create a +1. Rather than using the static ``JMapFrame.showMap`` method, as we have in previous examples, we create a map frame and customize it by adding a menu to choose the image display mode. .. literalinclude:: /../src/main/java/org/geotools/tutorial/raster/ImageLab.java @@ -116,12 +116,12 @@ and pass it to a **JMapFrame**. :start-after: // docs start display layers :end-before: // docs end display layers -2. Note that we are creating a **Style** for each of the map layers: +2. Note that we are creating a ``Style`` for each of the map layers: - * A greyscale Style for the initial image display, created with a method that we'll examine next - * A simple outline style for the shapefile using the **SLD** utility class + * A gray scale ``Style`` for the initial image display, created with a method that we'll examine next + * A simple outline style for the shapefile using the ``SLD`` utility class -3. Creating a greyscale Style prompts the user for the image band to display; and then generates +3. Creating a gray scale ``Style`` prompts the user for the image band to display; and then generates a style accordingly. .. literalinclude:: /../src/main/java/org/geotools/tutorial/raster/ImageLab.java @@ -129,28 +129,28 @@ and pass it to a **JMapFrame**. :start-after: // docs start create greyscale style :end-before: // docs end create greyscale style -4. To display color we need to use a slightly more complex Style that specifies which bands in the - grid coverage map to the R, G and B colors on screen. +4. To display color we need to use a slightly more complex ``Style`` that specifies which bands in the + grid coverage map to the Red, Green and Blue colors on screen. The method checks the image to see if its bands (known as *sample dimensions*) have labels - indicating which to use. If not, we just use the first three bands and hope for the best ! + indicating which to use. If not, we just use the first three bands and hope for the best! .. literalinclude:: /../src/main/java/org/geotools/tutorial/raster/ImageLab.java :language: java :start-after: // docs start create rgb style :end-before: // docs end source -5. Please note that the above technique (checking colour bands) is specific to RGB images. +5. Please note that the above technique (checking color bands) is specific to RGB images. While this is easy for a simple color image; it can be harder for things like satellite images where none of the bands quite line up with what human eyes see. Running the application ======================= -If you need some sample data to display you can download the `uDig sample dataset `_ which contains: +If you need some sample data to display you can download the `uDig sample data set `_ which contains: -* clouds.jpg -* countries.shp +* ``clouds.jpg`` +* ``countries.shp`` 1. When you run the program you will first see the wizard dialog prompting your for the image @@ -159,20 +159,21 @@ If you need some sample data to display you can download the `uDig sample datase .. image:: images/ImageLab_dialog.png :width: 60% -2. The initial map display shows the image as a greyscale, single-band view. +2. The initial map display shows the image as a gray scale, single-band view. .. image:: images/ImageLab_display.png :width: 60% -3. Experiment with displaying different bands in greyscale and swapping to the RGB display. +3. Experiment with displaying different bands in gray scale and swapping to the RGB display. Extra things to try =================== -* Modify the file prompt wizard, or the menu, to allow additional shapfiles to be overlaid onto +* Modify the file prompt wizard, or the menu, to allow additional shapefiles to be overlaid onto the image. -* Add a map layer table to the JMapFrame using frame.enableLayerTable(true) so that you can toggle +* Add a map layer table to the ``JMapFrame`` using + ``frame.enableLayerTable(true)`` so that you can toggle the visibility of the layers. * Advanced: Experiment with Styles for the raster display: e.g. contrast enhancement options; @@ -190,44 +191,44 @@ Raster Data Grid Coverage ------------- -Support for raster data is provided by the concept of a GridCoverage. As programmers we are used +Support for raster data is provided by the concept of a ``GridCoverage``. As programmers we are used to working with raster data in the form of bitmapped graphics such as JPEG, GIF and PNG files. On the geospatial side of things there is the concept of a Coverage. A coverage is a collection of spatially located features. Informally, we equate a coverage with a map (in the geographic rather than the programming sense). -A GridCoverage is a special case of Coverage where the features are rectangles forming a grid that +A ``GridCoverage`` is a special case of ``Coverage`` where the features are rectangles forming a grid that fills the area of the coverage. In our Java code we can use a bitmapped graphic as the backing data -structure for a GridCoverage together with additional elements to record spatial bounds in a +structure for a ``GridCoverage`` together with additional elements to record spatial bounds in a specific coordinate reference system. There are many kinds of grid coverage file formats. Some of the most common are: -world plus image - A normal image format like jpeg or png that has a side-car file describing where it is located - as well as a prj sidecar file defining the map projection just like a shapefile uses. +World plus image + A normal image format like ``jpeg`` or ``png`` that has a side-car file describing where it is located + as well as a ``prj`` sidecar file defining the map projection just like a shapefile uses. - Please note that alothough the jpeg format is common due to small download size; the + Please note that although the ``jpeg`` format is common due to small download size; the performance at runtime is terrible as the entire image needs be read into memory. Formats such as TIFF do not have this limitation, -Geotiff +GeoTiff A normal tiff image that has geospatial information stored in the image metadata fields. This - is generally a safe bet for fast performnace; especially if it has been prepaired with an + is generally a safe bet for fast performance; especially if it has been prepared with an internal overlay (which can be used when zoomed out) or internal tiling (allowing for fast pans when zoomed in. Performs best when your computer has faster disks than CPUs. JPEG2000 - The sequel to jpeg that uses wavelet compression to handle massive images. The file + The sequel to ``jpeg`` that uses wavelet compression to handle massive images. The file format also supports metadata fields that can be used to store geospatial information. This format performs best when you have more faster CPUs than disk access. There are also more exotic formats such as ECW and MRSID that can be supported if you have installed -the imageio-ext project into your JRE. +the ``imageio-ext`` project into your JRE. Web Map Server -------------- @@ -240,7 +241,7 @@ At a basic level we can fetch information from a WMS using a GetMap operation:: http://localhost:8080/geoserver/wms?bbox=-130,24,-66,50&styles=population&Format=image/png&request=GetMap&layers=topp:states&width=550&height=250&srs=EPSG:4326 -The trick is knowing what parameters to fill in for |ldquo| layer |rdquo| and |ldquo| style |rdquo| when making one of these +The trick is knowing what parameters to fill in for "layer" and "style" when making one of these requests. The WMS Service offers a GetCapabilities document that describes what layers are available and what @@ -260,7 +261,7 @@ a list of layers, the supported image formats and so forth. // the capabilities document (so the rootLayer is at index 0) List layers = capabilities.getLayerList(); -The WebMapServer class also knows how to set up a GetMap request for several different version of the +The ``WebMapServer`` class also knows how to set up a GetMap request for several different version of the WMS standard. .. code-block:: java diff --git a/docs/user/tutorial/raster/jaiext.rst b/docs/user/tutorial/raster/jaiext.rst index 4ebed2d312f..daaf8a225dd 100644 --- a/docs/user/tutorial/raster/jaiext.rst +++ b/docs/user/tutorial/raster/jaiext.rst @@ -9,10 +9,10 @@ Introduction From GeoTools 14.x a new JAI extension API has been integrated, this new API is called `JAI-EXT `_. -**JAI-EXT** is an open-source Project which provides a fast, high-scalability API for image processing. The main feature of this API is the ability to -support external **ROI** objects and Image **NoData** for most of its processing operations. +``JAI-EXT`` is an open-source Project which provides a fast, high-scalability API for image processing. The main feature of this API is the ability to +support external ``ROI`` objects and Image ``NoData`` for most of its processing operations. -This page has been written to describe this new API inside GeoTools, to demonstrate its use, and to explain best practises for working with it. +This page has been written to describe this new API inside GeoTools, to demonstrate its use, and to explain best practices for working with it. Usage ======= @@ -28,7 +28,7 @@ A project which would like to use JAI-EXT operations needs to first register the JAIExt.initJAIEXT(); } -This registers all of the JAI-EXT operations inside the JAI *OperationRegistry* in order to use them instead of old JAI operations. +This registers all of the JAI-EXT operations inside the JAI ``OperationRegistry`` in order to use them instead of old JAI operations. .. note:: It should be pointed out that if this method is called more than one time; it has no effect since it is only an initialization method. @@ -38,13 +38,13 @@ The above changes can be reverted individually:: JAIExt.registerJAIEXTDescriptor("Warp") --> Replace the JAI "Warp" operation with the JAI-EXT one -These methods allow replacement of the *OperationDescriptor* associated with an operation with one from JAI or JAI-EXT. +These methods allow replacement of the ``OperationDescriptor`` associated with an operation with one from JAI or JAI-EXT. -.. note:: *OperationDescriptor* is a class describing the parameters to set for executing a JAI/JAI-EXT operation. +.. note:: ``OperationDescriptor`` is a class describing the parameters to set for executing a JAI/JAI-EXT operation. -In order to avoid exceptions after replacing the *OperationDescriptor* associated with a JAI/JAI-EXT operation, users should take care on how they launch the operation: +In order to avoid exceptions after replacing the ``OperationDescriptor`` associated with a JAI/JAI-EXT operation, users should take care on how they launch the operation: -#. Using a *ParameterBlock* instance, which does not provide the same checks present in the *ParameterBlockJAI* class which may lead to unexpected exceptions. Here is an example +#. Using a ``ParameterBlock`` instance, which does not provide the same checks present in the ``ParameterBlockJAI`` class which may lead to unexpected exceptions. Here is an example .. code-block:: java @@ -71,7 +71,7 @@ In order to avoid exceptions after replacing the *OperationDescriptor* associate RenderedOp result = JAI.create("Rescale", pb, hints); -#. Call the related GeoTools *ImageWorker* method, if present: +#. Call the related GeoTools ``ImageWorker`` method, if present: .. code-block:: java @@ -102,11 +102,11 @@ In order to avoid exceptions after replacing the *OperationDescriptor* associate GeoTools registration ---------------------- -Since the majority of the **GeoTools** operations are internally bound to the **JAI** operations, users must take care on how they handle them with **JAI-EXT**. +Since the majority of the GeoTools operations are internally bound to the JAI operations, users must take care on how they handle them with JAI-EXT. -The first suggestion is to always use a **CoverageProcessor** instance for getting a GeoTools coverage *operation*. It should be better to get a new *CoverageProcessor* instance by using the static factory method **CoverageProcessor.getInstance()** since this method allows to cache the various *CoverageProcessor* instances and reuse them if needed. +The first suggestion is to always use a ``CoverageProcessor`` instance for getting a GeoTools coverage *operation*. It should be better to get a new ``CoverageProcessor`` instance by using the static factory method ``CoverageProcessor.getInstance()`` since this method allows to cache the various ``CoverageProcessor`` instances and reuse them if needed. -When an *OperationDescriptor* is replaced, users should take care to remove the existing associated GeoTools operation from all the *CoverageProcessor* instances and then to insert it again. This procedure must be done in order to avoid having a GeoTools operation with an internal *OperationDescriptor* which has been replaced; this situation may lead to wrong parameter initialization which could then lead to exceptions during Coverage processing. +When an ``OperationDescriptor`` is replaced, users should take care to remove the existing associated GeoTools operation from all the ``CoverageProcessor`` instances and then to insert it again. This procedure must be done in order to avoid having a GeoTools operation with an internal ``OperationDescriptor`` which has been replaced; this situation may lead to wrong parameter initialization which could then lead to exceptions during Coverage processing. The procedure is described below. @@ -118,7 +118,7 @@ The procedure is described below. Best Practice -------------- -Below is a simple piece of code for how to handle NoData for a GridCoverage. +Below is a simple piece of code for how to handle ``NoData`` for a ``GridCoverage``. .. code-block:: java @@ -151,7 +151,7 @@ Below is a simple piece of code for how to handle NoData for a GridCoverage. // Retrieving ROI from GridCoverage ROI newROI = CoverageUtilities.getROIProperty(coverage); -It should be noted that NoData is always returned as *NoDataContainer* instance. This class provides useful methods for accessing NoData as array, single value or *Range*. In the the following code shows how to change the NoData value after executing a single operation. +It should be noted that ``NoData`` is always returned as *NoDataContainer* instance. This class provides useful methods for accessing ``NoData`` as array, single value or ``Range``. In the following code shows how to change the ``NoData`` value after executing a single operation. .. code-block:: java @@ -173,4 +173,4 @@ It should be noted that NoData is always returned as *NoDataContainer* instance. .. warning:: - Since the *GTCrop* operation has been moved to the JAI-EXT project, users should take care that replacing the JAI-EXT Crop with the JAI one will result in the loss of all the fixes provided by *GTCrop*. + Since the ``GTCrop`` operation has been moved to the JAI-EXT project, users should take care that replacing the JAI-EXT Crop with the JAI one will result in the loss of all the fixes provided by ``GTCrop``. diff --git a/docs/user/unsupported/arcgis-rest.rst b/docs/user/unsupported/arcgis-rest.rst index f750f658168..fd3aff97ad2 100644 --- a/docs/user/unsupported/arcgis-rest.rst +++ b/docs/user/unsupported/arcgis-rest.rst @@ -1,25 +1,25 @@ -ArcGIS ReST API DataStore +ArcGIS REST API DataStore ========================= Overview -------- -This datastore implements a very limited portion of the ArcGIS ReST API +This datastore implements a very limited portion of the ArcGIS REST API (http://resources.arcgis.com/en/help/arcgis-rest-api/), which is supported by both ArcGIS Server and ArcGIS Online. -Specifically, only the FeatureServer services on either ArcGIS Online (Open Data) or -ArcGIS Server FeatureServers are covered so far. +Specifically, only the ``FeatureServer`` services on either ArcGIS Online (Open Data) or +ArcGIS Server ``FeatureServers`` are covered so far. -FeatureServers, non entire services, are used as endpoints for ArcGIS -Servers, because there may be hundreds of different layers, and it seems ESRI throttlea back +``FeatureServers``, non entire services, are used as endpoints for ArcGIS +Servers, because there may be hundreds of different layers, and it seems ESRI throttles back requests, leading to very long times for building feature types. -The main parmater is the API URL, which can take the form of: -* ArcGIS Online (Open Data): http://data..opendata.arcgis.com/data.json -* ArcGIS FeaureServer: http://services.arcgis.com//ArcGIS/rest/services//FeatureServer +The main parameter is the API URL, which can take the form of: +* ArcGIS Online (Open Data): ``http://data..opendata.arcgis.com/data.json`` +* ArcGIS ``FeaureServer``: ``http://services.arcgis.com//ArcGIS/rest/services//FeatureServer`` Some services to test: http://data.dhs.opendata.arcgis.com/data.json (Open Data catalog) @@ -33,7 +33,7 @@ Tomcat with the procedure `this procedure = 10.41 +ArcGIS REST API >= 10.41 Functionality @@ -42,6 +42,6 @@ Functionality Currently, only a part of the Feature Service (http://resources.arcgis.com/en/help/arcgis-rest-api/#/Feature_Service/02r3000000z2000000/) is implemented, which allows to: -* It can retrieve a list of avaialable layers from a FeatureServer +* It can retrieve a list of available layers from a ``FeatureServer`` * It can query a layer by bounding box diff --git a/docs/user/unsupported/css.rst b/docs/user/unsupported/css.rst index e7e471b163d..7672db5f96e 100644 --- a/docs/user/unsupported/css.rst +++ b/docs/user/unsupported/css.rst @@ -1,7 +1,7 @@ Cartographic CSS Plugin ----------------------- -The **gt-css** module is a plugin used used to generate Style objects from a human readable CSS representation. +The ``gt-css`` module is a plugin used used to generate Style objects from a human readable CSS representation. To use this module in your application: @@ -11,7 +11,7 @@ Related Links: * `CSS `_ (GeoServer User Guide) * `CSS Cookbook `_ (GeoServer User Guide) -**Maven**:: +``Maven``:: org.geotools @@ -43,7 +43,7 @@ The following code can be used to parse the above file and generate a GeoTools S CssTranslator translator = new CssTranslator(); Style style = translator.translate(ss); -Here is the SLD represenattion of the generated style: +Here is the SLD representation of the generated style: .. code-block:: xml diff --git a/docs/user/unsupported/csv.rst b/docs/user/unsupported/csv.rst index 455791aead7..2ba1e8c0ceb 100644 --- a/docs/user/unsupported/csv.rst +++ b/docs/user/unsupported/csv.rst @@ -1,13 +1,13 @@ CSV Plugin ---------- -The **gt-csv** module is a plugin which provides a CSVDataStore. It is pluggable into geoserver's importer, allowing read/write capabilities for :file:`.csv` files. The plugin supports three strategies: AttributesOnly, LatLon, and SpecifiedWKT. Essentially, each strategy will read and store data in a slightly different way. +The ``gt-csv`` module is a plugin which provides a ``CSVDataStore``. It is pluggable into GeoServer's importer, allowing read/write capabilities for :file:`.csv` files. The plugin supports three strategies: ``AttributesOnly``, ``LatLon``, and ``SpecifiedWKT``. Essentially, each strategy will read and store data in a slightly different way. -The CSVWriteStrategyTest shows how the strategy code functions fairly well. A more detailed explanation can be found in the ContentDataStore tutorial on the :doc:`strategy page`. +The ``CSVWriteStrategyTest`` shows how the strategy code functions fairly well. A more detailed explanation can be found in the ``ContentDataStore`` tutorial on the :doc:`strategy page`. :download:`CSVWriteStrategyTest.java ` -* CSVAttributesOnlyStrategy +* ``CSVAttributesOnlyStrategy`` This strategy will directly read the :file:`.csv` file and use its headers as the attributes for each feature. @@ -16,18 +16,18 @@ The CSVWriteStrategyTest shows how the strategy code functions fairly well. A mo :start-after: // docs start attributes :end-before: // docs end attributes -* CSVLatLonStrategy +* ``CSVLatLonStrategy`` - The LatLonStrategy will attempt to parse the :file:`.csv` file for LAT and LON columns. If specified, it will use the String parameters passed to it as the names of the columns. Otherwise, it will attempt to find the columns using some standard spellings and abbrieviations for latitude and longitude. Internally, the data will be represented as a Point geometry. + The ``LatLonStrategy`` will attempt to parse the :file:`.csv` file for ``LAT`` and ``LON`` columns. If specified, it will use the String parameters passed to it as the names of the columns. Otherwise, it will attempt to find the columns using some standard spellings and abbreviations for latitude and longitude. Internally, the data will be represented as a Point geometry. .. literalinclude:: /../../modules/unsupported/csv/src/test/java/org/geotools/data/csv/parse/CSVWriteStrategyTest.java :language: java :start-after: // docs start latlon :end-before: // docs end latlon -* CSVSpecifiedWKTStrategy +* ``CSVSpecifiedWKTStrategy`` - Finally, the SpecifiedWKTStrategy requires a WKT which it will parse for. It is a bit more abstract than the LatLonStrategy, and will store the specified column as a Geometry attribute (it may be a Point, Line, Polygon, etc.). + Finally, the ``SpecifiedWKTStrategy`` requires a WKT which it will parse for. It is a bit more abstract than the ``LatLonStrategy``, and will store the specified column as a Geometry attribute (it may be a Point, Line, Polygon, etc.). .. literalinclude:: /../../modules/unsupported/csv/src/test/java/org/geotools/data/csv/parse/CSVWriteStrategyTest.java :language: java diff --git a/docs/user/unsupported/geometry/build.rst b/docs/user/unsupported/geometry/build.rst index 5063614b0e1..d26b1f09c55 100644 --- a/docs/user/unsupported/geometry/build.rst +++ b/docs/user/unsupported/geometry/build.rst @@ -6,48 +6,50 @@ Factories are classes used to create other objects. This module provides geometr Factories ^^^^^^^^^ -The gt-opengis module several factories for working with ISO 19107 constructs: +The ``gt-opengis`` module several factories for working with ISO 19107 constructs: -* PositionFactory (implemented by PositionFactoryImpl) +* ``PositionFactory`` (implemented by ``PositionFactoryImpl``) - Requires: crs, precision + Requires: ``crs``, ``precision`` - Creates PointArray and DirectPosition + Creates ``PointArray`` and ``DirectPosition`` -* GeometryFactory (implemented by GeometryFactoryImpl) - crs, PositionFactory +* ``GeometryFactory`` (implemented by ``GeometryFactoryImpl``) + ``crs``, ``PositionFactory`` Create arc, B-spline, envelope, geodesic, line segment, line string, polygon, tin, triangle -* PrimitiveFactory (implemented by PrimitiveFactoryImpl) +* ``PrimitiveFactory`` (implemented by ``PrimitiveFactoryImpl``) - Requires: crs, PositionFactory + Requires: ``crs``, ``PositionFactory`` Creates curve, point, surface -* ComplexFactory (implemented by ComplexFactoryImpl) +* ``ComplexFactory`` (implemented by ``ComplexFactoryImpl``) - Requires: crs + Requires: ``crs`` Creates composite curve, composite point, composite surface -* AggregateFactory (implemented by AggregateFactoryImpl) +* ``AggregateFactory`` (implemented by ``AggregateFactoryImpl``) - Requires: crs + Requires: ``crs`` Creates multi point, multi curve, multi primitive, multi surface You can create the factories by hand; a technique that is not recommended, but does illustrate how the parts fit together. +:: + PositionFactory posF = new PositionFactoryImpl(DefaultGeographicCRS.WGS84, new PrecisionModel()); PrimitiveFactory primF = new PrimitiveFactoryImpl(DefaultGeographicCRS.WGS84, posF); -GeometryBuilder -''''''''''''''' +``GeometryBuilder`` +'''''''''''''''''''' -The GeometryBuilder class is the preferred way to manage, create and use factories. +The ``GeometryBuilder`` class is the preferred way to manage, create and use factories. -This allows you to use only the factory gt-opengis interfaces and not worry about the implementations. The GeometryBuilder is found in the referencing package at org.geotools.geometry.GeometryBuilder. The following example shows how you can use the builder to create and manage factories:: +This allows you to use only the factory ``gt-opengis`` interfaces and not worry about the implementations. The ``GeometryBuilder`` is found in the referencing package at ``org.geotools.geometry.GeometryBuilder``. The following example shows how you can use the builder to create and manage factories:: GeometryBuilder builder = new GeometryBuilder(DefaultGeographicCRS.WGS84); PositionFactory posF = builder.getPositionFactory(); @@ -64,9 +66,9 @@ Using a Container Another way to manage geometry factories is through the use of a container. This requires you to register the specific factory implementations you want to use. -Below we create a PicoContainer with all the required factories registered; we will then use the container to get the factories we will need and the container will figure out all the dependencies for us. +Below we create a ``PicoContainer`` with all the required factories registered; we will then use the container to get the factories we will need and the container will figure out all the dependencies for us. -The call to create the PicoContainer will have to call into the org.picocontainer PicoContainer package.:: +The call to create the ``PicoContainer`` will have to call into the ``org.picocontainer`` ``PicoContainer`` package.:: DefaultPicoContainer cont = new DefaultPicoContainer(); @@ -81,9 +83,9 @@ The call to create the PicoContainer will have to call into the org.picocontaine cont.registerComponentInstance( DefaultGeographicCRS.WGS84); cont.registerComponentInstance( new PrecisionModel()); -We made a PicoContainer, registered the factories we were going to use and then added two qualifiers. We use the static CoordinateReferencingSystem (CRS) object WGS84 to tell the container we want to use the CRS of the GPS system. We then tell the container we want to use the default precision model. +We made a ``PicoContainer``, registered the factories we were going to use and then added two qualifiers. We use the static ``CoordinateReferencingSystem`` (CRS) object WGS84 to tell the container we want to use the CRS of the GPS system. We then tell the container we want to use the default precision model. -The general idea is to create a different container for each CRS and/or precision model you want to use. We could therefore put the above code in a method and pass as parameters the CRS and PrecisionModel. +The general idea is to create a different container for each CRS and/or precision model you want to use. We could therefore put the above code in a method and pass as parameters the ``CRS`` and ``PrecisionModel``. Using the container we just made we can get some factories but we get the interface back rather than the implementation.:: @@ -98,9 +100,9 @@ Creating a Point Points are the building blocks for most other geometries. The following sections explain how to manipulate Points: -There are a few ways you can go about creating a point. GeometryBuilder has many utility methods for creating geometries, so you don't have to worry about factories. But you can also use factories directly, or you can also use a WKT parser for creating points. +There are a few ways you can go about creating a point. ``GeometryBuilder`` has many utility methods for creating geometries, so you don't have to worry about factories. But you can also use factories directly, or you can also use a WKT parser for creating points. -* There are several createPoint methods provided as part of GeometryBuilder. +* There are several ``createPoint`` methods provided as part of ``GeometryBuilder``. Here is an example using one of them:: GeometryBuilder builder = new GeometryBuilder( DefaultGeographicCRS.WGS84 ); @@ -108,7 +110,7 @@ There are a few ways you can go about creating a point. GeometryBuilder has many * Using Factories - In some environments you are restricted to just using formal gt-opengis interfaces, here is an example of using the PositionFactory and PrimitiveFactory as is:: + In some environments you are restricted to just using formal ``gt-opengis`` interfaces, here is an example of using the ``PositionFactory`` and ``PrimitiveFactory`` as is:: Hints hints = new Hints( Hints.CRS, DefaultGeographicCRS.WGS84 ); PositionFactory positionFactory = GeometryFactoryFinder.getPositionFactory( hints ); @@ -118,7 +120,7 @@ There are a few ways you can go about creating a point. GeometryBuilder has many Point point1 = primitiveFactory.createPoint( here ); -* PositionFactory has a helper method allowing you to save one step:: +* ``PositionFactory`` has a helper method allowing you to save one step:: Hints hints = new Hints( Hints.CRS, DefaultGeographicCRS.WGS84 ); PrimitiveFactory primitiveFactory = GeometryFactoryFinder.getPrimitiveFactory( hints ); @@ -129,12 +131,12 @@ There are a few ways you can go about creating a point. GeometryBuilder has many * Using WKT - You can use the WKTParser to create a point from a well known text:: + You can use the ``WKTParser`` to create a point from a well known text:: WKTParser parser = new WKTParser( DefaultGeographicCRS.WGS84 ); Point point = (Point) parser.parse("POINT( 48.44 -123.37)"); - You can also create the WKTParser to use a specific set of factories:: + You can also create the ``WKTParser`` to use a specific set of factories:: Hints hints = new Hints( Hints.CRS, DefaultGeographicCRS.WGS84 ); @@ -157,12 +159,12 @@ Sometimes it is useful to take apart a geometry and get the pieces that are used Creating a Curve ^^^^^^^^^^^^^^^^ -Curves, or line objects, are usually created from a series of CurveSegments. Curves can be created directly from the GeometryBuilder, or if you only want to use gt-opengis interfaces you can use factories: +Curves, or line objects, are usually created from a series of ``CurveSegments``. Curves can be created directly from the ``GeometryBuilder``, or if you only want to use ``gt-opengis`` interfaces you can use factories: The following sections explain how to manipulate Curves. -* The following example shows how to create a CurveSegment and how to use it - to build a Curve with the GeometryBuilder.:: +* The following example shows how to create a ``CurveSegment`` and how to use it + to build a ``Curve`` with the ``GeometryBuilder``.:: // create directpositions DirectPosition start = builder.createDirectPosition(new double[]{ 48.44, -123.37 }); @@ -188,7 +190,7 @@ The following sections explain how to manipulate Curves. * Using Factories Building a curve from factories is very similar to the process of using the - GeometryBuilder, but it lets you only use gt-opengis interfaces: + ``GeometryBuilder``, but it lets you only use ``gt-opengis`` interfaces:: // create directpositions @@ -229,20 +231,18 @@ Taking apart a Curve to get a list of points may not always return what you expe } } -GeoTools Users Guide : 04 Working with Surface -This page last changed on Sep 05, 2007 by gdavis. The following sections explain how to manipulate Surfaces: Creating a Surface ^^^^^^^^^^^^^^^^^^ -As with the other geometries, Surfaces are built up from a series of other geometry pieces. Surfaces can be created directly from the GeometryBuilder, or if you only want to use GeoAPI interfaces you can also use factories: +As with the other geometries, Surfaces are built up from a series of other geometry pieces. Surfaces can be created directly from the ``GeometryBuilder``, or if you only want to use GeoAPI interfaces you can also use factories: -* Surfaces can be built from a list of SurfacePatches or from a - SurfaceBoundary. +* Surfaces can be built from a list of ``SurfacePatches`` or from a + ``SurfaceBoundary``. - The following example shows how to create a Surface from a SurfaceBoundary - using the GeometryBuilder.:: + The following example shows how to create a Surface from a ``SurfaceBoundary`` + using the ``GeometryBuilder``.:: GeometryBuilder builder = new GeometryBuilder( DefaultGeographicCRS.WGS84 ); @@ -282,7 +282,7 @@ As with the other geometries, Surfaces are built up from a series of other geome * Using Factories Building a surface from factories is very similar to the process of using - the GeometryBuilder, but it lets you only use gt-opengis interfaces: + the ``GeometryBuilder``, but it lets you only use ``gt-opengis`` interfaces:: // create a list of connected positions List dps = new ArrayList(); @@ -323,9 +323,9 @@ of that geometry. Surfaces can have holes in them, and a simple list of points will not tell you if they belong to a hole or to the exterior of the shape. -However, you can obtain the Rings for the exterior and interior (holes) -of the Surface. If desired, you can also get the points that make those -Rings:: +However, you can obtain the ``Rings`` for the exterior and interior (holes) +of the ``Surface``. If desired, you can also get the points that make those +``Rings``:: SurfaceBoundary sb = (SurfaceBoundary) surface2.getBoundary(); Ring exterior = sb.getExterior(); @@ -349,9 +349,9 @@ Rings:: Rendering a Surface ''''''''''''''''''' -The following are two quick examples of how you can render a Surface (Polygon): +The following are two quick examples of how you can render a ``Surface`` (``Polygon``): -* Here is a quick example of rendering a Polygon using Java for/each syntax:: +* Here is a quick example of rendering a ``Polygon`` using Java for/each syntax:: final int X = 0; // easting axis for surface.getCoordinateReferenceSystem() final int Y = 1; // westing axis for surface.getCoordinateReferenceSystem() @@ -385,13 +385,13 @@ The following are two quick examples of how you can render a Surface (Polygon): Please note: - * Review your CoordinateReferenceSystem to figure out which axis is to use for + * Review your ``CoordinateReferenceSystem`` to figure out which axis is to use for X and Y - * Surface is a deep data structure, better suited to recursion or a visitor + * ``Surface`` is a deep data structure, better suited to recursion or a visitor * Using Recursive Code - You can produce less code duplication using recursion to navigate through your Surface:: + You can produce less code duplication using recursion to navigate through your ``Surface``:: protected void paint( Graphics2D g, Surface surface ) { for( SurfacePatch patch : surface.getPatches()){ @@ -429,16 +429,16 @@ The following are two quick examples of how you can render a Surface (Polygon): point2.getOrdinate(X), point2.getOrdinate(Y) ); } -Creating Envelope -^^^^^^^^^^^^^^^^^ +Creating Envelopes +^^^^^^^^^^^^^^^^^^ -The following sections explain how to manipulate Envelopes: +The following sections explain how to manipulate ``Envelopes``: Envelopes are essentially basic rectangles. Envelopes can be created -directly from the GeometryBuilder, or if you only want to use gt-opengis -interfaces you can use factories:: +directly from the ``GeometryBuilder``, or if you only want to use ``gt-opengis`` +interfaces you can use factories: -* The following example shows how to create an Envelope with the GeometryBuilder.:: +* The following example shows how to create an Envelope with the ``GeometryBuilder``:: GeometryBuilder builder = new GeometryBuilder( DefaultGeographicCRS.WGS84 ); @@ -449,7 +449,7 @@ interfaces you can use factories:: * Using Factories Building an envelope from factories is very similar to the process of using - the GeometryBuilder, but it lets you only use gt-opengis interfaces::: + the ``GeometryBuilder``, but it lets you only use ``gt-opengis`` interfaces::: Hints hints = new Hints( Hints.CRS, DefaultGeographicCRS.WGS84 ); diff --git a/docs/user/unsupported/geometry/index.rst b/docs/user/unsupported/geometry/index.rst index 8dad7b79509..f3c22d80b43 100644 --- a/docs/user/unsupported/geometry/index.rst +++ b/docs/user/unsupported/geometry/index.rst @@ -34,13 +34,13 @@ to put in the effort. ISO 19107 Geometry Interfaces - The geometric objects in this module are implementations of the gt-opengis - Geometry interfaces which are realisations of the ISO 19107 Geometry + The geometric objects in this module are implementations of the ``gt-opengis`` + ``Geometry`` interfaces which are realizations of the ISO 19107 Geometry schema. Users of the objects created by this module should therefore make instances using factories and then use only the methods defined in - the gt-opengis javadocs to avoid accidentally depending on any specific + the ``gt-opengis`` javadocs to avoid accidentally depending on any specific implementation details. **Maven**:: diff --git a/docs/user/unsupported/geometry/operation.rst b/docs/user/unsupported/geometry/operation.rst index 9af12ad7e6a..121bbcc9f9d 100644 --- a/docs/user/unsupported/geometry/operation.rst +++ b/docs/user/unsupported/geometry/operation.rst @@ -18,7 +18,7 @@ The following code shows some examples of performing operations on geometry obje Geometry geom = (Geometry) curve.union(surface); int distance = point.distance(surface); -* Transofrmation +* Transformation:: // perform a transform to another CRS CoordinateReferenceSystem crs2 = CRS.decode("EPSG:3005"); @@ -28,36 +28,36 @@ The following is a quick list of some of the more interesting operations and met .. note:: - TransfiniteSet + ``TransfiniteSet`` - For the purpose of reading the following methods TransfiniteSet is a - superclass of Geometry. + For the purpose of reading the following methods ``TransfiniteSet`` is a + superclass of ``Geometry``. Geometry Methods: -* Geometry.contains(TransfiniteSet) -* Geometry.crosses(TransfiniteSet) -* Geometry.difference(TransfiniteSet) -* Geometry.disjoint(TransfiniteSet) -* Geometry.distance(Geometry) -* Geometry.equals(TransfiniteSet) -* Geometry.getBoundary() -* Geometry.getCentroid() -* Geometry.getClosure() -* Geometry.getConvexHull() -* Geometry.getCoordinateDimension() -* Geometry.getCoordinateReferenceSystem() -* Geometry.getDimension(DirectPosition) -* Geometry.getEnvelope() -* Geometry.getRepresentativePoint() -* Geometry.intersection(TransfiniteSet) -* Geometry.intersects(TransfiniteSet) -* Geometry.isCycle() -* Geometry.overlaps(TransfiniteSet) -* Geometry.relate(Geometry, String) -* Geometry.symmetricDifference(TransfiniteSet) -* Geometry.touches(TransfiniteSet) -* Geometry.transform(CoordinateReferenceSystem) -* Geometry.transform(CoordinateReferenceSystem, MathTransform) -* Geometry.union(TransfiniteSet) -* Geometry.within(TransfiniteSet) +* ``Geometry.contains(TransfiniteSet)`` +* ``Geometry.crosses(TransfiniteSet)`` +* ``Geometry.difference(TransfiniteSet)`` +* ``Geometry.disjoint(TransfiniteSet)`` +* ``Geometry.distance(Geometry)`` +* ``Geometry.equals(TransfiniteSet)`` +* ``Geometry.getBoundary()`` +* ``Geometry.getCentroid()`` +* ``Geometry.getClosure()`` +* ``Geometry.getConvexHull()`` +* ``Geometry.getCoordinateDimension()`` +* ``Geometry.getCoordinateReferenceSystem()`` +* ``Geometry.getDimension(DirectPosition)`` +* ``Geometry.getEnvelope()`` +* ``Geometry.getRepresentativePoint()`` +* ``Geometry.intersection(TransfiniteSet)`` +* ``Geometry.intersects(TransfiniteSet)`` +* ``Geometry.isCycle()`` +* ``Geometry.overlaps(TransfiniteSet)`` +* ``Geometry.relate(Geometry, String)`` +* ``Geometry.symmetricDifference(TransfiniteSet)`` +* ``Geometry.touches(TransfiniteSet)`` +* ``Geometry.transform(CoordinateReferenceSystem)`` +* ``Geometry.transform(CoordinateReferenceSystem, MathTransform)`` +* ``Geometry.union(TransfiniteSet)`` +* ``Geometry.within(TransfiniteSet)`` diff --git a/docs/user/unsupported/index.rst b/docs/user/unsupported/index.rst index cacd1c53ee3..5b63a222f8a 100644 --- a/docs/user/unsupported/index.rst +++ b/docs/user/unsupported/index.rst @@ -40,6 +40,7 @@ Unsupported DataStore implementations: * :doc:`/library/data/dxf` (Inactive) Support for DXF format files * :doc:`/library/data/georest` (Unknown) Support for a REST service using GeoJSON * :doc:`/library/data/mongodb` (Unknown) Support for using mongodb (https://www.mongodb.com/, https://en.wikipedia.org/wiki/MongoDB) as a feature store. + * :doc:`/library/data/wfs-ng` (Active) Supports communication with a Web Feature Server using the standard GeoTools DataStore API Unsupported Raster modules: @@ -68,4 +69,4 @@ Unsupported Referencing implementations: (and has been done). If you really do need one of these modules cleaned up, perhaps for a deadline, please check out our support page - a - range of commercial support options are available. Any one of these organisations can be hired to bring these modules up to speed. + range of commercial support options are available. Any one of these organizations can be hired to bring these modules up to speed. diff --git a/docs/user/unsupported/mbstyle/index.rst b/docs/user/unsupported/mbstyle/index.rst index 9aedc8e144c..63623bec41e 100644 --- a/docs/user/unsupported/mbstyle/index.rst +++ b/docs/user/unsupported/mbstyle/index.rst @@ -1,7 +1,7 @@ Mapbox Styles Module -------------------- -The **gt-mbstyle** module is an unsupported module that provides a parser/encoder to convert between Mapbox Styles and GeoTools style objects. These docs are under active development, along with the module itself. +The ``gt-mbstyle`` module is an unsupported module that provides a parser/encoder to convert between Mapbox Styles and GeoTools style objects. These docs are under active development, along with the module itself. .. toctree:: :maxdepth: 1 @@ -43,7 +43,7 @@ MapBox Types Color - Colors are written as JSON strings in a variety of permitted formats: HTML-style hex values, rgb, rgba, hsl, and hsla. Predefined HTML colors names, like yellow and blue, are also permitted. + Colors are written as JSON strings in a variety of permitted formats: HTML-style hex values, ``rgb``, ``rgba``, ``hsl``, and ``hsla``. Predefined HTML colors names, like ``yellow`` and ``blue``, are also permitted. :: @@ -57,9 +57,9 @@ MapBox Types "line-color": "yellow" } - Especially of note is the support for hsl, which can be easier to reason about than rgb(). + Especially of note is the support for ``hsl``, which can be easier to reason about than ``rgb()``. - Enum + ``Enum`` One of a fixed list of string values. Use quotes around values. @@ -69,7 +69,7 @@ MapBox Types "text-transform": "uppercase" } - String + ``String`` A string is basically just text. In Mapbox styles, you're going to put it in quotes. Strings can be anything, though pay attention to the case of text-field - it actually will refer to features, which you refer to by putting them in curly braces, as seen in the example below. @@ -79,7 +79,7 @@ MapBox Types "text-field": "{MY_FIELD}" } - Boolean + ``Boolean`` Boolean means yes or no, so it accepts the values true or false. @@ -89,7 +89,7 @@ MapBox Types "fill-enabled": true } - Number + ``Number`` A number value, often an integer or floating point (decimal number). Written without quotes. @@ -99,7 +99,7 @@ MapBox Types "text-size": 24 } - Array + ``Array`` Arrays are comma-separated lists of one or more numbers in a specific order. For example, they're used in line dash arrays, in which the numbers specify intervals of line, break, and line again. @@ -124,7 +124,7 @@ Expressions are represented as JSON arrays. The first element of an expression a [expression_name, argument_0, argument_1, ...] -**Data expressions** +``Data expressions`` A *data expression* is any expression that access feature data -- that is, any expression that uses one of the data operators: ``get``, ``has``, ``id``, ``geometry-type``, ``properties``, or ``feature-state``. Data expressions allow a feature's properties or state to determine its appearance. They can be used to differentiate features within the same layer and to create data visualizations. @@ -146,9 +146,9 @@ This example uses the ``get`` operator to obtain the temperature value of each f Data expressions are allowed as the value of the ``filter`` property, and as values for most paint and layout properties. However, some paint and layout properties do not yet support data expressions. The level of support is indicated by the "data-driven styling" row of the "SDK Support" table for each property. Data expressions with the ``feature-state`` operator are allowed only on paint properties. -**Camera expressions** +``Camera expressions`` -A *camera expression* is any expression that uses the ``zoom operator``. Such expressions allow the the appearance of a layer to change with the map's zoom level. Camera expressions can be used to create the appearance of depth and to control data density. +A *camera expression* is any expression that uses the ``zoom operator``. Such expressions allow the appearance of a layer to change with the map's zoom level. Camera expressions can be used to create the appearance of depth and to control data density. :: @@ -192,7 +192,7 @@ That is, in layout or paint properties, ``["zoom"]`` may appear only as the inpu There is an important difference between layout and paint properties in the timing of camera expression evaluation. Paint property camera expressions are re-evaluated whenever the zoom level changes, even fractionally. For example, a paint property camera expression will be re-evaluated continuously as the map moves between zoom levels 4.1 and 4.6. On the other hand, a layout property camera expression is evaluated only at integer zoom levels. It will not be re-evaluated as the zoom changes from 4.1 to 4.6 -- only if it goes above 5 or below 4. -**Composition** +``Composition`` A single expression may use a mix of data operators, camera operators, and other operators. Such composite expressions allows a layer's appearance to be determined by a combination of the zoom level and individual feature properties. @@ -210,7 +210,7 @@ A single expression may use a mix of data operators, camera operators, and other An expression that uses both data and camera operators is considered both a data expression and a camera expression, and must adhere to the restrictions described above for both. -**Type system** +``Type system`` The input arguments to expressions, and their result values, use the same set of types as the rest of the style specification: boolean, string, number, color, and arrays of these types. Furthermore, expressions are type safe: each use of an expression has a known result type and required argument types, and the SDKs verify that the result type of an expression is appropriate for the context in which it is used. For example, the result type of an expression in the ``filter`` property must be boolean, and the arguments to the ``+`` operator must be numbers. @@ -276,25 +276,25 @@ The value for any layout or paint property may be specified as a function. Funct If no default is provided, the style property's default is used in these circumstances. - colorSpace + ``colorSpace`` *Optional enum. One of rgb, lab, hcl* - The color space in which colors interpolated. Interpolating colors in perceptual color spaces like LAB and HCL tend to produce color ramps that look more consistent and produce colors that can be differentiated more easily than those interpolated in RGB space. + The color space in which colors interpolated. Interpolating colors in perceptual color spaces like ``LAB`` and ``HCL`` tend to produce color ramps that look more consistent and produce colors that can be differentiated more easily than those interpolated in ``RGB`` space. *rgb* - Use the RGB color space to interpolate color values + Use the ``RGB`` color space to interpolate color values *lab* - Use the LAB color space to interpolate color values. + Use the ``LAB`` color space to interpolate color values. *hcl* - Use the HCL color space to interpolate color values, interpolating the Hue, Chroma, and Luminance channels individually. + Use the ``HCL`` color space to interpolate color values, interpolating the ``Hue``, ``Chroma``, and ``Luminance`` channels individually. - **Zoom Functions** allow the appearance of a map feature to change with map’s zoom level. Zoom functions can be used to create the illusion of depth and control data density. Each stop is an array with two elements: the first is a zoom level and the second is a function output value. + ``Zoom Functions`` allow the appearance of a map feature to change with map’s zoom level. Zoom functions can be used to create the illusion of depth and control data density. Each stop is an array with two elements: the first is a zoom level and the second is a function output value. :: @@ -307,11 +307,11 @@ The value for any layout or paint property may be specified as a function. Funct } } - The rendered values of *color*, *number*, and *array* properties are intepolated between stops. *Enum*, *boolean*, and *string* property values cannot be intepolated, so their rendered values only change at the specified stops. + The rendered values of *color*, *number*, and *array* properties are interpolated between stops. *Enum*, *boolean*, and *string* property values cannot be interpolated, so their rendered values only change at the specified stops. There is an important difference between the way that zoom functions render for layout and paint properties. Paint properties are continuously re-evaluated whenever the zoom level changes, even fractionally. The rendered value of a paint property will change, for example, as the map moves between zoom levels 4.1 and 4.6. Layout properties, on the other hand, are evaluated only once for each integer zoom level. To continue the prior example: the rendering of a layout property will not change between zoom levels 4.1 and 4.6, no matter what stops are specified; but at zoom level 5, the function will be re-evaluated according to the function, and the property's rendered value will change. (You can include fractional zoom levels in a layout property zoom function, and it will affect the generated values; but, still, the rendering will only change at integer zoom levels.) - **Property functions** allow the appearance of a map feature to change with its properties. Property functions can be used to visually differentate types of features within the same layer or create data visualizations. Each stop is an array with two elements, the first is a property input value and the second is a function output value. Note that support for property functions is not available across all properties and platforms at this time. + ``Property functions`` allow the appearance of a map feature to change with its properties. Property functions can be used to visually differentiate types of features within the same layer or create data visualizations. Each stop is an array with two elements, the first is a property input value and the second is a function output value. Note that support for property functions is not available across all properties and platforms at this time. :: @@ -325,7 +325,7 @@ The value for any layout or paint property may be specified as a function. Funct } } - **Zoom-and-property functions** allow the appearance of a map feature to change with both its properties and zoom. Each stop is an array with two elements, the first is an object with a property input value and a zoom, and the second is a function output value. Note that support for property functions is not yet complete. + ``Zoom-and-property functions`` allow the appearance of a map feature to change with both its properties and zoom. Each stop is an array with two elements, the first is an object with a property input value and a zoom, and the second is a function output value. Note that support for property functions is not yet complete. :: @@ -346,13 +346,13 @@ The value for any layout or paint property may be specified as a function. Funct A filter selects specific features from a layer. A filter is an array of one of the following forms: - **Existential Filters** + ``Existential Filters`` ["has", *key*] *feature[key]* exists ["!has", *key*] *feature[key]* does not exist - **Comparison Filters** + ``Comparison Filters`` ["==", *key, value*] equality: *feature[key] = value* @@ -366,13 +366,13 @@ The value for any layout or paint property may be specified as a function. Funct ["<=", *key, value*] less than or equal: *feature[key] ≤ value* - **Set Membership Filters** + ``Set Membership Filters`` ["in", *key, v0, ..., vn*] set inclusion: *feature[key] ∈ {v0, ..., vn}* ["!in", *key, v0, ..., vn*] set exclusion: *feature[key] ∉ {v0, ..., vn}* - **Combining Filters** + ``Combining Filters`` ["all", *f0, ..., fn*] logical AND: *f0 ∧ ... ∧ fn* diff --git a/docs/user/unsupported/mbstyle/spec.rst b/docs/user/unsupported/mbstyle/spec.rst index a7afdcd319a..5b2fd6d82b0 100644 --- a/docs/user/unsupported/mbstyle/spec.rst +++ b/docs/user/unsupported/mbstyle/spec.rst @@ -314,7 +314,7 @@ the light (from 0°, directly above, to 180°, directly below). color ~~~~~ -*Optional* :ref:`types-color`. *Defaults to* #ffffff. +*Optional* :ref:`types-color`. *Defaults to* ``#ffffff`` Color tint for lighting extruded geometries. @@ -363,7 +363,7 @@ Sources Sources supply data to be shown on the map. The type of source is specified by the ``"type"`` property, and must be one of vector, raster, -geojson, image, video, canvas. Adding a source won't immediately make +GeoJSON, image, video, canvas. Adding a source won't immediately make data appear on the map because sources don't contain styling details like color or width. Layers refer to a source and give it a visual representation. This makes it possible to style the same source in @@ -375,7 +375,7 @@ the `TileJSON specification `__. This can be done in several ways: -- By supplying TileJSON properties such as ``"tiles"``, ``"minzoom"``, +- By supplying ``TileJSON`` properties such as ``"tiles"``, ``"minzoom"``, and ``"maxzoom"`` directly in the source: :: @@ -389,7 +389,7 @@ done in several ways: "maxzoom": 14 } -- By providing a ``"url"`` to a TileJSON resource: +- By providing a ``"url"`` to a ``TileJSON`` resource: :: @@ -399,8 +399,8 @@ done in several ways: "url": "http://api.example.com/tilejson.json" } -- By providing a url to a WMS server that supports EPSG:3857 (or - EPSG:900913) as a source of tiled data. The server url should contain +- By providing a URL to a WMS server that supports EPSG:3857 (or + EPSG:900913) as a source of tiled data. The server URL should contain a ``"{bbox-epsg-3857}"`` replacement token to supply the ``bbox`` parameter. @@ -423,6 +423,7 @@ geometric coordinates in vector tiles must be between ``-1 * extent`` and ``(extent * 2) - 1`` inclusive. All layers that use a vector source must specify a ``"source-layer"`` value. For vector tiles hosted by Mapbox, the ``"url"`` value should be of the form ``mapbox://mapid``. + :: "mapbox-streets": { @@ -430,42 +431,42 @@ Mapbox, the ``"url"`` value should be of the form ``mapbox://mapid``. "url": "mapbox://mapbox.mapbox-streets-v6" } -url -^^^ +``url`` +^^^^^^^ *Optional* :ref:`types-string`. -A URL to a TileJSON resource. Supported protocols are ``http:``, +A URL to a ``TileJSON`` resource. Supported protocols are ``http:``, ``https:``, and ``mapbox://``. -tiles -^^^^^ +``tiles`` +^^^^^^^^^ *Optional* :ref:`types-array`. -An array of one or more tile source URLs, as in the TileJSON spec. +An array of one or more tile source URLs, as in the ``TileJSON`` spec. -minzoom -^^^^^^^ +``minzoom`` +^^^^^^^^^^^ *Optional* :ref:`types-number`. *Defaults to* 0. -Minimum zoom level for which tiles are available, as in the TileJSON +Minimum zoom level for which tiles are available, as in the ``TileJSON`` spec. -maxzoom -^^^^^^^ +``maxzoom`` +^^^^^^^^^^^ *Optional* :ref:`types-number`. *Defaults to* 22. -Maximum zoom level for which tiles are available, as in the TileJSON -spec. Data from tiles at the maxzoom are used when displaying the map at +Maximum zoom level for which tiles are available, as in the ``TileJSON`` +spec. Data from tiles at the ``maxzoom`` are used when displaying the map at higher zoom levels. @@ -482,8 +483,8 @@ higher zoom levels. - Not yet supported - >= 2.4.0 -raster -~~~~~~ +``raster`` +~~~~~~~~~~ A raster tile source. For raster tiles hosted by Mapbox, the ``"url"`` value should be of the form ``mapbox://mapid``. @@ -496,13 +497,13 @@ value should be of the form ``mapbox://mapid``. "tileSize": 256 } -url -^^^ +``url`` +^^^^^^^ *Optional* :ref:`types-string`. -A URL to a TileJSON resource. Supported protocols are ``http:``, +A URL to a ``TileJSON`` resource. Supported protocols are ``http:``, ``https:``, and ``mapbox://``. tiles @@ -512,29 +513,29 @@ tiles -An array of one or more tile source URLs, as in the TileJSON spec. +An array of one or more tile source URLs, as in the ``TileJSON`` spec. -minzoom -^^^^^^^ +``minzoom`` +^^^^^^^^^^^^ *Optional* :ref:`types-number`. *Defaults to* 0. -Minimum zoom level for which tiles are available, as in the TileJSON +Minimum zoom level for which tiles are available, as in the ``TileJSON`` spec. -maxzoom -^^^^^^^ +``maxzoom`` +^^^^^^^^^^^ *Optional* :ref:`types-number`. *Defaults to* 22. -Maximum zoom level for which tiles are available, as in the TileJSON -spec. Data from tiles at the maxzoom are used when displaying the map at +Maximum zoom level for which tiles are available, as in the ``TileJSON`` +spec. Data from tiles at the ``maxzoom`` are used when displaying the map at higher zoom levels. -tileSize -^^^^^^^^ +``tileSize`` +^^^^^^^^^^^^ *Optional* :ref:`types-number`. *Defaults to* 512. @@ -560,6 +561,7 @@ geojson A `GeoJSON `__ source. Data must be provided via a ``"data"`` property, whose value can be a URL or inline GeoJSON. + :: "geojson-marker": { @@ -596,8 +598,8 @@ data A URL to a GeoJSON file, or inline GeoJSON. -maxzoom -^^^^^^^ +``maxzoom`` +^^^^^^^^^^^ *Optional* :ref:`types-number`. *Defaults to* 18. @@ -634,8 +636,8 @@ cluster If the data is a collection of point features, setting this to true clusters the points by radius into groups. -clusterRadius -^^^^^^^^^^^^^ +``clusterRadius`` +^^^^^^^^^^^^^^^^^^ *Optional* :ref:`types-number`. *Defaults to* 50. @@ -644,14 +646,14 @@ clusterRadius Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile. -clusterMaxZoom -^^^^^^^^^^^^^^ +``clusterMaxZoom`` +^^^^^^^^^^^^^^^^^^ *Optional* :ref:`types-number`. Max zoom on which to cluster points if clustering is enabled. Defaults -to one zoom less than maxzoom (so that last zoom features are not +to one zoom less than ``maxzoom`` (so that last zoom features are not clustered). .. list-table:: @@ -692,8 +694,8 @@ right, bottom left. ] } -url -^^^ +``url`` +^^^^^^^ *Required* :ref:`types-string`. @@ -747,8 +749,8 @@ right, bottom left. ] } -urls -^^^^ +``urls`` +^^^^^^^^^ *Required* :ref:`types-array`. @@ -842,7 +844,7 @@ HTML ID of the canvas from which to read pixels. * - basic functionality - >= 0.32.0 - Not yet supported - - Not yet yupported + - Not yet supported .. _sprite: @@ -1040,7 +1042,7 @@ metadata Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, -like 'mapbox:'. +like ``mapbox:``. source ^^^^^^ @@ -1061,8 +1063,8 @@ source-layer Layer to use from a vector tile source. Required if the source supports multiple layers. -minzoom -^^^^^^^ +``minzoom`` +^^^^^^^^^^^^ *Optional* :ref:`types-number`. @@ -1070,8 +1072,8 @@ minzoom The minimum zoom level on which the layer gets parsed and appears on. -maxzoom -^^^^^^^ +``maxzoom`` +^^^^^^^^^^^^ *Optional* :ref:`types-number`. @@ -1255,13 +1257,13 @@ none Paint Properties ^^^^^^^^^^^^^^^^ -fill-antialias -"""""""""""""" +``fill-antialias`` +""""""""""""""""""" *Optional* :ref:`types-boolean`. *Defaults to* true. -Whether or not the fill should be antialiased. +Whether or not the fill should be anti-aliased. .. list-table:: @@ -1288,7 +1290,7 @@ fill-opacity The opacity of the entire fill layer. In contrast to the ``fill-color``, -this value will also affect the 1px stroke around the fill, if the +this value will also affect the 1 px stroke around the fill, if the stroke is used. .. list-table:: @@ -1339,7 +1341,7 @@ affect the opacity of the 1px stroke, if it is used. fill-outline-color """""""""""""""""" -*Optional* :ref:`types-color`. *Disabled by* fill-pattern. *Requires* fill-antialias = true. +*Optional* :ref:`types-color`. *Disabled by* fill-pattern. *Requires* ``fill-antialias = true``. The outline color of the fill. Matches the value of ``fill-color`` if @@ -1839,8 +1841,8 @@ Blur applied to the line, in pixels. - Not yet supported -line-dasharray -"""""""""""""" +``line-dasharray`` +"""""""""""""""""" *Optional* :ref:`types-array`. *Units in* line widths. *Disabled by* line-pattern. @@ -2452,7 +2454,7 @@ literal ``text-field`` values--not for property functions.) text-font """"""""" -*Optional* :ref:`types-array`. *Defaults to* Open Sans Regular,Arial Unicode MS Regular. *Requires* text-field. +*Optional* :ref:`types-array`. *Defaults to* Open Sans Regular, Arial Unicode MS Regular. *Requires* text-field. Font stack to use for displaying text. @@ -3004,7 +3006,7 @@ icon-color -The color of the icon. This can only be used with sdf icons. +The color of the icon. This can only be used with SDF icons. .. list-table:: @@ -3027,7 +3029,7 @@ The color of the icon. This can only be used with sdf icons. icon-halo-color """"""""""""""" -*Optional* :ref:`types-color`. *Defaults to* rgba(0, 0, 0, 0). *Requires* icon-image. +*Optional* :ref:`types-color`. *Defaults to* ``rgba(0, 0, 0, 0)``. *Requires* icon-image. @@ -3230,7 +3232,7 @@ The color with which the text will be drawn. text-halo-color """"""""""""""" -*Optional* :ref:`types-color`. *Defaults to* rgba(0, 0, 0, 0). *Requires* text-field. +*Optional* :ref:`types-color`. *Defaults to* ``rgba(0, 0, 0, 0)``. *Requires* text-field. @@ -3291,7 +3293,7 @@ text-halo-blur -The halo's fadeout distance towards the outside. +The halo's fade out distance towards the outside. .. list-table:: @@ -3706,7 +3708,7 @@ circle-blur Amount to blur the circle. 1 blurs the circle such that only the -centerpoint is full opacity. +center point is full opacity. .. list-table:: @@ -4177,7 +4179,7 @@ Color ~~~~~ Colors are written as JSON strings in a variety of permitted formats: -HTML-style hex values, rgb, rgba, hsl, and hsla. Predefined HTML colors +HTML-style hex values, ``rgb``, ``rgba``, ``hsl``, and ``hsla``. Predefined HTML colors names, like ``yellow`` and ``blue``, are also permitted. :: @@ -4192,13 +4194,13 @@ names, like ``yellow`` and ``blue``, are also permitted. "line-color": "yellow" } -Especially of note is the support for hsl, which can be `easier to +Especially of note is the support for ``hsl``, which can be `easier to reason about than rgb() `__. .. _types-enum: -Enum -~~~~ +``Enum`` +~~~~~~~~ One of a fixed list of string values. Use quotes around values. @@ -4433,7 +4435,7 @@ Asserts that the input is an array (optionally with a specific item type and len boolean ^^^^^^^ -Asserts that the input value is a boolean. If multiple values are provided, each one is evaluated in order until a boolean is obtained. If none of the inputs are booleans, the expression is an error. +Asserts that the input value is a boolean. If multiple values are provided, each one is evaluated in order until a boolean is obtained. If none of the inputs are boolean, the expression is an error. :: @@ -4721,8 +4723,8 @@ Converts the input value to a string. If the input is ``null``, the result is `` .. _expressions-typeof: -typeof -^^^^^^ +``typeof`` +^^^^^^^^^^^ Returns a string describing the type of the given value. @@ -5352,8 +5354,8 @@ Produces continuous, smooth results by interpolating between pairs of input and Interpolation types: - ``["linear"]``: interpolates linearly between the pair of stops just less than and just greater than the input. -- ``["exponential", base]``: interpolates exponentially between the stops just less than and just greater than the input. base controls the rate at which the output increases: higher values make the output increase more towards the high end of the range. With values close to 1 the output increases linearly. -- ``["cubic-bezier", x1, y1, x2, y2]``: interpolates using the cubic bezier curve defined by the given control points. +- ``["exponential", base]``: interpolates exponentially between the stops just less than and just greater than the input. Base controls the rate at which the output increases: higher values make the output increase more towards the high end of the range. With values close to 1 the output increases linearly. +- ``["cubic-bezier", x1, y1, x2, y2]``: interpolates using the cubic Bezier curve defined by the given control points. :: @@ -5379,10 +5381,10 @@ Interpolation types: .. _expressions-interpolate-hcl: -interpolate-hcl -^^^^^^^^^^^^^^^ +``interpolate-hcl`` +^^^^^^^^^^^^^^^^^^^ -Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like ``interpolate``, but the output type must be ``color``, and the interpolation is performed in the Hue-Chroma-Luminance color space. +Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like ``interpolate``, but the output type must be ``color``, and the interpolation is performed in the "Hue-Chroma-Luminance" color space. :: @@ -5440,7 +5442,7 @@ Produces continuous, smooth results by interpolating between pairs of input and step ^^^^ -Produces discrete, stepped results by evaluating a piecewise-constant function defined by pairs of input and output values ("stops"). The ``input`` may be any numeric expression (e.g., ``["get", "population"]``). Stop inputs must be numeric literals in strictly ascending order. Returns the output value of the stop just less than the input, or the first input if the input is less than the first stop. +Produces discrete, stepped results by evaluating a piece wise-constant function defined by pairs of input and output values ("stops"). The ``input`` may be any numeric expression (e.g., ``["get", "population"]``). Stop inputs must be numeric literals in strictly ascending order. Returns the output value of the stop just less than the input, or the first input if the input is less than the first stop. :: @@ -5527,8 +5529,8 @@ String .. _expressions-concat: -concat -^^^^^^ +``concat`` +^^^^^^^^^^ Returns a string consisting of the concatenation of the inputs. Each input is converted to a string as if by ``to-string``. @@ -5551,8 +5553,8 @@ Returns a string consisting of the concatenation of the inputs. Each input is co .. _expressions-downcase: -downcase -^^^^^^^^ +``downcase`` +^^^^^^^^^^^^ Returns the input string converted to lowercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database. @@ -5578,7 +5580,7 @@ Returns the input string converted to lowercase. Follows the Unicode Default Cas is-supported-script ^^^^^^^^^^^^^^^^^^^ -Returns ``true`` if the input string is expected to render legibly. Returns ``false`` if the input string contains sections that cannot be rendered without potential loss of meaning (e.g. Indic scripts that require complex text shaping, or right-to-left scripts if the the ``mapbox-gl-rtl-text`` plugin is not in use in Mapbox GL JS). +Returns ``true`` if the input string is expected to render legibly. Returns ``false`` if the input string contains sections that cannot be rendered without potential loss of meaning (e.g. Indic scripts that require complex text shaping, or right-to-left scripts if the ``mapbox-gl-rtl-text`` plugin is not in use in Mapbox GL JS). :: @@ -5610,8 +5612,8 @@ Returns the IETF language tag of the locale being used by the provided ``collato .. _expressions-upcase: -upcase -^^^^^^ +``upcase`` +^^^^^^^^^^ Returns the input string converted to uppercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database. @@ -5639,8 +5641,8 @@ Color .. _expressions-rgb: -rgb -^^^ +``rgb`` +^^^^^^^ Creates a color value from red, green, and blue components, which must range between 0 and 255, and an alpha component of 1. If any component is out of range, the expression is an error. @@ -5663,8 +5665,8 @@ Creates a color value from red, green, and blue components, which must range bet .. _expressions-rgba: -rgba -^^^^ +``rgba`` +^^^^^^^^^ Creates a color value from red, green, blue components, which must range between 0 and 255, and an alpha component which must range between 0 and 1. If any component is out of range, the expression is an error. @@ -5687,8 +5689,8 @@ Creates a color value from red, green, blue components, which must range between .. _expressions-to-rgba: -to-rgba -^^^^^^^ +``to-rgba`` +^^^^^^^^^^^^^^ Returns a four-element array containing the input color's red, green, blue, and alpha components, in that order. @@ -5888,10 +5890,10 @@ Returns the absolute value of the input. .. _expressions-acos: -acos -^^^^ +``acos`` +^^^^^^^^^ -Returns the arccosine of the input. +Returns the ``arccosine`` of the input. :: @@ -5912,10 +5914,10 @@ Returns the arccosine of the input. .. _expressions-asin: -asin -^^^^ +``asin`` +^^^^^^^^ -Returns the arcsine of the input. +Returns the ``arcsine`` of the input. :: @@ -5936,10 +5938,10 @@ Returns the arcsine of the input. .. _expressions-atan: -atan -^^^^ +``atan`` +^^^^^^^^^ -Returns the arctangent of the input. +Returns the ``arctangent`` of the input. :: @@ -5960,8 +5962,8 @@ Returns the arctangent of the input. .. _expressions-ceil: -ceil -^^^^ +``ceil`` +^^^^^^^^^ Returns the smallest integer that is greater than or equal to the input. @@ -5984,8 +5986,8 @@ Returns the smallest integer that is greater than or equal to the input. .. _expressions-cos: -cos -^^^ +``cos`` +^^^^^^^^ Returns the cosine of the input. @@ -6056,8 +6058,8 @@ Returns the largest integer that is less than or equal to the input. .. _expressions-ln: -ln -^^ +``ln`` +^^^^^^^^ Returns the natural logarithm of the input. @@ -6080,10 +6082,10 @@ Returns the natural logarithm of the input. .. _expressions-ln2: -ln2 -^^^ +``ln2`` +^^^^^^^ -Returns mathematical constant ln(2). +Returns mathematical constant ``ln(2)``. :: @@ -6104,8 +6106,8 @@ Returns mathematical constant ln(2). .. _expressions-log10: -log10 -^^^^^ +``log10`` +^^^^^^^^^^ Returns the base-ten logarithm of the input. @@ -6128,8 +6130,8 @@ Returns the base-ten logarithm of the input. .. _expressions-log2: -log2 -^^^^ +``log2`` +^^^^^^^^^ Returns the base-two logarithm of the input. @@ -6273,8 +6275,8 @@ Returns the sine of the input. .. _expressions-sqrt: -sqrt -^^^^ +``sqrt`` +^^^^^^^^^ Returns the square root of the input. @@ -6480,10 +6482,10 @@ circumstances. .. _function-colorspace: -colorSpace -^^^^^^^^^^ +``colorSpace`` +^^^^^^^^^^^^^^^ -*Optional* :ref:`types-enum`. *One of* rgb, lab, hcl. +*Optional* :ref:`types-enum`. *One of* ``rgb``, ``lab``, ``hcl``. The color space in which colors interpolated. Interpolating colors in perceptual color spaces like LAB and HCL tend to produce color ramps @@ -6491,11 +6493,11 @@ that look more consistent and produce colors that can be differentiated more easily than those interpolated in RGB space. -rgb +``rgb`` Use the RGB color space to interpolate color values -lab +``lab`` Use the LAB color space to interpolate color values. -hcl +``hcl`` Use the HCL color space to interpolate color values, interpolating the Hue, Chroma, and Luminance channels individually. @@ -6569,9 +6571,9 @@ the first is a zoom level and the second is a function output value. The rendered values of :ref:`types-color`, :ref:`types-number`, and :ref:`types-array` properties are -intepolated between stops. :ref:`types-enum`, +interpolated between stops. :ref:`types-enum`, :ref:`types-boolean`, and :ref:`types-string` property -values cannot be intepolated, so their rendered values only change at +values cannot be interpolated, so their rendered values only change at the specified stops. There is an important difference between the way that zoom functions @@ -6591,7 +6593,7 @@ zoom levels.) **Property functions** allow the appearance of a map feature to change with its properties. Property functions can be used to visually -differentate types of features within the same layer or create data +differentiate types of features within the same layer or create data visualizations. Each stop is an array with two elements, the first is a property input value and the second is a function output value. Note that support for property functions is not available across all @@ -6686,23 +6688,23 @@ Comparison Filters Set Membership Filters ^^^^^^^^^^^^^^^^^^^^^^ -``["in", key, v0, ..., vn]`` set inclusion: feature[key] ∈ {v0, ..., vn} +``["in", key, v0, ..., vn]`` set inclusion: feature[key] ∈ {v_0, ..., v_n} -``["!in", key, v0, ..., vn]`` set exclusion: feature[key] ∉ {v0, ..., -vn} +``["!in", key, v0, ..., vn]`` set exclusion: feature[key] ∉ {v_0, ..., +v_n} Combining Filters ^^^^^^^^^^^^^^^^^ -``["all", f0, ..., fn]`` logical ``AND``: f0 ∧ ... ∧ fn +``["all", f0, ..., fn]`` logical ``AND``: f_0 ∧ ... ∧ f_n -``["any", f0, ..., fn]`` logical ``OR``: f0 ∨ ... ∨ fn +``["any", f0, ..., fn]`` logical ``OR``: f_0 ∨ ... ∨ f_n -``["none", f0, ..., fn]`` logical ``NOR``: ¬f0 ∧ ... ∧ ¬fn +``["none", f0, ..., fn]`` logical ``NOR``: ¬f_0 ∧ ... ∧ ¬f_n @@ -6716,7 +6718,7 @@ following special keys: ``"=="``, ``"!="``, ``"has"``, ``"!has"``, ``"in"``, and ``"!in"`` operators. -A value (and v0, ..., vn for set operators) must be a +A value (and v_0, ..., v_n for set operators) must be a :ref:`types-string`, :ref:`types-number`, or :ref:`types-boolean` to compare the property value against. @@ -6728,8 +6730,9 @@ comparisons; for example, all of the following evaluate to false: ``0 < "1"``, ``2 == "2"``, ``"true" in [true, false]``. The ``"all"``, ``"any"``, and ``"none"`` filter operators are used to -create compound filters. The values f0, ..., fn must be filter +create compound filters. The values f\_0, ..., f\_n must be filter expressions themselves. + :: ["==", "$type", "LineString"] @@ -6737,6 +6740,7 @@ expressions themselves. This filter requires that the ``class`` property of each feature is equal to either "street\_major", "street\_minor", or "street\_limited". + :: ["in", "class", "street_major", "street_minor", "street_limited"] @@ -6749,6 +6753,7 @@ feature must have a ``class`` equal to "street\_limited", its be Polygon. You could change the combining filter to "any" to allow features matching any of those criteria to be included - features that are Polygons, but have a different ``class`` value, and so on. + :: [ diff --git a/docs/user/unsupported/process/gui.rst b/docs/user/unsupported/process/gui.rst index 37f00392c63..7af7febe73f 100644 --- a/docs/user/unsupported/process/gui.rst +++ b/docs/user/unsupported/process/gui.rst @@ -3,7 +3,7 @@ GUI Once you have some processes implemented, there are various ways to execute them in the context of an application. -The process API uses **Parameter** to describe the available input parameters. You can use this with ** JParameterListWizard** to quickly +The process API uses ``Parameter`` to describe the available input parameters. You can use this with ``JParameterListWizard`` to quickly accept input from a user. Using Processes in a GUI @@ -20,8 +20,8 @@ This GUI was thrown together quickly for testing and so you may notice some layo But it is a good example of how a GUI can be built on top of the Process API. -* You can examine the code in the the org.geotools.gui.swing.process - package and you can run the application from the JProcessWizard.java +* You can examine the code in the ``org.geotools.gui.swing.process`` + package and you can run the application from the ``JProcessWizard.java`` class. Screenshot of Wizard: @@ -33,9 +33,9 @@ Some notes about this GUI: * the GUI is based on a Swing Wizard model * it should list all available processes implemented in the process API, so if you correctly add new ones they should also appear -* it supports the ability to dynamically add new param widgets for inputs +* it supports the ability to dynamically add new parameter widgets for inputs that can take any number of values -* it currently creates input widgets for Doubles and Geometries, and falls +* it currently creates input widgets for ``Doubles`` and ``Geometries``, and falls back on the converter API for any other type * geometries are expected to be input in Well-Known-Text (WKT) format. diff --git a/docs/user/unsupported/process/implement.rst b/docs/user/unsupported/process/implement.rst index 956ad322d90..6bb29ce7062 100644 --- a/docs/user/unsupported/process/implement.rst +++ b/docs/user/unsupported/process/implement.rst @@ -12,7 +12,7 @@ For our example, let's create a geometry buffer process (the code for this is al 0. Create a New Project - Create a new project for your process using your favourite IDE or maven. + Create a new project for your process using your favorite IDE or maven. 1. Create Process Factory @@ -149,22 +149,22 @@ For our example, let's create a geometry buffer process (the code for this is al } 3. Finally, we need to make sure our new factory will get found and listed by the - Processors FactoryFinder. + Processors ``FactoryFinder``. Create a "services" file to list your factory with the plugin system: - * /src/main/resources/META-INF/services/org.geotools.process.ProcessFactory + * :file:`/src/main/resources/META-INF/services/org.geotools.process.ProcessFactory` 4. List your factories (one per line) in the above file:: org.geotools.process.BufferFactory -5. When this is combined into a jar; the ProcessFactoryFinder will use the files - in META-INF to "discover" your process factory. +5. When this is combined into a jar; the ``ProcessFactoryFinder`` will use the files + in ``META-INF`` to "discover" your process factory. 4. Now we can use the new process. Let's write a JUnit test to ensure it works. - Create a JUnit test case in the test folder, let's call it MyProcessTest.java:: + Create a JUnit test case in the test folder, let's call it ``MyProcessTest.java``:: public class MyProcessTest extends TestCase { diff --git a/docs/user/unsupported/process/internal.rst b/docs/user/unsupported/process/internal.rst index 15f33ea2582..e017a2c876f 100644 --- a/docs/user/unsupported/process/internal.rst +++ b/docs/user/unsupported/process/internal.rst @@ -19,7 +19,7 @@ This API allows developers to: * execute processes * track the progress of an executing process -This API allows implementors to: +This API allows implementers to: * define what the input parameters are (with a map of parameters) * define what the output parameters are (with a map of results) @@ -30,9 +30,9 @@ A main design goal of this module is to make a process quick and easy to impleme Process ^^^^^^^ -The Process interface is used to define a process. Making a new process is simple and only requires implementing the execute method (which is where the work is done to actually run a process). This method accepts the inputs and a ProgressListener. It is up to the implementor to update this listener with the progress of the process execution. There is also a SimpleProcess abstract class that simple processes can extend when they are so quick to execute that updating the progress is not necessary. +The Process interface is used to define a process. Making a new process is simple and only requires implementing the execute method (which is where the work is done to actually run a process). This method accepts the inputs and a ``ProgressListener``. It is up to the implementer to update this listener with the progress of the process execution. There is also a ``SimpleProcess`` abstract class that simple processes can extend when they are so quick to execute that updating the progress is not necessary. -BufferProcess example:: +``BufferProcess`` example:: class BufferProcess extends AbstractProcess { private boolean started = false; @@ -86,17 +86,17 @@ BufferProcess example:: } } -ProcessFactory -^^^^^^^^^^^^^^ +``ProcessFactory`` +^^^^^^^^^^^^^^^^^^ -To advertise (and describe) a process implementation (like buffer above) we will need to create a ProcessFactory. +To advertise (and describe) a process implementation (like buffer above) we will need to create a ``ProcessFactory``. -The ProcessFactory interface is used to describe a process and its parameters, and for creating new instances of those processes. Typically, a ProcessFactory will be found and created using the Processors FactoryFinder. Below is an example of an implemented ProcessFactory. +The ``ProcessFactory`` interface is used to describe a process and its parameters, and for creating new instances of those processes. Typically, a ``ProcessFactory`` will be found and created using the Processors ``FactoryFinder``. Below is an example of an implemented ``ProcessFactory``. The process factory includes other implementation (like name and version) to allow user interfaces and WPS implementations to make this service available in a controlled manner. -BufferFactory Example:: +``BufferFactory`` Example:: public class BufferFactory extends AbstractProcessFactory { // making parameters available as static constants to help java programmers @@ -180,7 +180,7 @@ The Parameter interface provides a way to define these objects. This interface c The Parameter interface is part of the 04 API module and is used to define connection parameters for data access. -Here is an example of asking the user to supply a "geomIn" parameter:: +Here is an example of asking the user to supply a ``geomIn`` parameter:: Parameter geomInput = new Parameter("geomIn", Geometry.class, Text.text("Geometry"), Text.text("Geometry input parameter"), true, 2, -1, null, null); @@ -192,11 +192,11 @@ In a similar manner you can indicate the result you produce:: Process Executor ^^^^^^^^^^^^^^^^ -The ProcessExecutor provides methods to manage process executions and for tracking asynchronous tasks. By implementing the submit method that returns a Progress object, the process execution can be tracked or terminated. Below is an example of a very simple implementation of the ProcessExecutor interface. +The ``ProcessExecutor`` provides methods to manage process executions and for tracking asynchronous tasks. By implementing the submit method that returns a Progress object, the process execution can be tracked or terminated. Below is an example of a very simple implementation of the ``ProcessExecutor`` interface. You may wish to implement the Process Executor class if you are backing onto an existing scheduling facility such as that provided by a workflow engine. -ThreadPoolProcessExecutor Example:: +``ThreadPoolProcessExecutor`` Example:: public class ThreadPoolProcessExecutor extends ThreadPoolExecutor implements ProcessExecutor { diff --git a/docs/user/unsupported/process/process-feature.rst b/docs/user/unsupported/process/process-feature.rst index bb486838200..74caac990a7 100644 --- a/docs/user/unsupported/process/process-feature.rst +++ b/docs/user/unsupported/process/process-feature.rst @@ -1,7 +1,7 @@ Process Feature Plugin ---------------------- -The gt-process-feature plugin gathers up a number of high quality processes for working with +The ``gt-process-feature`` plugin gathers up a number of high quality processes for working with vector information. **Maven**:: @@ -42,7 +42,7 @@ This is a very flexible process which can be used to: id: Long summary=description summary: String description: String -* Process geometry - using functions like "the_geom=simplify( the_geom, 2.0 )" or "the_geom=centriod( the_geom )":: +* Process geometry - using functions like ``the_geom=simplify( the_geom, 2.0 )`` or ``the_geom=centriod( the_geom )``:: INPUT Schema DEFINITION OUTPUT Schema the_geom: Polygon the_geom=centriod(the_geom) the_geom: Point @@ -50,7 +50,7 @@ This is a very flexible process which can be used to: id: Long id id: Long description: String description description: String -* Generate additional attributes using the form: area=area( the_geom ):: +* Generate additional attributes using the form: ``area=area( the_geom )``:: INPUT Schema DEFINITION OUTPUT Schema the_geom: Polygon the_geom=centriod(the_geom) the_geom: Point @@ -59,4 +59,4 @@ This is a very flexible process which can be used to: description: String description description: String area=area( the_geom) area: Double text=concatenate(name,'-',id) text: String - \ No newline at end of file + diff --git a/docs/user/unsupported/process/process-raster.rst b/docs/user/unsupported/process/process-raster.rst index 6dac151f4a9..3bfea5ad1fd 100644 --- a/docs/user/unsupported/process/process-raster.rst +++ b/docs/user/unsupported/process/process-raster.rst @@ -1,7 +1,7 @@ Process Raster Plugin ---------------------- -The gt-process-raster plugin a provides a number of ready to use raster processign chains - and +The ``gt-process-raster`` plugin a provides a number of ready to use raster processing chains - and provide a great example of how to work with rasters. **Maven**:: diff --git a/docs/user/unsupported/process/process.rst b/docs/user/unsupported/process/process.rst index 16bc4165981..0b7c3c7cdb1 100644 --- a/docs/user/unsupported/process/process.rst +++ b/docs/user/unsupported/process/process.rst @@ -52,7 +52,7 @@ method in question. By convention the last parameter is a progress monitor you can use to report back what is going on to your user - and let them cancel. -Since processes can take minuets to hours this is a good plan.:: +Since processes can take minutes to hours this is a good plan.:: features = RasterToVectorProcess.process( gridCoverage, 2, Collections.EMPTY, monitor ); @@ -93,14 +93,14 @@ to report progress below).:: ProgressListener progress = new ProgressWindow(null); Map results = r2v.execute(params, progress); -Using a ProcessorExecutor -''''''''''''''''''''''''' +Using a ``ProcessorExecutor`` +'''''''''''''''''''''''''''''' The real fun with using the Processes utility class is that you can set up work and then schedule the work in two separate steps. This is a great way to use multi-core processors in your application. -1. You can then use a ProcessorExecutor is going to be in charge of running your processes - you +1. You can then use a ``ProcessorExecutor`` is going to be in charge of running your processes - you can indicate how many threads you want it to keep going at once. A good idea is the number of cores you have plus 1.:: @@ -108,7 +108,7 @@ your application. ProcessExecutor schedule = Processors.newProcessExecutor( 3, null ); 2. You can then schedule your process - which will produce a Progress - this is a placeholder - object that you can use to retrive the answer when it is ready. + object that you can use to retrieve the answer when it is ready. You can think of it like a "work ticket".:: diff --git a/docs/user/unsupported/swing/dialog.rst b/docs/user/unsupported/swing/dialog.rst index 4ae58b36cb5..68d586e1c6a 100644 --- a/docs/user/unsupported/swing/dialog.rst +++ b/docs/user/unsupported/swing/dialog.rst @@ -1,13 +1,13 @@ Dialog classes -------------- -JFileDataStoreChooser -^^^^^^^^^^^^^^^^^^^^^ +``JFileDataStoreChooser`` +^^^^^^^^^^^^^^^^^^^^^^^^^ -This is a dialog class to prompt a user for a data store such as a shapefile. It relieves you of having to work with JFileChooser and FileFilters directly. +This is a dialog class to prompt a user for a data store such as a shapefile. It relieves you of having to work with ``JFileChooser`` and ``FileFilters`` directly. * To prompt for a file of given format you can use the static - showOpenFile method as in this snippet:: + ``showOpenFile`` method as in this snippet:: // Prompt the user for a shapefile (the null argument here is // for a parent frame or dialog) @@ -23,7 +23,7 @@ This is a dialog class to prompt a user for a data store such as a shapefile. It * Formats with alternate file extensions - Another form of the showOpenFile method allows alternate file extensions to be + Another form of the ``showOpenFile`` method allows alternate file extensions to be specified:: // Prompt for a geotiff file that may have a tif or tiff @@ -35,8 +35,8 @@ This is a dialog class to prompt a user for a data store such as a shapefile. It * Prompting for an output file name - In this snippet, taken from the GeoTools example demo Shp2Shp.java, we create - a JFileDataStoreChooser object and prompt the user for the name of an output + In this snippet, taken from the GeoTools example demo ``Shp2Shp.java,`` we create + a ``JFileDataStoreChooser`` object and prompt the user for the name of an output shapefile:: String newPath = ... @@ -50,12 +50,12 @@ This is a dialog class to prompt a user for a data store such as a shapefile. It } File newFile = chooser.getSelectedFile(); -JFontChooser -^^^^^^^^^^^^ +``JFontChooser`` +^^^^^^^^^^^^^^^^ No surprises here... it's a font dialog. -This is used by JSimpleStyleDialog but is also available for general use. It includes a static helper method to display the dialog and return a GeoTools Font object. +This is used by ``JSimpleStyleDialog`` but is also available for general use. It includes a static helper method to display the dialog and return a GeoTools ``Font`` object. .. image:: /images/font_dialog.gif :scale: 60 @@ -87,8 +87,8 @@ This is used by JSimpleStyleDialog but is also available for general use. It inc selectedFont = myFaveFont; } -JSimpleStyleDialog -^^^^^^^^^^^^^^^^^^ +``JSimpleStyleDialog`` +^^^^^^^^^^^^^^^^^^^^^^^ This dialog presents basic options for point, line, polygon and text styling. It saves you from having to provide SLD documents or write styling code for your application when the feature styling requirements are modest. diff --git a/docs/user/unsupported/swing/faq.rst b/docs/user/unsupported/swing/faq.rst index c31ece0ec41..53aabe96c7a 100644 --- a/docs/user/unsupported/swing/faq.rst +++ b/docs/user/unsupported/swing/faq.rst @@ -4,7 +4,7 @@ Swing FAQ Q: What is JMapPane for? ^^^^^^^^^^^^^^^^^^^^^^^^ -The JMapPane class is primiarly used as a teaching aid for the +The JMapPane class is primarily used as a teaching aid for the :doc:`tutorials ` used to explore the GeoTools library. It is developed in collaboration with the user list, and while not a intended as a @@ -14,7 +14,7 @@ Q: What is the best way to simulate a car moving on a map? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ There is a flying saucers demo you can review; but the real answer is to set up a second -raster to draw your moving car into; and draw that over top of the map rendered by gt-renderer. +raster to draw your moving car into; and draw that over top of the map rendered by ``gt-renderer``. Remember that JMapPane is just a demo showing how you can use StreamingRenderer to draw into a BufferedImage. You can do the same thing in your own code; and have one buffered image for the @@ -26,7 +26,7 @@ Q: JMapPane is Slow how do I make it faster? This really comes down to how you use the GeoTools renderer. Remember that the GeoTools renderer is doing a lot of calculation and data access; not what you want in the middle of animation. -The gt-renderer is optimised for memory use; it does not loading your data into memory +The ``gt-renderer`` is optimized for memory use; it does not loading your data into memory (it is drawing from disk, or database, each time). You can experiment with loading your data into memory (specifically into a spatial index) if you want faster performance out of it. diff --git a/docs/user/unsupported/swing/index.rst b/docs/user/unsupported/swing/index.rst index f4e8a36bf20..36d6ed46a0b 100644 --- a/docs/user/unsupported/swing/index.rst +++ b/docs/user/unsupported/swing/index.rst @@ -1,19 +1,19 @@ Swing ===== -The **gt-swing** module contains GUI and utility classes which are based on the Java Swing library. Its main use is to +The ``gt-swing`` module contains GUI and utility classes which are based on the Java Swing library. Its main use is to provide the visual components for the GeoTools `tutorial applications <../../tutorial/index.html>`_. You can also use it for basic display purposes in your own projects, or use the classes as a starting point for your own custom components. If you are unfamiliar with the Swing library, the Oracle `Swing tutorial `_ is a good place to start. -This module is not intended to be a fully-featured GUI widget set for geo-spatial applications. The focus of the +This module is not intended to be a fully-featured GUI widget set for geospatial applications. The focus of the GeoTools project is on handling geospatial data, not developing user interface components. If you want to build a GIS application with all the GUI bells and whistles that's great and GeoTools is here to help you, but we can't do it for you. .. tip:: - For a ready-made, fully-featured, extendible desktop GIS application based on + For a ready-made, fully-featured, extendable desktop GIS application based on GeoTools, see `uDig `_ which is based on `SWT `_ rather than Swing. @@ -45,16 +45,16 @@ you. **Overview** -The module is centred around **JMapPane**, a spatially-aware canvas class which works with the GeoTools rendering +The module is centered around ``JMapPane``, a spatially-aware canvas class which works with the GeoTools rendering system. If you need basic display services in your application this is the class you should start with. On the other -hand, if you all need is to quickly display one or more layers, **JMapFrame** is your friend. This is a top-level frame -class containing a JMapPane plus, optionally, a toolbar, status bar and layer list table. It is used extensively in the -GeoTools tutorial applications. For simplest uses it has a static *showMap* method, as used in the GeoTools `Quickstart +hand, if you all need is to quickly display one or more layers, ``JMapFrame`` is your friend. This is a top-level frame +class containing a ``JMapPane`` plus, optionally, a toolbar, status bar and layer list table. It is used extensively in the +GeoTools tutorial applications. For simplest uses it has a static ``showMap`` method, as used in the GeoTools `Quickstart example <../../tutorial/quickstart/index.html>`_. -The module also provides a small selection of dialog classes including **JFileDataStoreChooser**, a format-aware version -of Swing's JFileChooser; **JDataStoreWizard** to prompt for connection parameters for a data store; -**JSimpleStyleDialog** to set basic rendering style elements for vector layers; **JCRSChooser** to select a map +The module also provides a small selection of dialog classes including ``JFileDataStoreChooser``, a format-aware version +of Swing's ``JFileChooser``; ``JDataStoreWizard`` to prompt for connection parameters for a data store; +``JSimpleStyleDialog`` to set basic rendering style elements for vector layers; ``JCRSChooser`` to select a map projection. **History** diff --git a/docs/user/unsupported/swing/jmappane.rst b/docs/user/unsupported/swing/jmappane.rst index 4f84f55c42f..333e88ddafc 100644 --- a/docs/user/unsupported/swing/jmappane.rst +++ b/docs/user/unsupported/swing/jmappane.rst @@ -1,8 +1,8 @@ -JMapPane canvas class ---------------------- +``JMapPane`` canvas class +-------------------------- -JMapPane is a spatially-aware canvas component derived from Swing's **JPanel** class. It works with the GeoTools rendering -system to display features. The following snippet shows a typical way of setting up a JMapPane:: +``JMapPane`` is a spatially-aware canvas component derived from Swing's ``JPanel`` class. It works with the GeoTools rendering +system to display features. The following snippet shows a typical way of setting up a ``JMapPane``:: // Create a MapContent instance and add one or more layers to it MapContent map = new MapContent(); @@ -24,7 +24,7 @@ You can also set, or even replace, the renderer and/or map content objects of an Display area and map scale ^^^^^^^^^^^^^^^^^^^^^^^^^^ -By default, JMapPane displays the full extent of layers in the associated MapContent when it is first shown on screen. +By default, ``JMapPane`` displays the full extent of layers in the associated ``MapContent`` when it is first shown on screen. You can set a specific area to display, in world coordinates, before and/or after showing the pane:: // Set an area of the map to display. This will cause the map pane @@ -39,8 +39,8 @@ You can query the current area displayed:: How map position and scale are calculated ''''''''''''''''''''''''''''''''''''''''' -JMapPane uses `MapViewport `_ for display -area calculations. When you specify an area to display, in world coordinates, the area is first centred in the map pane +``JMapPane`` uses `MapViewport `_ for display +area calculations. When you specify an area to display, in world coordinates, the area is first centered in the map pane and then, if necessary, it is made either taller or wider to match the *aspect ratio* (width to height) of the pane's screen area as illustrated below. For this reason, the envelope returned by the *getDisplayArea* method will generally be larger than one previously passed to *setDisplayArea*. @@ -49,9 +49,9 @@ be larger than one previously passed to *setDisplayArea*. When the pane is resized on screen, the scale of the map and its position relative to the pane remain constant. -Internally, world (map) coordinates are related to screen (pixel) coordinates with AffineTransforms (see the +Internally, world (map) coordinates are related to screen (pixel) coordinates with ``AffineTransforms`` (see the `AffineTransform tutorial `_ for an introduction). You can access the -transforms directly via the *getWorldToScreen()* and *getScreenToWorld()* methods. This can be useful if you wish to +transforms directly via the ``getWorldToScreen()`` and ``getScreenToWorld()`` methods. This can be useful if you wish to draw on top of the map pane or calculate the current map scale:: // Find the current map scale (map unit to screen pixel) @@ -64,9 +64,9 @@ Handling mouse events The swing module provides spatially-aware mouse event and listener classes which you can use to track the position of the mouse cursor in both screen and world coordinates. To listen to map pane mouse events, implement the -**MapMouseListener** interface or, for simple cases, extend the **MapMouseAdapter** class which has empty -implementations of all of the inteface methods. A listening object receives **MapMouseEvents** which extend Swing's -standard MouseEvent class to add world position data. +``MapMouseListener`` interface or, for simple cases, extend the ``MapMouseAdapter`` class which has empty +implementations of all of the interface methods. A listening object receives ``MapMouseEvents`` which extend Swing's +standard ``MouseEvent`` class to add world position data. This example prints the world position of mouse clicks to the console as well as notifying when the mouse enters or exits the map pane. @@ -80,7 +80,7 @@ exits the map pane. Linking to Action classes for interactive use ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The swing module includes a small selection of Action classes that make it easy to create toobar buttons or other controls for zooming, panning and resetting the map display. +The swing module includes a small selection of Action classes that make it easy to create toolbar buttons or other controls for zooming, panning and resetting the map display. For example, this code creates two toolbar buttons to zoom in and out:: @@ -98,13 +98,13 @@ For example, this code creates two toolbar buttons to zoom in and out:: toolBar.add(zoomOutBtn); cursorToolGrp.add(zoomOutBtn); -The zoom Action classes in the code above are each associated with a map pane CursorTool class (e.g. ZoomInTool) which handles setting the cursor and responding to mouse actions. You can use these tool and Action classes as the starting point for your own specialized controls. +The zoom ``Action`` classes in the code above are each associated with a map pane ``CursorTool`` class (e.g. ``ZoomInTool``) which handles setting the cursor and responding to mouse actions. You can use these tool and Action classes as the starting point for your own specialized controls. Example ''''''' -1. You will need to define your own MapContent (defining what - layers to display) prior to using a JMapPane:: +1. You will need to define your own ``MapContent`` (defining what + layers to display) prior to using a ``JMapPane``:: private static void showMap(MapContent map) throws IOException { final JMapPane mapPane = new JMapPane(new StreamingRenderer(), map); @@ -148,7 +148,7 @@ Example Actions ^^^^^^^ -The ZoomInAction, ZoomOutAction, PanAction actions used in the above example shows changing the map "state" (the state of the map controls what it does in response to mouse clicks). +The ``ZoomInAction``, ``ZoomOutAction``, ``PanAction`` actions used in the above example shows changing the map "state" (the state of the map controls what it does in response to mouse clicks). You will find ready to go actions that also change the map state:: @@ -159,7 +159,7 @@ You will find ready to go actions that also change the map state:: * Mouse Wheel -MapFrame now registers a ScrollWheelTool in initComponents if the toolset contains Tool.SCROLLWHEEL:: +``MapFrame`` now registers a ``ScrollWheelTool`` in ``initComponents`` if the ``toolset`` contains ``Tool.SCROLLWHEEL``:: if(toolSet.contains(Tool.SCROLLWHEEL)) { mapPane.addMouseListener(new ScrollWheelTool(mapPane)); diff --git a/docs/user/unsupported/swing/wizard.rst b/docs/user/unsupported/swing/wizard.rst index cb0a0682b54..87ad4a8cf75 100644 --- a/docs/user/unsupported/swing/wizard.rst +++ b/docs/user/unsupported/swing/wizard.rst @@ -3,14 +3,14 @@ Wizard classes Wizards are dialogs that prompt for user inputs, possibly with a sequence of dialog pages (think Next and Back buttons). They also provide validation of the inputs. -Swing doesn't have a wizard class so GeoTools has filled this void with JWizard. +Swing doesn't have a wizard class so GeoTools has filled this void with ``JWizard``. -JDataStoreWizard -^^^^^^^^^^^^^^^^ +``JDataStoreWizard`` +^^^^^^^^^^^^^^^^^^^^ Quickly collect connection parameter information for a DataStore: -The DataStore api makes use of a list of **Parameter**s to describe valid connection parameters. You can make use of **JDataStoreWizard** to prompt the user for appropriate values. +The ``DataStore`` API makes use of a list of ``Parameter``\ s to describe valid connection parameters. You can make use of ``JDataStoreWizard`` to prompt the user for appropriate values. * You can allow your user to select the kind of DataStore they want to use:: @@ -51,7 +51,7 @@ The DataStore api makes use of a list of **Parameter**s to describe valid connec .. image:: /tutorial/filter/images/shapeWizard2.png :scale: 60 -* Or you can prompt for a specific datastore; such as ShapefileDataStoreFactory:: +* Or you can prompt for a specific datastore; such as ``ShapefileDataStoreFactory``:: DataStoreFactorySpi format = new ShapefileDataStoreFactory(); JDataStoreWizard wizard = new JDataStoreWizard(format); @@ -64,10 +64,10 @@ The DataStore api makes use of a list of **Parameter**s to describe valid connec } } -JParameterListWizard -^^^^^^^^^^^^^^^^^^^^ +``JParameterListWizard`` +^^^^^^^^^^^^^^^^^^^^^^^^ -The process api also makes use of a list of **Parameter**s to describe inputs. You can make use of **JParameterListWizard** to prompt the user for appropriate values. +The process API also makes use of a list of ``Parameter``\ s to describe inputs. You can make use of ``JParameterListWizard`` to prompt the user for appropriate values. .. image:: /images/paramlistwizard.png @@ -92,10 +92,10 @@ Example:: File imageFile = (File) wizard.getConnectionParameters().get("image"); File shapeFile = (File) wizard.getConnectionParameters().get("shape"); -JWizard -^^^^^^^ +``JWizard`` +^^^^^^^^^^^ -The base class for these wizards is **JWizard**, you can use this base class in the construction of your own custom wizards. +The base class for these wizards is ``JWizard``, you can use this base class in the construction of your own custom wizards. Example ''''''' @@ -103,10 +103,12 @@ Example The following example shows how to create a wizard from scratch using the base classes mentioned above. * Page 1 - .. image:: /images/jwizard1.gif + + .. image:: /images/jwizard1.png * Page 2 - .. image:: /images/jwizard2.gif + + .. image:: /images/jwizard2.png You can download the complete example here: :download:`JExampleWizard.java ` @@ -127,25 +129,25 @@ You can download the complete example here: :download:`JExampleWizard.java @@ -111,7 +112,7 @@ add a viewContribution to the viewActions and finally all the actions we need th 2. Then we have to implement the action itself. - That is fairly easy, since we can delegate the activation of the tools to the gt-swt map panel:: + That is fairly easy, since we can delegate the activation of the tools to the ``gt-swt`` map panel:: public class InfoAction implements IViewActionDelegate { private IViewPart view; @@ -131,7 +132,7 @@ add a viewContribution to the viewActions and finally all the actions we need th Adding the layer addition as menu commands ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -One last thing we will add is a command to load shapefiles from the filesystem. This just to show +One last thing we will add is a command to load shapefiles from the file system. This just to show how to retrieve the map panel in case the view is not directly accessible. 1. First you create a command through the proper extension point. It should look like this:: @@ -140,7 +141,7 @@ how to retrieve the map panel in case the view is not directly accessible. point="org.eclipse.ui.commands"> @@ -159,7 +160,7 @@ how to retrieve the map panel in case the view is not directly accessible. -3. Last thing is to implement the org.geotools.swt.actions.OpenShapefileCommand, that we supplied in +3. Last thing is to implement the + ``org.geotools.swt.actions.OpenShapefileCommand``, that we supplied in the above command as the one that would handle the command. There is not that much behind that. We open a file browser, gather the selected file and add it to - the mapcontext of the map pane, that we as usual retrieve from the map view:: + the ``mapcontext`` of the map pane, that we as usual retrieve from the map view:: public class OpenShapefileCommand extends AbstractHandler { @@ -181,13 +183,10 @@ how to retrieve the map panel in case the view is not directly accessible. public Object execute( ExecutionEvent event ) throws ExecutionException { IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); MapView mapView = (MapView) activePage.findView(MapView.ID); - SwtMapPane mapPane = mapView.getMapPane(); - Display display = Display.getCurrent(); Shell shell = new Shell(display); File openFile = JFileDataStoreChooser.showOpenFile(new String[]{"*.shp"}, shell); - try { if (openFile != null && openFile.exists()) { MapContext mapContext = mapPane.getMapContext(); @@ -207,11 +206,11 @@ how to retrieve the map panel in case the view is not directly accessible. Resulting RCP ^^^^^^^^^^^^^ -If everything went smooth, you should be able to run the application and see something like: +If everything went smoothly, you should be able to run the application and see something like: .. image:: /images/gtswt_rcp_01.png And with some layers loaded: -.. image:: /images/gtswt_rcp_02.png \ No newline at end of file +.. image:: /images/gtswt_rcp_02.png diff --git a/docs/user/unsupported/swt/swtmapframe.rst b/docs/user/unsupported/swt/swtmapframe.rst index 24797201e99..e1148238f5a 100644 --- a/docs/user/unsupported/swt/swtmapframe.rst +++ b/docs/user/unsupported/swt/swtmapframe.rst @@ -1,14 +1,14 @@ SWTMapFrame ----------- -The following is a tutorial that explains how to use the gt-swt module in standalone mode and inside -an rcp environment. The tutorial assumes the user is already confident with geotools -development/build and already an basic RCP developer. +The following is a tutorial that explains how to use the ``gt-swt`` module in standalone mode and inside +an RCP environment. The tutorial assumes the user is already confident with +GeoTools development/build and already an basic RCP developer. Example ^^^^^^^ -Using the standalone gt-swt module is fairly easy. +Using the standalone ``gt-swt`` module is fairly easy. 1. It is best explained with a code snippet:: @@ -34,8 +34,8 @@ Using the standalone gt-swt module is fairly easy. .. image:: /images/gtswt_standalone_01.png -2. It is possible to tweak some of the window settings, like statusbar, layers panel and - toolbars/menus. For this use we have to move beyond our call to SwtMapFrame.showMap(context) +2. It is possible to tweak some of the window settings, like ``statusbar``, ``layers panel`` and + ``toolbars/menus``. For this use we have to move beyond our call to ``SwtMapFrame.showMap(context)`` The result is equally easy. Again a code snippet is the best way. @@ -51,4 +51,4 @@ Using the standalone gt-swt module is fairly easy. Which results in: - .. image:: /images/gtswt_standalone_01.png \ No newline at end of file + .. image:: /images/gtswt_standalone_01.png diff --git a/docs/user/unsupported/wps.rst b/docs/user/unsupported/wps.rst index 3611051500b..4d56fc9945c 100644 --- a/docs/user/unsupported/wps.rst +++ b/docs/user/unsupported/wps.rst @@ -3,7 +3,7 @@ WPS The WPS module provides a "WPS client" API so programmers can easily build Web Process Service requests and parse the responses. This module allows developers to -create getCapabilities, describeProcess and Execute requests for WPS servers +create ``getCapabilities``, ``describeProcess`` and ``execute`` requests for WPS servers send requests and parse responses into objects **Maven**:: @@ -26,25 +26,25 @@ taking care of creating requests, sending requests, and parsing responses. The following are some of the core objects for this module: -* WebProcessingService +* ``WebProcessingService`` - The main object of the design is the WebProcessingService class. WebProcessingService acts as a + The main object of the design is the ``WebProcessingService`` class. ``WebProcessingService`` acts as a proxy for a remote WPS Server and can be used to examine and retrieve information from the server, and to execute processes the server provides. To begin communicating with a server, pass in a URL pointing to a WPS Capabilities document (view examples below). -* WPSFactory +* ``WPSFactory`` - This class wraps around an AbstractProcessFactory from the Process Plugin. By providing it a - ProcessDescriptionType bean (which can be fetched from a WebProcessingService describeProcess + This class wraps around an ``AbstractProcessFactory`` from the Process Plugin. By providing it a + ``ProcessDescriptionType`` bean (which can be fetched from a ``WebProcessingService`` ``describeProcess`` request) it will build a Process Factory based on that process definition. This factory can then build processes which can be executed (view examples below). -* WPSProcess +* ``WPSProcess`` - After creating a WPSFactory, you can build processes from it. This class wraps around a - AbstractProcess from the Process Plugin. By calling its execute method, it will build up + After creating a ``WPSFactory``, you can build processes from it. This class wraps around a + ``AbstractProcess`` from the Process Plugin. By calling its execute method, it will build up a request object, send it, then parse and return the results. By using these wrapper classes, a programmer can quickly build process requests and get results @@ -53,7 +53,7 @@ The following are some of the core objects for this module: WPS with custom HTTPClient Example ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The following example shows how to create a WebProcessingService using a custom implementation of org.geotools.data.ows.HTTPClient :: +The following example shows how to create a ``WebProcessingService`` using a custom implementation of ``org.geotools.data.ows.HTTPClient``:: public class MyWpsHTTPClient implements HTTPClient { @@ -115,19 +115,19 @@ The following example shows how to create a WebProcessingService using a custom } } -It's possible now to allow the WecProcessingService make use of MyWpsHTTPClient by simply passing it to the class Constructor.:: +It's possible now to allow the ``WebProcessingService`` make use of ``MyWpsHTTPClient`` by simply passing it to the class Constructor.:: wps = new WebProcessingService(url, new MyWpsHTTPClient(), null); -Notice also that GeoTools already has an available implementation of HTTPClient which may be used for the most common cases, allowing also Basic authentication.:: +Notice also that GeoTools already has an available implementation of ``HTTPClient`` which may be used for the most common cases, allowing also Basic authentication.:: org.geotools.data.ows.SimpleHttpClient -WPS getCapabilties Example -^^^^^^^^^^^^^^^^^^^^^^^^^^ +WPS ``getCapabilties`` Example +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The following example shows how to create a WebProcessingService and use it to retrieve -a getCapabilities document.:: +The following example shows how to create a ``WebProcessingService`` and use it to retrieve +a ``getCapabilities`` document.:: URL url = new URL("http://localhost:8080/geoserver/ows?service=WPS&request=GetCapabilities"); WebProcessingService wps = new WebProcessingService(url); @@ -139,10 +139,10 @@ a getCapabilities document.:: You can now iterate over the list of processes the server offers. -WPS describeProcess Example -^^^^^^^^^^^^^^^^^^^^^^^^^^^ +WPS ``describeProcess`` Example +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -This example shows how to do a full describeProcess request from a WebProcessingService.:: +This example shows how to do a full ``describeProcess`` request from a ``WebProcessingService``.:: // create a WebProcessingService as shown above, then do a full describeprocess on my process DescribeProcessRequest descRequest = wps.createDescribeProcessRequest(); @@ -157,11 +157,11 @@ This example shows how to do a full describeProcess request from a WebProcessing // create a process Process process = wpsfactory.create(); -You now have a process built from the describeProcess description, which can be executed +You now have a process built from the ``describeProcess`` description, which can be executed as shown below. -WPS Execute Example -^^^^^^^^^^^^^^^^^^^ +WPS ``Execute`` Example +^^^^^^^^^^^^^^^^^^^^^^^^ This example builds from the previous ones and shows how to send a request to execute a simple "double addition" process.:: @@ -185,8 +185,8 @@ simple "double addition" process.:: Now you you have a result that was calculated on the WPS server. -WPS getExecutionResponse Example -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +WPS ``getExecutionResponse`` Example +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This example shows how to ask to the WPS for the status of a process request and handle the different status codes.:: diff --git a/docs/user/welcome/application.rst b/docs/user/welcome/application.rst index 7a61fd16d22..ebe37cb5a90 100644 --- a/docs/user/welcome/application.rst +++ b/docs/user/welcome/application.rst @@ -5,7 +5,7 @@ The GeoTools library allows you to integrate your own content using the Factory The code you provide will be usually be in the form of one of those interfaces we learned about when using the library (say DataStore if you are connecting the library up to a new form of content). -The exact form of registration depends on the environment the library is used in, in the simple case of dropping a jar on the class path we use the "Factory SPI" system provided as part of Java. In a complicated case like Eclipse we must hook into their plug-in system provided by the OSGi standards body. Depending on the system used you may be able to take further control (perhaps choosing definitions provided by the epsg-hsql module over those provided by epsg-wkt etc...). +The exact form of registration depends on the environment the library is used in, in the simple case of dropping a jar on the class path we use the "Factory SPI" system provided as part of Java. In a complicated case like Eclipse we must hook into their plug-in system provided by the OSGi standards body. Depending on the system used you may be able to take further control (perhaps choosing definitions provided by the ``epsg-hsql`` module over those provided by ``epsg-wkt`` etc...). These pages document hosting a GeoTools application in different environments, and provide guidelines for taking control of the process of lookup. @@ -17,7 +17,7 @@ Out of the box the GeoTools library operates using Java's built in "Factory SPI" Using Hints ''''''''''' -A hint is most useful to control the "default" behaviour of the library you expect out of the library. +A hint is most useful to control the "default" behavior of the library you expect out of the library. Example code (for your application):: @@ -55,7 +55,7 @@ Command Line } } -2. We can specify that the FactoryUsingWKT authority is used:: +2. We can specify that the ``FactoryUsingWKT`` authority is used:: java -Porg.opengis.referencing.crs.CRSAuthorityFactory=org.geotools.referencing.factory.epsg.FactoryUsingWKT PrintWSG84 @@ -81,11 +81,11 @@ This is useful when working with Applets where where access to the System proper Factory control of GeoTools ''''''''''''''''''''''''''' -The plugin system for geotools allows you to write your plugin; and then register it in your jar as a service so that the rest of the library can use it. To register make a text file with the complete name of your function class in META-INF/services/ +The plugin system for GeoTools allows you to write your plugin; and then register it in your jar as a service so that the rest of the library can use it. To register make a text file with the complete name of your function class in ``META-INF/services/`` -When adding a "Function" to GeoTools the name of the text file is the interface being implemented (in this case "org.opengis.filter.expression.Function"), the contents is a list of functions, one per line. I cannot remember if you need an extra line feed at the end of the file or not. +When adding a "Function" to GeoTools the name of the text file is the interface being implemented (in this case ``org.opengis.filter.expression.Function``), the contents is a list of functions, one per line. -For a good working example look at the cql module: +For a good working example look at the CQL module: * https://github.com/geotools/geotools/tree/master/modules/library/cql @@ -102,7 +102,7 @@ Combining the two Techniques You can combine the two techniques: -1. Add an entry to your MANIFEST/ so that GeoTools can find your Factory +1. Add an entry to your ``MANIFEST/`` so that GeoTools can find your Factory 2. Use a hint to ensure your Factory is chosen as the default Spring @@ -124,24 +124,24 @@ Using OSGi with GeoTools is a great idea, and one we are still working on. OSGi Single Plugin ''''''''''''' -The udig project uses this technique as a stopgap solution: place all the GeoTools jars +The uDig project uses this technique as a stopgap solution: place all the GeoTools jars into a single plugin will allow the Factory SPI system to function. The Eclipse environment uses OSGi to manage the loading and unloading of "bundles" of resources, such as the classes and raw data shipped as part of GeoTools. The environment is very safe and is -careful to use separate classloaders for each bundle; at a pragmatic level this means you will get +careful to use separate class loaders for each bundle; at a pragmatic level this means you will get class cast exceptions even when everything else looks correct. GeoTools makes use of a Factory SPI system to tie our modules together, this works by examining each -jar for a META-INF/services/\*.txt files. This works out of the box when all jars are loaded via the -same classloader (e.g. outside of OSGi with all jars on the CLASSPATH). +jar for a ``META-INF/services/*.txt`` files. This works out of the box when all jars are loaded via the +same class loader (e.g. outside of OSGi with all jars on the CLASSPATH). One of the main points of OSGi is providing a module system with strict visibility rules, so putting a collection of jars into one bundle rather defeats the purpose of modularity. It would be more -natural to have a separate bundle for each Geotools jar, but this requires some trickery to make the +natural to have a separate bundle for each GeoTools jar, but this requires some trickery to make the Factory SPI system work. -Hopefully, this will be supported out of the box in a future Geotools release. The next section +Hopefully, this will be supported out of the box in a future GeoTools release. The next section explains how to create a bundle per jar manually. One Bundle per Jar @@ -153,12 +153,12 @@ standard. Given a plain old JAR, you can wrap it in a bundle by creating an OSGi manifest, putting your JAR on the Bundle-Classpath and creating a bundle JAR containing your new manifest and the plain old JAR. -However, this is not recommended, since a JAR-in-a-JAR means extra work for the classloader +However, this is not recommended, since a JAR-in-a-JAR means extra work for the class loader to retrieve classes from the inner JAR. To make a plain old JAR OSGi-compliant, you can unzip -the JAR, add the required OSGi headers to the manifest and then rezip the whole lot. +the JAR, add the required OSGi headers to the manifest and then re-zip the whole lot. -After rebundling, any resources from the plain old JAR are now first-class citizens of the bundle -JAR. This includes any files in META-INF/services, and this is in fact the first step to make the +After re-bundling, any resources from the plain old JAR are now first-class citizens of the bundle +JAR. This includes any files in ``META-INF/services``, and this is in fact the first step to make the Factory SPI system work. .. note:: @@ -166,7 +166,7 @@ Factory SPI system work. Eclipse 3.4 has a new wizard for rebundling JARs. Search the Eclipse Help for Convert Jars to Plug-in Projects. -There are runtime dependencies between the Geotools JARs, e.g. gt-main.jar depends on gt-metadata.jar. These need to be translated to corresponding Import-Bundle header in the bundle manifest. For instance, if you turn these two JARs into bundles org.geotools.main and org.geotools.metadata, then the MANIFEST.MF of org.geotools.main will have to contain the following information:: +There are runtime dependencies between the GeoTools JARs, e.g. ``gt-main.jar`` depends on ``gt-metadata.jar``. These need to be translated to corresponding Import-Bundle header in the bundle manifest. For instance, if you turn these two JARs into bundles ``org.geotools.main`` and ``org.geotools.metadata``, then the ``MANIFEST.MF`` of ``org.geotools.main`` will have to contain the following information:: Bundle-SymbolicName: org.geotools.main Bundle-Version: 2.6.0 @@ -181,22 +181,22 @@ There are runtime dependencies between the Geotools JARs, e.g. gt-main.jar depen It is considered good practice for OSGi to use Import-Package rather than Require-Bundle to minimize coupling between bundles. Unfortunately, it is - currently difficult to make this work with Geotools, due to a considerable + currently difficult to make this work with GeoTools, due to a considerable number of split packages. A split package is a Java package occurring in - more than one bundle, like org.geotools.factory occurring both in - gt-main.jar and gt-metadata.jar. So for the time being, you should use - Require-Bundle to define the dependencies between Geotools bundles. + more than one bundle, like ``org.geotools.factory`` occurring both in + ``gt-main.jar`` and ``gt-metadata.jar.`` So for the time being, you should use + ``Require-Bundle`` to define the dependencies between GeoTools bundles. -The central method of the Factory SPI system is FactoryRegistry.scanForPlugins() in bundle org.geotools.metadata. You need to ensure that this bundle will have access to all META-INF/services resources from service provider bundles like org.geotools.main and others. +The central method of the Factory SPI system is ``FactoryRegistry.scanForPlugins()`` in bundle ``org.geotools.metadata``. You need to ensure that this bundle will have access to all ``META-INF/services`` resources from service provider bundles like ``org.geotools.main`` and others. -This is some kind of callback dependency of org.geotools.metadata on org.geotools.main (and any other service provider bundles). It is a major concern of OSGi to prevent cyclic dependencies, so you cannot have two bundles requiring each other. +This is some kind of callback dependency of ``org.geotools.metadata`` on ``org.geotools.main`` (and any other service provider bundles). It is a major concern of OSGi to prevent cyclic dependencies, so you cannot have two bundles requiring each other. There are two solutions (or rather, workarounds) for this situation: * buddy policies (a non-standard feature of Equinox, the Eclipse OSGi implementation) * fragments (OSGi-standard compliant, but less flexible) -Adding the following line to the manifest of org.geotools.metadata:: +Adding the following line to the manifest of ``org.geotools.metadata``:: Eclipse-BuddyPolicy: registered @@ -204,21 +204,21 @@ This effectively means "If I cannot find a class or resource locally or in my required bundles, I will ask my buddies, i.e. all bundles which depend on me and declare themselves to be a buddy of mine". -To turn org.geotools.main into a buddy of org.geotools.metadata, add the following header to the manifest of org.geotools.main:: +To turn ``org.geotools.main`` into a buddy of ``org.geotools.metadata,`` add the following header to the manifest of ``org.geotools.main``:: Eclipse-RegisterBuddy: org.geotools.metadata -If your OSGi framework is not Equinox, you may try to use fragments instead. (This has not yet been tested with Geotools, and it may not be supported by all OSGi implementations, even though this is a standard feature.) +If your OSGi framework is not Equinox, you may try to use fragments instead. (This has not yet been tested with GeoTools, and it may not be supported by all OSGi implementations, even though this is a standard feature.) A fragment looks like a bundle, but it depends on a bundle host. Fragments are a way of adding classes or resources to the host bundle. -Defining a fragment org.geotools.factory.extensions with the following manifest:: +Defining a fragment ``org.geotools.factory.extensions`` with the following manifest:: Bundle-SymbolicName: org.geotools.factory.extensions Fragment-Host: org.geotools.metadata Require-Bundle: org.geotools.main, ... -This should also solve the Factory SPI problem. The fragment requires the service provider bundles and contributes their resources to the factory bundle. This is another of way of modelling callback dependencies in OSGi. +This should also solve the Factory SPI problem. The fragment requires the service provider bundles and contributes their resources to the factory bundle. This is another of way of modeling callback dependencies in OSGi. .. note:: @@ -226,8 +226,8 @@ This should also solve the Factory SPI problem. The fragment requires the servic work in an OSGi environment in a way that is backward compatible, i.e. you can still use your bundle JARs as plain old JARs on the classpath. -If at some point in future Geotools should decide to go the OSGi way (and allow itself to become -dependent on OSGi), the Factory SPI approach should be dropped in favour of the OSGi service +If at some point in future GeoTools should decide to go the OSGi way (and allow itself to become +dependent on OSGi), the Factory SPI approach should be dropped in favor of the OSGi service registry. Service providers would register their services under the class name of the implemented interface. Clients would use the OSGi service registry to look up the available services for an interface, possibly using additional parameters to select a specific implementation. @@ -236,19 +236,19 @@ Third-Party Dependencies '''''''''''''''''''''''' In either approach, all-in-one or bundle-per-JAR, you also have to deal with external dependencies -of Geotools, like vecmath, jdom, geoapi, and many others. +of GeoTools, like ``vecmath``, ``jdom``, ``geoapi``, and many others. You could further blow up your all-in-one bundle by also including the JARs for these external -dependencies. Chances are high that some of these are also used by other non-Geotools bundles in -your application, so this is likely to cause classloader problems, say if you already have a JDOM +dependencies. Chances are high that some of these are also used by other non-GeoTools bundles in +your application, so this is likely to cause class loader problems, say if you already have a JDOM bundle in your system. -Thus, you should really follow the bundle-per-JAR approach and OSGify each third-party dependency -into a separate bundle. Actually, there is no need to do all the work on your own: The SpringSource -Enterprise Bundle Repository provides OSGified versions of many popular Java libraries. +Thus, you should really follow the bundle-per-JAR approach and OSGi each third-party dependency +into a separate bundle. Actually, there is no need to do all the work on your own: The Spring Source +Enterprise Bundle Repository provides converted versions of many popular Java libraries. -Eclipse-BuddyPolicy: ext -'''''''''''''''''''''''' +Eclipse-Buddy Policy: ext +'''''''''''''''''''''''''' The GeoTools library makes use of Java Advanced Imaging - which is a Java extension. Just as OSGi is very careful about dependencies between bundles; it is also careful to ensure you do not @@ -258,15 +258,15 @@ A normal application works like this: 1. Java Classes - like String 2. Java Extension Classes - like JAI -3. Classpath - system environmental variable, or -cp command line option - default: .;bin\..\classes;bin\..\lib\classes.zip +3. Classpath - system environmental variable, or ``-cp`` command line option + default: ``.;bin\..\classes;bin\..\lib\classes.zip`` OSGi takes over and forces you to choose what you are doing: -1. Java Classes - like Stirng -2. everything that is "published" by the bundles you depends on +1. Java Classes - like String +2. Everything that is "published" by the bundles you depends on -If you add the following to your plugin manifest.mf:: +If you add the following to your plugin ``manifest.mf``:: Eclipse-BuddyPolicy: ext @@ -274,6 +274,6 @@ OSGi will start you up with the following: 1. Java Classes - like String 2. Java Extension Classes - like JAI -3. everything that is "published" by the bundles you depends on +3. Everything that is "published" by the bundles you depends on Which will enable GeoTools code to work (yeah!). diff --git a/docs/user/welcome/architecture.rst b/docs/user/welcome/architecture.rst index 33dc2a00392..3c7585c06cb 100644 --- a/docs/user/welcome/architecture.rst +++ b/docs/user/welcome/architecture.rst @@ -18,28 +18,28 @@ and concepts defined in the previous one. Each layer of the "stack" is built on the ones below it: -* To use Referencing you need gt-opengis, gt-referencing and gt-metadata -* To use Data you need gt-main, gt-main, jts, gt-opengis, gt-referencing, gt-opengis, - gt-metadata +* To use Referencing you need ``gt-opengis``, ``gt-referencing`` and ``gt-metadata`` +* To use Data you need ``gt-main``, ``jts``, ``gt-opengis``, ``gt-referencing``, ``gt-opengis``, + ``gt-metadata`` The maven tool can calculate the jars you need, please see the Eclipse or Netbeans quickstart for an example use. -============== ============================================================== -Module Purpose -============== ============================================================== -gt-render Implements of Java2D rendering engine to draw a map -gt-jdbc Implements for accessing spatial database -gt-main Implements for accessing spatial data -gt-xml Implements of common spatial xml formats -gt-cql Implements of Common Query Language for filters -gt-main Interfaces for working with spatial information. Implements filter, feature, etc... -jts Definition and implementation of Geometry -gt-coverage Implementation for accessing raster information -gt-referencing Implementation of co-ordinate location and transformation -gt-metadata Implementation of identification and description -gt-opengis Definition of interfaces for common spatial concepts -============== ============================================================== +================== ============================================================== +Module Purpose +================== ============================================================== +``gt-render`` Implements of Java2D rendering engine to draw a map +``gt-jdbc`` Implements for accessing spatial database +``gt-main`` Implements for accessing spatial data +``gt-xml`` Implements of common spatial XML formats +``gt-cql`` Implements of Common Query Language for filters +``gt-main`` Interfaces for working with spatial information. Implements filter, feature, etc... +``jts`` Definition and implementation of Geometry +``gt-coverage`` Implementation for accessing raster information +``gt-referencing`` Implementation of co-ordinate location and transformation +``gt-metadata`` Implementation of identification and description +``gt-opengis`` Definition of interfaces for common spatial concepts +================== ============================================================== GeoTools Plugins @@ -48,61 +48,61 @@ GeoTools Plugins GeoTools offers plug-ins to support additional data formats, different coordinate reference system authorities and so on. -+---------------+------------------+--------------------------------------+ -| Module | JAR | Plugin | -+===============+==================+======================================+ -| gt-render | | | -+---------------+------------------+--------------------------------------+ -| gt-jdbc | gt-jdbc-db2 | Geometry in DB2 | -+---------------+------------------+--------------------------------------+ -| | gt-jdbc-h2 | Pure Java "H2" database | -+---------------+------------------+--------------------------------------+ -| | gt-jdbc-mysql | Geometry in MySQL | -+---------------+------------------+--------------------------------------+ -| | gt-jdbc-oracle | Oracle SDO Geometry | -+---------------+------------------+--------------------------------------+ -| | gt-jdbc-postgis | PostgreSQL extension PostGIS | -+---------------+------------------+--------------------------------------+ -| |gt-jdbc-spatialite| SQLite | -+---------------+------------------+--------------------------------------+ -| |gt-jdbc-sqlserver | SQL Server | -+---------------+------------------+--------------------------------------+ -| gt-main | gt-shape | Shapefile read/write support | -+---------------+------------------+--------------------------------------+ -| | gt-wfs | WFS read/write support | -+---------------+------------------+--------------------------------------+ -| | gt-arcsde | Communicate with ArcSDE | -+---------------+------------------+--------------------------------------+ -| gt-xml | | | -+---------------+------------------+--------------------------------------+ -| gt-cql | | | -+---------------+------------------+--------------------------------------+ -| gt-main | | | -+---------------+------------------+--------------------------------------+ -| jts | | | -+---------------+------------------+--------------------------------------+ -| gt-coverage | gt-geotiff | GeoTIFF raster format | -+---------------+------------------+--------------------------------------+ -| | gt-arcgrid | arcgrid format | -+---------------+------------------+--------------------------------------+ -| | gt-mif | MIF format | -+---------------+------------------+--------------------------------------+ -| | gt-image | JPG, PNG, TIFF, GID formats | -+---------------+------------------+--------------------------------------+ -| gt-referencing| epsg-access | Official EPSG database in Access | -+---------------+------------------+--------------------------------------+ -| | epsg-hsql | Pure Java port of EPSG database | -+---------------+------------------+--------------------------------------+ -| | epsg-wkt | Lightweight copy of EPSG codes | -+---------------+------------------+--------------------------------------+ -| | epsg-postgresql | PostgreSQL port of EPSG database | -+---------------+------------------+--------------------------------------+ -| | epsg-oracle | Oracle port of EPSG database | -+---------------+------------------+--------------------------------------+ -| gt-metadata | | | -+---------------+------------------+--------------------------------------+ -| gt-opengis | | | -+---------------+------------------+--------------------------------------+ ++---------------------+------------------------+--------------------------------------+ +| Module | JAR | Plugin | ++=====================+========================+======================================+ +| ``gt-render`` | | | ++---------------------+------------------------+--------------------------------------+ +| ``gt-jdbc`` | ``gt-jdbc-db2`` | Geometry in DB2 | ++---------------------+------------------------+--------------------------------------+ +| | ``gt-jdbc-h2`` | Pure Java "H2" database | ++---------------------+------------------------+--------------------------------------+ +| | ``gt-jdbc-mysql`` | Geometry in MySQL | ++---------------------+------------------------+--------------------------------------+ +| | ``gt-jdbc-oracle`` | Oracle SDO Geometry | ++---------------------+------------------------+--------------------------------------+ +| | ``gt-jdbc-postgis`` | PostgreSQL extension PostGIS | ++---------------------+------------------------+--------------------------------------+ +| | ``gt-jdbc-spatialite`` | SQLite | ++---------------------+------------------------+--------------------------------------+ +| | ``gt-jdbc-sqlserver`` | SQL Server | ++---------------------+------------------------+--------------------------------------+ +| ``gt-main`` | ``gt-shape`` | Shapefile read/write support | ++---------------------+------------------------+--------------------------------------+ +| | ``gt-wfs`` | WFS read/write support | ++---------------------+------------------------+--------------------------------------+ +| | ``gt-arcsde`` | Communicate with ArcSDE | ++---------------------+------------------------+--------------------------------------+ +| ``gt-xml`` | | | ++---------------------+------------------------+--------------------------------------+ +| ``gt-cql`` | | | ++---------------------+------------------------+--------------------------------------+ +| ``gt-main`` | | | ++---------------------+------------------------+--------------------------------------+ +| ``jts`` | | | ++---------------------+------------------------+--------------------------------------+ +| ``gt-coverage`` | ``gt-geotiff`` | GeoTIFF raster format | ++---------------------+------------------------+--------------------------------------+ +| | ``gt-arcgrid`` | arcgrid format | ++---------------------+------------------------+--------------------------------------+ +| | ``gt-mif`` | MIF format | ++---------------------+------------------------+--------------------------------------+ +| | ``gt-image`` | JPG, PNG, TIFF formats | ++---------------------+------------------------+--------------------------------------+ +| ``gt-referencing`` | ``epsg-access`` . | Official EPSG database in Access | ++---------------------+------------------------+--------------------------------------+ +| | ``epsg-hsql`` | Pure Java port of EPSG database | ++---------------------+------------------------+--------------------------------------+ +| | ``epsg-wkt`` | Lightweight copy of EPSG codes | ++---------------------+------------------------+--------------------------------------+ +| | ``epsg-postgresql`` | PostgreSQL port of EPSG database | ++---------------------+------------------------+--------------------------------------+ +| | ``epsg-oracle`` | Oracle port of EPSG database | ++---------------------+------------------------+--------------------------------------+ +| ``gt-metadata`` | | | ++---------------------+------------------------+--------------------------------------+ +| ``gt-opengis`` | | | ++---------------------+------------------------+--------------------------------------+ Usually at least one plug-in is needed for each layer for GeoTools to do something. As an example every time you use the referencing module please make sure you have an EPSG plugin @@ -117,15 +117,15 @@ We have gone a bit further and implemented some interesting "extensions" on top The extensions are independent of each other offering and may be of use in your application. Here is a brief listing of the extensions at the time of writing. -============== =============================================== -JAR Extension -============== =============================================== -gt-graph Work with graph and network traversals -gt-validation Quality assurance for spatial data -gt-wms Web Map Server client -gt-xsd Parsing/Encoding for common OGC schemas -gt-brewer Generation of styles using color brewer -============== =============================================== +================== =============================================== +JAR Extension +================== =============================================== +``gt-graph`` Work with graph and network traversals +``gt-validation`` Quality assurance for spatial data +``gt-wms`` Web Map Server client +``gt-xsd`` Parsing/Encoding for common OGC schemas +``gt-brewer`` Generation of styles using color brewer +================== =============================================== XML ^^^ @@ -133,38 +133,38 @@ XML To support the XML module in GeoTools we have bundled up several XML schemas in JAR form (to prevent needing to download them from the Internet each time they are needed). In addition these jars contain a generated Java data structure produced with the Eclipse Modeling Framework. -================= ============================================= -JAR Schema -================= ============================================= -net.opengis.ows open web services schema -net.opengis.wfs web feature service -net.opengis.wps web processing service schema -net.opengis.wcs web coverage service schema -net.opengis.wfsv web feature service schema -org.w3.xlink xlink schema -================= ============================================= - -These facilities are used by the xsd parser by way of a series of XSD plugins. These plugins indicating how to parse and encode +=================== ============================================= +JAR Schema +=================== ============================================= +``net.opengis.ows`` open web services schema +``net.opengis.wfs`` web feature service +``net.opengis.wps`` web processing service schema +``net.opengis.wcs`` web coverage service schema +``net.opengis.wfs`` web feature service schema +``org.w3.xlink`` XLink schema +=================== ============================================= + +These facilities are used by the XSD parser by way of a series of XSD plugins. These plugins indicating how to parse and encode additional content using Eclipse XSD library to parse XML schema documents and offer "bindings" showing how to parse and encode to Java classes such as String, Date, URL and Geometry. -================= ============================================= -JAR Bindings -================= ============================================= -gt-xsd-core Basic types defined by XML schema -gt-xsd-fes filter -gt-xsd-filter filter (used by OGC cat and wfs) -gt-xsd-kml keyhole markup language -gt-xsd-wfs web feature service -gt-xsd-wps web processing service -gt-xsd-gml3 geographic markup language 3 -gt-xsd-gml2 geographic markup language 2 -gt-xsd-ows open web services -gt-xsd-wcs web coverage service -gt-xsd-wms web map service -gt-xsd-sld style layer descriptor -================= ============================================= +=================== ============================================= +JAR Bindings +=================== ============================================= +``gt-xsd-core`` Basic types defined by XML schema +``gt-xsd-fes`` filter 2.0 +``gt-xsd-filter`` filter (used by OGC CAT and WFS) +``gt-xsd-kml`` keyhole markup language +``gt-xsd-wfs`` web feature service +``gt-xsd-wps`` web processing service +``gt-xsd-gml3`` geographic markup language 3 +``gt-xsd-gml2`` geographic markup language 2 +``gt-xsd-ows`` open web services +``gt-xsd-wcs`` web coverage service +``gt-xsd-wms`` web map service +``gt-xsd-sld`` style layer descriptor +=================== ============================================= GeoTools Unsupported -------------------- @@ -173,20 +173,20 @@ There are also a number of "unsupported" plugins and extensions. These modules a distributed by the project management committee as part of the GeoTools download, however they are available via maven or individual download. -+---------------+-----------------------------------------+ -| Unsupported | Purpose | -+===============+=========================================+ -| gt-swt | Standard widget toolkit interactive map | -+---------------+-----------------------------------------+ -| gt-swing | Swing interactive map | -+---------------+-----------------------------------------+ -| gt-oracle | retired oracle support | -+---------------+-----------------------------------------+ -| gt-postgis | retired postgis support | -+---------------+-----------------------------------------+ -| gt-db2 | retired db2 support | -+---------------+-----------------------------------------+ -| gt-wps | Web Processing Service client | -+---------------+-----------------------------------------+ -| gt-process | Job system for spatial data | -+---------------+-----------------------------------------+ ++-------------------+-----------------------------------------+ +| Unsupported | Purpose | ++===================+=========================================+ +| ``gt-swt`` | Standard widget toolkit interactive map | ++-------------------+-----------------------------------------+ +| ``gt-swing`` | Swing interactive map | ++-------------------+-----------------------------------------+ +| ``gt-oracle`` | retired oracle support | ++-------------------+-----------------------------------------+ +| ``gt-postgis`` | retired PostGIS support | ++-------------------+-----------------------------------------+ +| ``gt-db2`` | retired db2 support | ++-------------------+-----------------------------------------+ +| ``gt-wps`` | Web Processing Service client | ++-------------------+-----------------------------------------+ +| ``gt-process`` | Job system for spatial data | ++-------------------+-----------------------------------------+ diff --git a/docs/user/welcome/eclipse.rst b/docs/user/welcome/eclipse.rst index 546166a8412..76832366b73 100644 --- a/docs/user/welcome/eclipse.rst +++ b/docs/user/welcome/eclipse.rst @@ -12,7 +12,7 @@ The first time you go to look at any of the GeoTools classes you will need to te 1. From the "Source not found" editor press the Attach Source... Button. 2. Press the Workspace button -3. Select the gt2-2.4-RC0-src.zip +3. Select the ``gt2-2.4-RC0-src.zip`` 4. And press OK .. image:: /images/eclipseTip1.png @@ -23,5 +23,5 @@ The first time you go to look at any of the GeoTools classes you will need to te -6. You can quickly cut and paste sourcepath="gt2-2.4-RC0-src.zip" for the rest of the - gt2 jars. +6. You can quickly cut and paste ``sourcepath="gt2-2.4-RC0-src.zip"`` for the rest of the + GeoTools jars. diff --git a/docs/user/welcome/faq.rst b/docs/user/welcome/faq.rst index 2065aaeaf94..7384d301b0d 100644 --- a/docs/user/welcome/faq.rst +++ b/docs/user/welcome/faq.rst @@ -53,41 +53,43 @@ Q: Okay what data formats does GeoTools support? GeoTools supports additional formats through the use of plug-ins. You can control the formats supported by your application by only including the plug-ins you require. -* arcgrid -* arcsde -* db2 +* ``arcgrid`` +* ``arcsde`` +* ``db2`` * raster formats - * geotiff - * grassraster - * gtopo30 - * image - world plus image files using common image formats such as JPEG, TIFF, GIF and PNG - * imageio-ext-gdal (allows access to additional GDAL formats thanks to the ImageIO project) - * imagemoasaic - * imagepyramid - * JP2K + * ``geotiff`` + * ``grassraster`` + * ``gtopo30`` + * ``image`` - world plus image files using common image formats such as JPEG, TIFF, GIF and PNG + * ``imageio-ext-gdal`` (allows access to additional GDAL formats thanks to the ImageIO project) + * ``imagemoasaic`` + * ``imagepyramid`` + * ``JP2K`` -* Database "jdbc-ng" support +* Database ``gt-jdbc-ng`` `` support - * h2 - * mysql - * oracle - * postgis - * spatialite - * sqlserver + * ``h2`` + * ``mysql`` + * ``oracle`` + * ``postgis`` + * ``spatialite`` + * ``sqlserver`` -* postgis -* property - simple text file format often used for testing -* shapefile +* ``postgis`` +* ``property`` - simple text file format often used for testing +* ``shapefile`` Perhaps one of the unsupported modules or plugins may have what you need. These modules are supplied by the community and do not yet meet the quality expected by the library: There are also some "unsupported" formats that are either popular or under development: -* dfx -* geojson -* wfs + +* ``dfx`` +* ``geojson`` +* ``wfs`` + The current authoritative list of plugins is of course the source code: @@ -138,7 +140,7 @@ one associated with the most recent formal release (e.g GeoTools 14-SNAPSHOT) an being maintained (e.g. GeoTools 13-SNAPSHOT). New snapshot jars are built nightly and deployed to a repository separate from the one used for formal releases. If you -are using Maven as your build tool you can work with a snapshot release by adding the following to your pom.xml:: +are using Maven as your build tool you can work with a snapshot release by adding the following to your ``pom.xml`` :: boundless @@ -159,7 +161,7 @@ You can now build your project against a snapshot release by setting it as the y Common License Questions ^^^^^^^^^^^^^^^^^^^^^^^^ -Q: What licence does GeoTools use? +Q: What license does GeoTools use? '''''''''''''''''''''''''''''''''' All GeoTools modules are released under the GNU Lesser General Public License (LGPL). GeoTools can be used for @@ -225,7 +227,7 @@ Q: What restrictions are there on my re-distribution of GeoTools? Technically, you have to provide everyone who receives a copy of GeoTools from you with some way to get the source code to the library. In practice, pointing -those users to the Geotools project itself is considered an adequate solution. +those users to the GeoTools project itself is considered an adequate solution. However, if you are re-distributing a modified version of GeoTools then you need to provide users with access to the modified code. This means that you diff --git a/docs/user/welcome/geomajas.rst b/docs/user/welcome/geomajas.rst index a363c4f6ce7..8961fd0aa36 100644 --- a/docs/user/welcome/geomajas.rst +++ b/docs/user/welcome/geomajas.rst @@ -8,10 +8,10 @@ Welcome Geomajas Developers .. image:: /images/logo/geomajas_logo.gif Geomajas is an enterprise-ready open source GIS framework for the web. Built using GeoTools - Spring, and Google Web Toolkit for a fast efficeint all-Java solution! + Spring, and Google Web Toolkit for a fast efficient all-Java solution! Geomajas is a Java based client-server GIS framework for the web, that leverages the GeoTools -library on the backend. Although Geomajas has it's own Object model, many functionalities rely +library on the back end. Although Geomajas has it's own Object model, many functionalities rely quite heavily on the GeoTools library. Geomajas is very Spring oriented which results in a lot of Spring services that use GeoTools under @@ -45,12 +45,12 @@ entity relationships by exploiting the POJO capabilities of Hibernate. FilterService ------------- -For filtering, Geomajas uses the gt-opengis Filter object model and the GeoTools ECQL standard. In +For filtering, Geomajas uses the ``gt-opengis`` Filter object model and the GeoTools ECQL standard. In order to create Filter objects for a specific Geomajas layer, there is the **FilterService** interface. By default a Spring bean for that service will always be available on the classpath, -so it can always be autowired. +so it can always be auto wired. -The **FilterService** provides convenience methods for quickly creating OpenGis Filter objects +The **FilterService** provides convenience methods for quickly creating OpenGIS Filter objects which can then be used in Geomajas (or GeoTools) layers. Example use:: diff --git a/docs/user/welcome/index.rst b/docs/user/welcome/index.rst index 6fc7553d538..39543795890 100644 --- a/docs/user/welcome/index.rst +++ b/docs/user/welcome/index.rst @@ -2,7 +2,7 @@ Welcome ******* -Welcome to the Geotools Users Guide. This space serves as a reference to the GeoTools library, and collecting documentation and examples provided by the developer community. +Welcome to the GeoTools Users Guide. This space serves as a reference to the GeoTools library, and collecting documentation and examples provided by the developer community. .. toctree:: :maxdepth: 1 diff --git a/docs/user/welcome/javaEE.rst b/docs/user/welcome/javaEE.rst index 47cba1ba81e..d94a81771a9 100644 --- a/docs/user/welcome/javaEE.rst +++ b/docs/user/welcome/javaEE.rst @@ -8,9 +8,9 @@ JNDI Configuration To start out with you will need to tell GeoTools about the JNDI Initial Context provided by your application server.:: - GeoTools.init( initialConext ); + GeoTools.init(initialConext); -When GeoTools does a JNDI lookup it will now use your application servers context. If you do nothing GeoTools would use the default JRE InitialContext; which your application server may have correctly set up. +When GeoTools does a JNDI lookup it will now use your application servers context. If you do nothing GeoTools would use the default JRE ``InitialContext``; which your application server may have correctly set up. Please test in your environment - you may find that this step is not required. @@ -21,27 +21,28 @@ One of the most seriously managed resources in a Java EE application is the data For the parts of GeoTools that use databases they have provided two mechanisms for you to accomplish this goal: -* You can look up the DataSource yourself, and provide the raw javax.sql.DataSource as: +* You can look up the DataSource yourself, and provide the raw + ``javax.sql.DataSource`` as: - * As a configuration Hint when creating an EpsgAuthority - * As a connection parameter when creating a DataStore + * As a configuration Hint when creating an ``EpsgAuthority`` + * As a connection parameter when creating a ``DataStore`` -* You can provide the name and let GeoTools look up the DataSource using your GeoTools.getInitialConext() +* You can provide the name and let GeoTools look up the DataSource using your ``GeoTools.getInitialConext()`` - * As a configuration Hint when creating an EpsgAuthority - * As a connection parameter when creating a DataStore + * As a configuration Hint when creating an ``EpsgAuthority`` + * As a connection parameter when creating a ``DataStore`` Spring Framework Configuration ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Spring typically provides all services through Dependency Injection (DI). Geotools uses the FactoryFinder strategy to look up factories. Both can be combined by injecting Geotools factories as Spring bean factories or simply looking up Geotools factories in the bean constructor. +Spring typically provides all services through Dependency Injection (DI). GeoTools uses the Factory Finder strategy to look up factories. Both can be combined by injecting GeoTools factories as Spring bean factories or simply looking up GeoTools factories in the bean constructor. -Geotools transaction management can be performed programmatically in the application code, but Spring provides its own transaction support as well. +GeoTools transaction management can be performed programmatically in the application code, but Spring provides its own transaction support as well. With the declarative model, developers typically write little or no code related to transaction management, and even do not depend on the Spring Framework transaction API, or any other transaction API. -For using the declarative model with Geotools, it is necessary that Geotools simply uses the transaction/connection state provided by the Spring transaction manager and does not try to intervene with it. -This is a possibly problem for JDBC datastores, but fortunately Geotools provides an API to pass external connections to it's internal transaction state (using the buildTransaction() method), which is ideally suited for this case. +For using the declarative model with GeoTools, it is necessary that GeoTools simply uses the transaction/connection state provided by the Spring transaction manager and does not try to intervene with it. +This is a possibly problem for JDBC DataStores, but fortunately GeoTools provides an API to pass external connections to it's internal transaction state (using the ``buildTransaction()`` method), which is ideally suited for this case. -To use Geotools in conjunction with Spring transaction management, datastore operations in transactional methods must call the setTransaction() method with a request-scoped transaction object. +To use GeoTools in conjunction with Spring transaction management, datastore operations in transactional methods must call the ``setTransaction()`` method with a request-scoped transaction object. This transaction should be created when an actual Spring transaction is started and contain the current connection of the active transaction. -Possible approaches are creating a custom TransactionManager or implementing a TransactionSynchronization object that works irrespective of the actual transaction manager. +Possible approaches are creating a custom ``TransactionManager`` or implementing a ``TransactionSynchronization`` object that works irrespective of the actual transaction manager. Example code for the latter can be found `here `_. -Application code should call the synchTransaction() method. +Application code should call the ``synchTransaction()`` method. diff --git a/docs/user/welcome/jump.rst b/docs/user/welcome/jump.rst index 674c8015275..1b6f5d9b482 100644 --- a/docs/user/welcome/jump.rst +++ b/docs/user/welcome/jump.rst @@ -3,10 +3,10 @@ Welcome OpenJump Developers This page gathers up some notes for those of us with a background in JUMP or OpenJUMP. The GeoTools project is built up around the same JTS topology library used by JUMP, many of the features and formats in JUMP (and now JTS) started out life as part of GeoTools library. -What is the equivalent of a Feature and FeatureSchema? -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +What is the equivalent of a ``Feature`` and ``FeatureSchema``? +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The GeoTools SimpleFeature and SimpleFeatureType classes play this role in the GeoTools library. +The GeoTools ``SimpleFeature`` and ``SimpleFeatureType`` classes play this role in the GeoTools library. Here is a quick example:: @@ -22,22 +22,22 @@ If you have a collection of features you can get the schema:: FeatureType schema = featureCollection.getSchema(); -The GeoTools SimpleFeatureType model is very similar to that employed by JUMP (and suffer from the same limitations). You can make use of the more general purpose FeatureType and Feature classes to make use of facilities like associations and operations. +The GeoTools ``SimpleFeatureType`` model is very similar to that employed by JUMP (and suffer from the same limitations). You can make use of the more general purpose ``FeatureType`` and ``Feature`` classes to make use of facilities like associations and operations. What license does GeoTools use? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ LGPL. So you can take the code and run away with it. We do ask that you funnel fixes back in our direction. -Because of the GPL restriction on the JUMP code base we cannot offer you wrappers (or really very much help at all). If you would kindly consider a GPL+Classpath license (the same one that Java uses) we would be able to implement the JUMP Feature and FeatureSchema interfaces and we could get along without all this fuss. +Because of the GPL restriction on the JUMP code base we cannot offer you wrappers (or really very much help at all). If you would kindly consider a GPL+Classpath license (the same one that Java uses) we would be able to implement the JUMP ``Feature`` and ``FeatureSchema`` interfaces and we could get along without all this fuss. Can I just use the referencing stuff for reprojection ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Yes. The Referencing module is available "standalone" (without all of the rest of the GeoTools feature model and rendering system). But be warned the referencing module is standards happy, and you will drag in a number of dependencies. -For more information please see the Referencing section of this user guide. Remember if you want to support EPSG codes you will need a plugin like epsg-hsql. +For more information please see the Referencing section of this user guide. Remember if you want to support EPSG codes you will need a plugin like ``epsg-hsql``. -It is recommended that you store the CoordinateReferenceSystem in your Geometry user data. +It is recommended that you store the ``CoordinateReferenceSystem`` in your ``Geometry`` user data. -Be warned that the referencing module does not depend on JTS (it is pure math), there is a utility class (called JTS) which works as an example of how to transform JTS Geometry class. \ No newline at end of file +Be warned that the referencing module does not depend on JTS (it is pure math), there is a utility class (called JTS) which works as an example of how to transform JTS Geometry class. diff --git a/docs/user/welcome/license.rst b/docs/user/welcome/license.rst index 3c8bf1d5ae9..7555d377190 100644 --- a/docs/user/welcome/license.rst +++ b/docs/user/welcome/license.rst @@ -39,7 +39,7 @@ In addition several modules contain code made available to us under a different * :doc:`gt-main ` (BSD License) * :doc:`gt-xsd-core ` (Apache License) * :doc:`gt-brewer ` (Apache License) -* :doc:`gt-referencing3d ` (some code available from nasa for unlimited distribution) +* :doc:`gt-referencing3d ` (some code available from NASA for unlimited distribution) Document License ^^^^^^^^^^^^^^^^^ diff --git a/docs/user/welcome/netbeans.rst b/docs/user/welcome/netbeans.rst index 47cc8b1c9f5..ac69a069579 100644 --- a/docs/user/welcome/netbeans.rst +++ b/docs/user/welcome/netbeans.rst @@ -5,12 +5,12 @@ NetBeans is an Integrated Development Environment (IDE), a software package whic The GeoTools project offers a great "Netbeans Quickstart" describing how to set things up. NetBeans provides strong maven integration making it an ideal environment to work with GeoTools smoothly and easily. -Finding Geotools artifact containing a Class +Finding GeoTools artifact containing a Class ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -When working on a Geotools / Maven project within Netbeans you can take advantage of the repository search facility to find the Geotools artifact that you need to add to your project for a given class. +When working on a GeoTools / Maven project within Netbeans you can take advantage of the repository search facility to find the GeoTools artifact that you need to add to your project for a given class. -1. For instance, say you want to use the ShapefileDataStore class but don't know the +1. For instance, say you want to use the ``ShapefileDataStore`` class but don't know the name of the artifact that contains it. In your code, enter the class name followed by a variable name. Netbeans will display the following. @@ -24,14 +24,14 @@ When working on a Geotools / Maven project within Netbeans you can take advantag 3. In this example it shows the artifact is gt-shapefile and that there are a number of versions available in the local repository. 4. Select the required version, click the Add button and it will be added as a dependency to your project. -Unfortunately, because the Geotools repository doesn't use the indexing system required by Netbeans/Maven, the search dialog will show matching artifacts that are available to download. +Unfortunately, because the GeoTools repository doesn't use the indexing system required by Netbeans/Maven, the search dialog will show matching artifacts that are available to download. Artifact added to POM but imports still not found ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1. When you want to use Geotools class X.from artifact Y (say ShapeFileDataStore from gt-shape). +1. When you want to use GeoTools class X.from artifact Y (say ``ShapeFileDataStore`` from ``gt-shape``). -2. Add the artifact as a dependency in your pom.xml file, either: +2. Add the artifact as a dependency in your ``pom.xml`` file, either: * Directly; or * Right-clicking on Libraries and selecting Add Library @@ -60,13 +60,13 @@ Artifact added to POM but imports still not found Specifying and monitoring memory usage ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Netbeans is itself a Java application. It automatically sets the amount of memory (heap) that will be available to the Java runtime when it is starting, but you may find that this default size is not large enough. If you get out of memory errors, or if Netbeans seems very sluggish, you can explicitly set the maximum heap size in the file etc/netbeans.conf by adding -J-XmxNb (where N is an integer number of Mb) to the 'netbeans_default_options' variable near the top of the file. For example, here we are requesting a maximum heap size of 640Mb:: +Netbeans is itself a Java application. It automatically sets the amount of memory (heap) that will be available to the Java runtime when it is starting, but you may find that this default size is not large enough. If you get out of memory errors, or if Netbeans seems very sluggish, you can explicitly set the maximum heap size in the file :file:`etc/netbeans.conf` by adding ``-J-XmxNb`` (where ``N`` is an integer number of Mb) to the ``netbeans_default_options`` variable near the top of the file. For example, here we are requesting a maximum heap size of 640Mb:: netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-Xmx640m -J-Xverify:none " You can monitor memory use within the IDE: -1. Select View menu -> Toolbars menu -> Memory +1. Select :menuselection:`View menu -> Toolbars menu -> Memory` 2. The current and peak memory usage are shown in the toolbar. .. image:: /images/netbeansTip3.png diff --git a/docs/user/welcome/support.rst b/docs/user/welcome/support.rst index f116d3a97ba..20c0a0c8dca 100644 --- a/docs/user/welcome/support.rst +++ b/docs/user/welcome/support.rst @@ -4,9 +4,9 @@ Communication and Support Email ----- -The geotools-users email list is a great place to start out; ask questions and share tips and tricks on using the library. +The GeoTools Users email list is a great place to start out; ask questions and share tips and tricks on using the library. -The users list is for questions regarding the installation or use of the GeoTools2 library. Users of GeoTools are usually Java developers building applications with spatial capabilities. +The users list is for questions regarding the installation or use of the GeoTools library. Users of GeoTools are usually Java developers building applications with spatial capabilities. * https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users * http://sourceforge.net/mailarchive/forum.php?forum_name=geotools-gt2-users @@ -21,13 +21,13 @@ find active developers, helpful users, and all manner of activity. If you are new to IRC, you will need to find an IRC client (Pidgin, mIRC, or even Colloquy on mac). -* irc://irc.freenode.net/geotools +* ``irc://irc.freenode.net/geotools`` The information you need to configure your IRC client are: -* Server - Pick one from Freenode Servers -* Channel - #geotools -* Port - 6667 +* Server - Pick one from FreeNode Servers +* Channel - ``#geotools`` +* Port - ``6667`` Question and Answer Forums -------------------------- @@ -51,7 +51,7 @@ Commercial Support ------------------ If you seriously have a deadline, or find you are spending too much time reading this documentation -please consider setting up a support contract with any of the following organisations. +please consider setting up a support contract with any of the following organizations. * `Camptocamp `_ * `GeoSolutions `_ @@ -62,7 +62,7 @@ please consider setting up a support contract with any of the following organisa Please consider this as an option, especially if you do not have a background in Geospatial Science or stuck between a bug and a deadline. Remember that the documentation is constructed by volunteers, -or people like you hiring an organisation to for specific work. +or people like you hiring an organization to for specific work. Issue Tracker ------------- @@ -72,7 +72,7 @@ and improvements. To create an issue: -1. [Log In](https://osgeo-org.atlassian.net/login) to . +1. [Log In](https://osgeo-org.atlassian.net/login) to ````. * If this is your first time you can [create an account](https://osgeo-org.atlassian.net/admin/users/sign-up) using the link at the bottom of the Sign In screen. @@ -98,14 +98,15 @@ To create an issue: * Besides a description of the problem, some additional information can make the difference between your issue being looked at or it being put off for a rainy day - * The version of Geotools you are using? (a release or nightly build?) + * The version of GeoTools you are using? (a release or nightly build?) * Example code that reproduces the problem? * A stack trace indicating where the failure occurred? * The Java Version and operating system you are using? 6. What Happens Next? - On creation a notification will automatically be sent to the geotools-devel list. + On creation a notification will automatically be sent to the GeoTools + Developers list. JIRA sends notifications for everything done on the issue, to the reporter, the assignee, and to anyone who clicks on the link to 'watch' an issue. @@ -132,7 +133,7 @@ To create an issue: 8. For New Bugs we may need assistance to reproduce the issue before a fix can be considered. - Usually the a Developer (or the Module Maintainer) will need to ask you for more information. + Usually the Developer (or the Module Maintainer) will need to ask you for more information. Until they can reproduce your issue, or you volunteer to test, not much is going to happen. Example: If you are on some exotic hardware (like oracle on windows server) that we do not @@ -145,7 +146,7 @@ To create an issue: your fix in the next release. * For fixes: please include a JUnit test case showing that your fix does something. If a developer needs - to spend 30 mins reproducing your problem in order to show your fix addresses the issue it will + to spend 30 minutes reproducing your problem in order to show your fix addresses the issue it will be put off for another day. * For improvements: You may be asked to attend a IRC chat to thrash out ideas on how best to include @@ -153,7 +154,7 @@ To create an issue: 10. Why Volunteering to Test Makes a Difference - Remember that even volunteering to test makes a HUGE difference for developers .. it literally + Remember that even volunteering to test makes a HUGE difference for developers ... it literally cuts down the work by two thirds! If you are available to test: diff --git a/docs/user/welcome/udig.rst b/docs/user/welcome/udig.rst index 40a3a98e2db..b2cbdd49a43 100644 --- a/docs/user/welcome/udig.rst +++ b/docs/user/welcome/udig.rst @@ -29,9 +29,9 @@ References: How do I add stuff ------------------ -The FeatureStore interface is used to add content. +The ``FeatureStore`` interface is used to add content. -You can get a FeatureStore in uDig by writing an operation. The operation will show up on the right click menu of anything that can be turned into a FeatureStore (such as a read/write Layer in the map, or File in the catalog):: +You can get a ``FeatureStore`` in uDig by writing an operation. The operation will show up on the right click menu of anything that can be turned into a ``FeatureStore`` (such as a read/write Layer in the map, or File in the catalog):: public class AddStuff implements IOp { static GeometryFactory geomFactory = new GeometryFactory(); @@ -54,14 +54,14 @@ You can get a FeatureStore in uDig by writing an operation. The operation will s } } -You can also get a FeatureStore directly from from an ILayer:: +You can also get a ``FeatureStore`` directly from from an ``ILayer``:: if( layer.hasResource( FeatureStore.class ) ){ FeatureStore store = layer.getResource( FeatureStore.class, monitor ); ... } -Or directly from a GeoResource:: +Or directly from a ``GeoResource``:: if( geoResource.canResolve( FeatureStore.class ) ){ FeatureStore store = handle.resolve( FeatureStore.class, monitor ); @@ -72,4 +72,4 @@ Notes: * features you add this way will not actually hit the disk until the user presses the commit button. * do not assume anything about the layer - even if it is a WMS layer uDig may be able to hunt you - down a FeatureStore by looking for a matching WFS service + down a ``FeatureStore`` by looking for a matching WFS service diff --git a/docs/user/welcome/upgrade.rst b/docs/user/welcome/upgrade.rst index 4111068ea5c..832fa69a5c2 100644 --- a/docs/user/welcome/upgrade.rst +++ b/docs/user/welcome/upgrade.rst @@ -45,33 +45,33 @@ The following table shows how maven dependencies have changed, and the resulting * - Dependency - Upgrade - Automatic Module Name - * - gt-opengis - - gt-opengis - - org.geotools.opengis - * - gt-metadata - - gt-metadata - - org.geotools.metadata - * - gt-api + * - ``gt-opengis`` + - ``gt-opengis`` + - ``org.geotools.opengis`` + * - ``gt-metadata`` + - ``gt-metadata`` + - ``org.geotools.metadata`` + * - ``gt-api`` - (removed) - - * - gt-referencing - - gt-referencing - - org.geotools.referencing - * - gt-main - - gt-main - - org.geotools.main - * - gt-xml - - gt-xml - - org.geotools.xml - * - gt-xml - - gt-xml - - org.geotools.xml - * - gt-main - - gt-main - - org.geotools.data - * - gt-jdbc - - gt-jdbc - - org.geotools.jdbc + * - ``gt-referencing`` + - ``gt-referencing`` + - ``org.geotools.referencing`` + * - ``gt-main`` + - ``gt-main`` + - ``org.geotools.main`` + * - ``gt-xml`` + - ``gt-xml`` + - ``org.geotools.xml`` + * - ``gt-xml`` + - ``gt-xml`` + - ``org.geotools.xml`` + * - ``gt-main`` + - ``gt-main`` + - ``org.geotools.data`` + * - ``gt-jdbc`` + - ``gt-jdbc`` + - ``org.geotools.jdbc`` Repackage Library ^^^^^^^^^^^^^^^^^ @@ -88,42 +88,42 @@ Previously GeoTools reused packages across modules by design, this approach is n - Package * - - Classes Affected - * - **gt-api** - - **org.geotools.decorate** - * - gt-metadata - - org.geotools.util.decorate + * - ``gt-api`` + - ``org.geotools.decorate`` + * - ``gt-metadata`` + - ``org.geotools.util.decorate`` * - - Abstract Store, Wrapper - * - **gt-api** - - **org.geotools.data** - * - gt-main - - org.geotools.data - * - **gt-api** - - **org.geotools.data.simple** - * - gt-main - - org.geotools.data.simple - * - **gt-api** - - **org.geotools.decorate** - * - gt-main - - org.geotools.util.decorate + * - ``gt-api`` + - ``org.geotools.data`` + * - ``gt-main`` + - ``org.geotools.data`` + * - ``gt-api`` + - ``org.geotools.data.simple`` + * - ``gt-main`` + - ``org.geotools.data.simple`` + * - ``gt-api`` + - ``org.geotools.decorate`` + * - ``gt-main`` + - ``org.geotools.util.decorate`` * - - AbstractDecorator, Wrapper - * - **gt-api** - - **org.geotools.factory** - * - gt-main - - org.geotools.factory - * - **gt-api** - - **org.geotools.feature** - * - gt-main - - org.geotools.feature - * - **gt-api** - - **org.geotools.filter** - * - gt-main - - org.geotools.filter - * - **gt-api** - - **org.geotools.filter.expression** - * - gt-main - - org.geotools.filter.expression + * - ``gt-api`` + - ``org.geotools.factory`` + * - ``gt-main`` + - ``org.geotools.factory`` + * - ``gt-api`` + - ``org.geotools.feature`` + * - ``gt-main`` + - ``org.geotools.feature`` + * - ``gt-api`` + - ``org.geotools.filter`` + * - ``gt-main`` + - ``org.geotools.filter`` + * - ``gt-api`` + - ``org.geotools.filter.expression`` + * - ``gt-main`` + - ``org.geotools.filter.expression`` GeoTools 20.x ------------- @@ -145,7 +145,7 @@ The transitive dependency will correctly bring in the required jars:: This release changes the package names from ``com.vividsolutions.jts`` to ``org.locationtech.jts``. To update your own code follow the `JTS Upgrade Guide `__ instructions. -Using the command line to update your own pom.xml files:: +Using the command line to update your own ``pom.xml`` files:: git grep -l com.vividsolutions | grep pom.xml | xargs sed -i "s/com.vividsolutions/org.locationtech.jts/g" @@ -155,7 +155,7 @@ And codebase:: **Use of copy rather than clone** -If you are in the habit of using **clone** to duplicate JTS objects (such as Geometry and Coordinate) you will find the **clone** method has been deprecated, and a **copy** method introduced to explicitly perform a deep copy:: +If you are in the habit of using ``clone`` to duplicate JTS objects (such as Geometry and Coordinate) you will find the ``clone`` method has been deprecated, and a ``copy`` method introduced to explicitly perform a deep copy:: Geometry duplicate = geom.copy(); @@ -177,7 +177,7 @@ Package names have changed, resulting in some common search and replaces when up * Search ``javax.measure.unit.Unit`` replace ``javax.measure.Unit`` * Search ``ConversionException`` replace ``IncommensurableException`` - This is a checked exception, in areas of the GeoTools library where this was found we now return an IllegalArgument exception. + This is a checked exception, in areas of the GeoTools library where this was found we now return an ``IllegalArgument`` exception. * Search ``converter == UnitConverter.IDENTITY`` replace ``converter.isIdentity()`` * Search ``javax.measure.unit.NonSI`` replace ``import si.uom.NonSI`` @@ -193,7 +193,7 @@ Package names have changed, resulting in some common search and replaces when up If you know the unit to use at compile time, use one of the Unit instances defined as static variables in ``org.geotools.measure.Units``, ``si.uom.SI``, ``si.uom.NonSI`` or ``systems.uom.common.USCustomary``. -If you need to define new Units at runtime, it is important to immediately try to convert the new unit to one of the existing instances using Units.autocorrect method. Autocorrect applies some tolerance to locate an equivalent Unit. Skipping autocorrect will produce unexpected results and errors due to small differences in units definition. +If you need to define new Units at runtime, it is important to immediately try to convert the new unit to one of the existing instances using ``Units.autocorrect`` method. Autocorrect applies some tolerance to locate an equivalent Unit. Skipping autocorrect will produce unexpected results and errors due to small differences in units definition. .. code-block:: java @@ -249,7 +249,7 @@ Use ``org.geotools.measure.Units.getDefaultFormat().format()`` to get the unit l **Converting units** -If the unit Quantity type is known, use the type-safe getConverterTo() method: +If the unit ``Quantity`` type is known, use the type-safe ``getConverterTo()`` method: .. code-block:: java @@ -257,7 +257,7 @@ If the unit Quantity type is known, use the type-safe getConverterTo() method: UnitConverter converter = unit.getConverterTo(SI.RADIAN); double convertedQuantity = converter.convert(3.1415); -If the Quantity type is undefined, use the convenience method ``org.geotools.measure.Units.getConverterToAny()``. Note that this method throws an IllegalArgumentException if units can't be converted: +If the ``Quantity`` type is undefined, use the convenience method ``org.geotools.measure.Units.getConverterToAny()``. Note that this method throws an ``IllegalArgumentException`` if units can't be converted: .. code-block:: java @@ -322,20 +322,20 @@ GeoTools 15.x requires Java 8:: GeoTools 14.x ------------- -From 14.x version, the `JAI-EXT Project `_ has been integrated in GeoTools. This project provides a high scalable Java API for image processing with support for NoData and ROI. +From 14.x version, the `JAI-EXT Project `_ has been integrated in GeoTools. This project provides a high scalable Java API for image processing with support for ``NoData`` and ``ROI``. This integration provides also the removal of the following classes, since they are now inside JAI-EXT: -* **ColorIndexer** from *gt-coverage* module; -* **GTCrop** from *gt-coverage* module; -* **GenericPiecewise** from *gt-render* module; -* **RasterClassifier** from *gt-render* module; -* **ArtifactsFilter** from *gt-imagemosaic* module. +* ``ColorIndexer`` from *gt-coverage* module; +* ``GTCrop`` from *gt-coverage* module; +* ``GenericPiecewise`` from *gt-render* module; +* ``RasterClassifier`` from *gt-render* module; +* ``ArtifactsFilter`` from *gt-imagemosaic* module. -Users may now decide to choose between JAI and JAI-EXT operations by simply using the **JAIExt** class containing utility methods for handling JAI/JAI-EXT registration. +Users may now decide to choose between JAI and JAI-EXT operations by simply using the ``JAIExt`` class containing utility methods for handling JAI/JAI-EXT registration. A more detailed tutorial on how to use JAI-EXT may be found at the following :ref:`JAI-EXT Tutorial Page`. -TextSymbolizer provides direct access to the device independent Font list, removing deprecated array access methods. This change restores SLD 1.0 multi-lingual behaviour allowing several face/size combinations to be used during labeling. +``TextSymbolizer`` provides direct access to the device independent Font list, removing deprecated array access methods. This change restores SLD 1.0 multi-lingual behavior allowing several face/size combinations to be used during labeling. BEFORE:: @@ -353,7 +353,7 @@ AFTER:: ... } -Transaction is now Closable for use with try-with-resource syntax:: +``Transaction`` is now ``Closable`` for use with try-with-resource syntax:: try (Transaction t = new DefaultTransaction()){ store.setTransaction( t ); @@ -361,15 +361,15 @@ Transaction is now Closable for use with try-with-resource syntax:: t.commit(); } -ShapefileDataStore representing shapefiles without any data, now return empty bounds on getBounds() instead of the bounds inside the shapefile header (mostly [0:0,0:0]). So bounds.isEmpty() and bounds.isNull() will return true for empty shapefiles. +``ShapefileDataStore`` representing shapefiles without any data, now return empty bounds on ``getBounds()`` instead of the bounds inside the shapefile header (mostly [0:0,0:0]). So ``bounds.isEmpty()`` and ``bounds.isNull()`` will return true for empty shapefiles. GeoTools 13.0 ------------- -As of GeoTools 13.0, the CoverageViewType classes have been removed. The AbstractDataStore class is also now deprecated. Extensive work has been done to bring in ContentDataStore as its replacement. +As of GeoTools 13.0, the ``CoverageViewType`` classes have been removed. The ``AbstractDataStore`` class is also now deprecated. Extensive work has been done to bring in ``ContentDataStore`` as its replacement. -There is a `ContentDataStore Tutorial `_ to help with migration from AbstractDataStore. +There is a `ContentDataStore Tutorial `_ to help with migration from ``AbstractDataStore``. -Many readers and iterators are now Closable for use with try-with-resource syntax:: +Many readers and iterators are now ``Closable`` for use with try-with-resource syntax:: try( SimpleFeatureIterator features = source.getFeatures( filter ) ){ while( features.hasNext() ){ @@ -398,7 +398,7 @@ GeoTools 10.0 For background details on any API changes review the change proposals above. GeoTools 10 add significant improvements in the coverage reading API. -For those migrating the first visible benefit is that referring to a generic grid coverage reader does not require anymore to use AbstractGridCoverage2DReader (an abstract class) but to the new GridCoverage2DReader interface. The old usage is still supported though, as most readers are still extending the same base class, but the usage of the interface allows for reader wrappers. +For those migrating the first visible benefit is that referring to a generic grid coverage reader does not require anymore to use ``AbstractGridCoverage2DReader`` (an abstract class) but to the new ``GridCoverage2DReader`` interface. The old usage is still supported though, as most readers are still extending the same base class, but the usage of the interface allows for reader wrappers. BEFORE:: @@ -417,18 +417,18 @@ GeoTools 9.0 For background details on any API changes review the change proposals above. -GeoTools 9 has resolved a long standing conflict between FeatureCollection acting as a "result" set capable of -streaming large datasets vs. acting as a familiar Java Collection. The Java 5 "for each" syntax prevents -the safe use of Iterator (as we cannot ensure it will be closed). As a result FeatureCollection no longer -can extend java Collection and is acting as a pure "result set" with streaming access provided by FeatureIterator. +GeoTools 9 has resolved a long standing conflict between ``FeatureCollection`` acting as a "result" set capable of +streaming large data sets vs. acting as a familiar Java Collection. The Java 5 "for each" syntax prevents +the safe use of Iterator (as we cannot ensure it will be closed). As a result ``FeatureCollection`` no longer +can extend java Collection and is acting as a pure "result set" with streaming access provided by ``FeatureIterator``. ReferencedEnvelope and CRS ^^^^^^^^^^^^^^^^^^^^^^^^^^ -ReferencedEnvelope has in the past only supported 2D extents, we have introduced the subclass ReferencedEnvelope3D -to support CoordinateReferenceSystems with three dimensions. +``ReferencedEnvelope`` has in the past only supported 2D extents, we have introduced the subclass ``ReferencedEnvelope3D`` +to support ``CoordinateReferenceSystems`` with three dimensions. -There is now a new factory method to safely construct the appropriate implementation for a provided CoordinateReferenceSystem +There is now a new factory method to safely construct the appropriate implementation for a provided ``CoordinateReferenceSystem`` as shown below. BEFORE:: @@ -441,13 +441,13 @@ AFTER:: ReferencedEnvelope bbox = ReferencedEnvelope.create( crs ); ReferencedEnvelope copy = ReferencedEnvelope.create( bbox ); -This represents an *incompatible API change*, existing code using "new ReferencedEnvelope" may now throw -a RuntimeException when supplied with an incompatible CoordinateReferenceSystem. +This represents an *incompatible API change*, existing code using ``new ReferencedEnvelope`` may now throw +a ``RuntimeException`` when supplied with an incompatible ``CoordinateReferenceSystem``. FeatureCollection Add ^^^^^^^^^^^^^^^^^^^^^ -With the FeatureCollection.add method being removed, you will need to use an explicit instance that supports +With the ``FeatureCollection.add`` method being removed, you will need to use an explicit instance that supports adding content. BEFORE:: @@ -465,7 +465,8 @@ AFTER::    features.add( feature ); } -ALTERNATE (will throw exception if FeatureCollection does not implement java.util.Collection):: +ALTERNATE (will throw exception if ``FeatureCollection`` does not implement +``java.util.Collection``):: Collection collection = DataUtilities.collectionCast( featureCollection ); collection.addAll( list ); @@ -488,7 +489,7 @@ SPECIFIC:: FeatureCollection Iterator ^^^^^^^^^^^^^^^^^^^^^^^^^^ -The deprecated FeatureCollection.iterator() method is no longer available, please use FeatureCollection.features() +The deprecated ``FeatureCollection.iterator()`` method is no longer available, please use ``FeatureCollection.features()`` as shown below. BEFORE:: @@ -530,10 +531,11 @@ JAVA7:: How to Close an Iterator ^^^^^^^^^^^^^^^^^^^^^^^^ -We have made FeatureIterator implement Closable (for Java 7 try-with-resource compatibility). This -also provides an excellent replacement for FeatureCollection.close( Iterator ). +We have made ``FeatureIterator`` implement ``Closable`` (for Java 7 try-with-resource compatibility). This +also provides an excellent replacement for +``FeatureCollection.close(Iterator)``. -If you are using any wrapping Iterators that still require the ability to close() +If you are using any wrapping ``Iterators`` that still require the ability to ``close()`` please consider the following approach. BEFORE:: @@ -573,7 +575,7 @@ DETAIL:: } } -JAVA7 using try-with-resource syntax for Iterator that implements Closeable:: +JAVA7 using try-with-resource syntax for ``Iterator`` that implements ``Closeable``:: try ( Iterator i=collection.features()){ while( i.hasNext() ){ @@ -601,10 +603,10 @@ your code more readable. Style ^^^^^ -Some of the **gt-opengis** style methods that have been deprecated for a while are now removed. +Some of the ``gt-opengis`` style methods that have been deprecated for a while are now removed. -* Mark.getRotation() / Mark.setRotation( Expression ) -* Mark.getSize() / Mark.setSize( Expression ) +* ``Mark.getRotation()`` / ``Mark.setRotation( Expression )`` +* ``Mark.getSize()`` / ``Mark.setSize( Expression )`` These are handled in a similar manner: @@ -651,7 +653,7 @@ FeatureId Function '''''''' -We have extended **gt-opengis** Function to make the FunctionName description (especially +We have extended ``gt-opengis`` ``Function`` to make the ``FunctionName`` description (especially argument names) more available. * To update your code:: @@ -666,12 +668,12 @@ argument names) more available. } If you are extending abstract function expression base class; it provides a default implementation -of getFunctionName() allowing your code to compile. +of ``getFunctionName()`` allowing your code to compile. FunctionExpression '''''''''''''''''' -In a related matter **gt-main** no longer provides access to the deprecated FunctionExpression +In a related matter ``gt-main`` no longer provides access to the deprecated ``FunctionExpression`` interface (it has returned an empty set for several releases now): * BEFORE:: @@ -694,31 +696,31 @@ interface (it has returned an empty set for several releases now): Direct Position and Envelope ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Deprecated methods in **gt-opengis** and **gt-referencing** have now been removed. - -======================================= ================================ =============================== -Deprecated method in 2.7 Replacement in 8.0 Notes -======================================= ================================ =============================== -DirectPosition.getCoordinates() DirectPosition.getCoordinate() For consistency with ISO 19107 -Envelope.getCenter() Envelope.getMedian()}} For consistency with ISO 19107 -Envelope.getLength() Envelope.getSpan() For consistency with ISO 19107 -Precision.getMaximumSignificantDigits() Precision.getScale()}} Remove duplication -PointArray.length() List.size() PointArray instance can be used -PointArray.position() this PointArray instance can be used -Position.getPosition() Position.getDirectPosition() For consistency with ISO 19107 -Point.setPosition() Point.setDirectPosition() For consistency with ISO 19107 -======================================= ================================ =============================== +Deprecated methods in ``gt-opengis`` and ``gt-referencing`` have now been removed. + +=========================================== ==================================== =================================== +Deprecated method in 2.7 Replacement in 8.0 Notes +=========================================== ==================================== =================================== +``DirectPosition.getCoordinates()`` ``DirectPosition.getCoordinate()`` For consistency with ISO 19107 +``Envelope.getCenter()`` ``Envelope.getMedian()`` For consistency with ISO 19107 +``Envelope.getLength()`` ``Envelope.getSpan()`` For consistency with ISO 19107 +``Precision.getMaximumSignificantDigits()`` ``Precision.getScale()}}`` Remove duplication +``PointArray.length()`` ``List.size()`` ``PointArray`` instance can be used +``PointArray.position()`` ``this`` ``PointArray`` instance can be used +``Position.getPosition()`` ``Position.getDirectPosition()`` For consistency with ISO 19107 +``Point.setPosition()`` ``Point.setDirectPosition()`` For consistency with ISO 19107 +=========================================== ==================================== =================================== NumberRange ^^^^^^^^^^^ -The **gt-metadata** NumberRange class is finally shedding some of its deprecated methods. +The ``gt-metadata`` ``NumberRange`` class is finally shedding some of its deprecated methods. -** BEFORE:: +BEFORE:: NumberRange before = new NumberRange( 0.0, 5.0 ); -** AFTER:: +AFTER:: NumberRange after1 = new NumberRange( Double.class, 0.0, 5.0 ); NumberRange after2 = NumberRage.create( 0.0, 5.0 ); @@ -734,39 +736,39 @@ GeoTools 2.7 on the following changes. The changes from GeoTools 2.6 to GeoTools 2.7 focus on making your code more readable; you will -find a number of optional changes (such as using Query rather than DefaultQuery) which will +find a number of optional changes (such as using Query rather than ``DefaultQuery``) which will simplify make your code easier to follow. Query ^^^^^ -The *gt-api** module has been updated to make **Query** a concrete class rather than an interface. +The ``gt-api`` module has been updated to make ``Query`` a concrete class rather than an interface. -* BEFORE:: +BEFORE:: Query query = new DefaultQuery( typeName, filter ); -* AFTER:: +AFTER:: Query query = new Query( typeName, filter ); Tips: -* You can perform a search and replace to change DefaultQuery to Query on your code base -* If you have your own implementation of Query your code is now broken; after many years we have - never seen an implementation of Query in the wild. You should be able to fix by extending rather - then implementing Query. -* DefaultQuery still exists but all of the implementation code has now been "pulled up" into - Query and DefaultQuery marked as deprecated. -* In a similar fashion *FeatureLock* can now be directly constructed rather than use a Factory. +* You can perform a search and replace to change ``DefaultQuery`` to ``Query`` on your code base +* If you have your own implementation of ``Query`` your code is now broken; after many years we have + never seen an implementation of ``Query`` in the wild. You should be able to fix by extending rather + then implementing ``Query``. +* ``DefaultQuery`` still exists but all of the implementation code has now been "pulled up" into + ``Query`` and ``DefaultQuery`` marked as deprecated. +* In a similar fashion ``FeatureLock`` can now be directly constructed rather than use a ``Factory``. SimpleFeatureCollection ^^^^^^^^^^^^^^^^^^^^^^^ We have vastly cut down the use of Java generics for casual users of the GeoTools library. The -primary example of this is the introduction of **SimpleFeatureCollection** (which saves you -typing in **FeatureCollection** each time). +primary example of this is the introduction of ``SimpleFeatureCollection`` (which saves you +typing in ``FeatureCollection`` each time). * BEFORE:: @@ -784,12 +786,12 @@ typing in **FeatureCollection** each time). Tips: * You can do a search and replace on this one; but you need to be very careful with any - implementations you have that accept a FeatureCollection + implementations you have that accept a ``FeatureCollection`` as a method parameter! -* Be careful if you have your own FeatureStore implementation; a search and replace will change +* Be careful if you have your own ``FeatureStore`` implementation; a search and replace will change several of your methods so they no longer "override" the default implementation provided by - AbstractFeatureStore.:: + ``AbstractFeatureStore``.:: @Override // this would fail; you do use Override right? public Set addFeatures( SimpleFeatureCollection features ){ @@ -801,14 +803,14 @@ Tips: public Set addFeatures( FeatureCollection features ){ ... your implementation goes here ... - Note: If you use the @Override annotation in your code you will get a proper error; since your + Note: If you use the ``@Override`` annotation in your code you will get a proper error; since your new method would no longer override anything. SimpleFeatureSource ^^^^^^^^^^^^^^^^^^^ -The **gt-api** module now defines **SimpleFeatuyreSource** (to save you a bit of typing). In addition -the **DataStore** interface now returns a **SimpleFeatureSource**; so if you want you optionally +The ``gt-api`` module now defines ``SimpleFeatuyreSource`` (to save you a bit of typing). In addition +the ``DataStore`` interface now returns a ``SimpleFeatureSource``; so if you want you optionally can update your code for readability. * BEFORE:: @@ -816,17 +818,17 @@ can update your code for readability. FeatureSource source = (FeatureSource) dataStore.getFeatureSource( typeName ); -* AFTER: +* AFTER:: SimpleFeatureSource source = dataStore.getFeatureSource( typeName ); Tips: * you can do this with a search and replace -* Be a bit careful when you have one of your own methods that is expecting a FeatureSource +* Be a bit careful when you have one of your own methods that is expecting a ``FeatureSource`` SimpleFeatureStore ^^^^^^^^^^^^^^^^^^ -In a similar fashion returns a SimpleFeatureCollection; it also has a couple of its own tricks: +In a similar fashion returns a ``SimpleFeatureCollection``; it also has a couple of its own tricks: * BEFORE:: @@ -851,13 +853,13 @@ In a similar fashion returns a SimpleFeatureCollection; it also has a couple of SimpleFeatureLocking ^^^^^^^^^^^^^^^^^^^^ -You can also explicitly use SimpleFeatureLocking if you want read/write/lock access to simple -feature content. Much like **Query** it has been made a concrete class. +You can also explicitly use ``SimpleFeatureLocking`` if you want read/write/lock access to simple +feature content. Much like ``Query`` it has been made a concrete class. -FeatureStore modifyFeatures by Name -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +``FeatureStore`` ``modifyFeatures`` by ``Name`` +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The **FeatureStore** method modifyFeatures now allows you to modify features by name. +The ``FeatureStore`` method ``modifyFeatures`` now allows you to modify features by name. * BEFORE:: @@ -883,13 +885,13 @@ The **FeatureStore** method modifyFeatures now allows you to modify features by Tips: -* Generic FeatureSource allows modifyFeatures( Name, Value, filter ) +* Generic ``FeatureSource`` allows ``modifyFeatures(Name, Value, filter)`` CoverageProcessor ^^^^^^^^^^^^^^^^^ -The DefaultProcessor and AbstractProcessor classes have been merged into a single class called -**CoverageProcessor**. +The ``DefaultProcessor`` and ``AbstractProcessor`` classes have been merged into a single class called +``CoverageProcessor``. * BEFORE:: @@ -905,21 +907,21 @@ The DefaultProcessor and AbstractProcessor classes have been merged into a singl Tips: -* Try to always use the static getDefaultInstance method in order to leverage on SoftReference caching +* Try to always use the static ``getDefaultInstance`` method in order to leverage on ``SoftReference`` caching GeneralEnvelope ^^^^^^^^^^^^^^^ -We have been removing old deprecated code from the **GeneralEnvelope** class. +We have been removing old deprecated code from the ``GeneralEnvelope`` class. -=============================== =============================================== -Old Method New Method -=============================== =============================================== -double getCenter(dimension) DirectPosition getMedian() -double getCenter() double getMedian(dimension) -double getLength(dimension) double getSpan(dimension) -getLength(dimension, unit) double getSpan(dimension, unit) -=============================== =============================================== +=================================== =================================================== +Old Method New Method +=================================== =================================================== +``double getCenter(dimension)`` ``DirectPosition getMedian()`` +``double getCenter()`` ``double getMedian(dimension)`` +``double getLength(dimension)`` ``double getSpan(dimension)`` +``getLength(dimension, unit)`` ``double getSpan(dimension, unit)`` +=================================== =================================================== GeoTools 2.6 ------------ @@ -932,39 +934,39 @@ GeoTools 2.6 on the following changes. The GeoTools 2.6.0 release is incremental in nature with the main change being the introduction -of the "JDBC-NG" datastores the idea of Query capabilities (so you can check what hints are +of the ``JDBC-NG`` DataStores the idea of ``Query`` capabilities (so you can check what hints are supported). GridRange Removed ^^^^^^^^^^^^^^^^^ -GridRange implementations have been removed as the result of a change we are inheriting from GeoAPI -where a swtich from GridRange to GridEnvelope has been made. GridRange comes from +``GridRange`` implementations have been removed as the result of a change we are inheriting from GeoAPI +where a switch from ``GridRange`` to ``GridEnvelope`` has been made. ``GridRange`` comes from Grid Coverages Implementation specification 1.0 (which is basically dead) while -GridEnvelope comes from ISO 19123 which looks like the replacement. +``GridEnvelope`` comes from ISO 19123 which looks like the replacement. There is a big difference between interfaces though: -* **GridRange** treats its own maximum grid coordinates as EXCLUSIVES (like Java2D classes - Rectangle2D, RenderedImage and Raster do); while -* **GridEnvelope** uses a different convention where maximum grid coordinates are INCLUSIVES. +* ``GridRange`` treats its own maximum grid coordinates as EXCLUSIVE (like Java2D classes + ``Rectangle2D``, ``RenderedImage`` and ``Raster`` do); while +* ``GridEnvelope`` uses a different convention where maximum grid coordinates are INCLUSIVE. -This is shown in the code example below with the maxx variable. +This is shown in the code example below with the ``maxx`` variable. As far as switching over to the new classes, the equivalence are as follows: -1. Replace **GridRange2D** with **GridEnvelope2D** +1. Replace ``GridRange2D`` with ``GridEnvelope2D`` - Notice that now GridEnvelope2D is a Java2D rectangle and that it is also mutable! -2. Replace **GeneralGridRange** with **GeneralGridEnvelope** + Notice that now ``GridEnvelope2D`` is a Java2D ``Rectangle`` and that it is also mutable! +2. Replace ``GeneralGridRange`` with ``GeneralGridEnvelope`` There are a few more caveats, which we are showing here below. BEFORE: -1. Use getSpan where getLength was used +1. Use ``getSpan`` where ``getLength`` was used 2. Be EXTREMELY careful with the conventions for the inclusion/exclusion of the maximum coordinates. -3. GridRange2D IS a Rectangle and is mutable now! +3. ``GridRange2D`` IS a ``Rectangle`` and is mutable now! BEFORE:: @@ -998,20 +1000,20 @@ BEFORE: final int maxx = originalGridRange2D.getHigh(0)+1; final Rectangle rect = (Rectangle)originalGridRange2D.clone(); -OverviewPolicy Enum replace Hint use -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +``OverviewPolicy`` ``Enum`` replace ``Hint`` use +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The hints to control overviews were deprecated and have now been removed. The current deprecated values have been remove from the Hints class inside the Metadata module: -* VALUE_OVERVIEW_POLICY_QUALITY -* IGNORE_COVERAGE_OVERVIEW -* VALUE_OVERVIEW_POLICY_IGNORE -* VALUE_OVERVIEW_POLICY_NEAREST -* VALUE_OVERVIEW_POLICY_SPEED +* ``VALUE_OVERVIEW_POLICY_QUALITY`` +* ``IGNORE_COVERAGE_OVERVIEW`` +* ``VALUE_OVERVIEW_POLICY_IGNORE`` +* ``VALUE_OVERVIEW_POLICY_NEAREST`` +* ``VALUE_OVERVIEW_POLICY_SPEED`` -You should use the enum that comes with the OverviewPolicy enum. Here below you will find a few examples: +You should use the ``Enum`` that comes with the ``OverviewPolicy`` ``Enum``. Here below you will find a few examples: * BEFORE:: @@ -1027,18 +1029,18 @@ You should use the enum that comes with the OverviewPolicy enum. Here below you Hints: -* Please, notice that the OverviewPolicy enum provide a method to get the default policy for - overviews. The method is getDefaultPolicy(). +* Please, notice that the ``OverviewPolicy`` ``Enum`` provides a method to get the default policy for + overviews. The method is ``getDefaultPolicy()``. CoverageUtilities and FeatureUtilities ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Deprecated methods have been remove from coverage utilities classes  +Deprecated methods have been remove from coverage utilities classes; We have removed deprecated methods from classes: -* CoverageUtilities.java -* FeatureUtilities.java +* ``CoverageUtilities.java`` +* ``FeatureUtilities.java`` Existing code should change as follows: @@ -1055,7 +1057,7 @@ Existing code should change as follows: Hints: * This change allows us to store basic parameters to control how we will perform subsequent - reads from this reader. The  AbstractGridFormat READ_GRIDGEOMETRY2D parameter will be + reads from this reader. The ``AbstractGridFormat`` ``READ_GRIDGEOMETRY2D`` parameter will be always overridden during a subsequent read. Coverage Processing Classes @@ -1063,7 +1065,7 @@ Coverage Processing Classes Deprecated methods have been remove from coverage processing classes: -* filteredSubsample(GridCoverage, int, int, float[], Interpolation, BorderExtender) has been removed +* ``filteredSubsample(GridCoverage, int, int, float[], Interpolation, BorderExtender)`` has been removed Here is what that looks like in code: @@ -1117,7 +1119,7 @@ Here is what that looks like in code: DefaultParameterDescriptor and Parameter ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Removed deprecated constructors from DefaultParameterDescriptor and Parameter classes. +Removed deprecated constructors from ``DefaultParameterDescriptor`` and ``Parameter`` classes. * BEFORE:: @@ -1154,10 +1156,10 @@ FeatureCollction ^^^^^^^^^^^^^^^^ In transitioning your code to Java 5 please be careful not use use the *for each* loop construct. -We still need to call FeatureCollection.close( iterator). +We still need to call ``FeatureCollection.close( iterator)``. -Due to this restriction (of not using *for each* loop construct we have had to make FeatureCollection -no longer Collection. +Due to this restriction (of not using *for each* loop construct we have had to make ``FeatureCollection`` +no longer ``Collection``. * Example (GeoTools 2.5 code):: @@ -1192,8 +1194,8 @@ no longer Collection. JTSFactory ^^^^^^^^^^ -We are cutting down on "anonymous" FactoryFinder use; creating JTSFactory to allow the -entire GeoTools library to share a JTS GeometryFactory. +We are cutting down on "anonymous" ``FactoryFinder`` use; creating ``JTSFactory`` to allow the +entire GeoTools library to share a JTS ``GeometryFactory``. * BEFORE (GeoTools 2.4 code):: @@ -1206,7 +1208,7 @@ entire GeoTools library to share a JTS GeometryFactory. ProgressListener ^^^^^^^^^^^^^^^^ -Transition to gt-opengis ProgressListener. +Transition to ``gt-opengis`` ``ProgressListener``. * Before (GeoTools 2.2 Code):: @@ -1218,9 +1220,9 @@ Transition to gt-opengis ProgressListener. To upgrade: -1. Search: import org.geotools.util.ProgressListener +1. Search: ``import org.geotools.util.ProgressListener`` - Replace: import org.opengis.util.ProgressListener + Replace: ``import org.opengis.util.ProgressListener`` 2. Update:: @@ -1230,9 +1232,9 @@ SimpleFeature ^^^^^^^^^^^^^ We have (finally) made the move to an improved feature model. Please take the opportunity -to change your existing code to use *org.opengis.feature.simple.SimpleFeature*. The existing +to change your existing code to use ``org.opengis.feature.simple.SimpleFeature``. The existing GeoTools Feature interface is still in use; but it has been updated in -place to extend SimpleFeature. +place to extend ``SimpleFeature``. * Before (GeoTools 2.4 Code):: @@ -1280,15 +1282,15 @@ Here are some steps to start you off updating your code: 1. Search Replace - * Search: **Feature** replace with **SimpleFeature** - * Search: **FeatureType** replace with **SimpleFeatureType** + * Search: ``Feature`` replace with ``SimpleFeature`` + * Search: ``FeatureType`` replace with ``SimpleFeatureType`` 2. Fix the imports * Control-Shift-O in Eclipse IDE - * Add casts as required for getDefaultGeometry() + * Add casts as required for ``getDefaultGeometry()`` -3. FeatureType.create has been replaced with SimpleFeatureBuilder +3. ``FeatureType.create`` has been replaced with ``SimpleFeatureBuilder`` There is a static method to make the transition easier:: @@ -1301,7 +1303,7 @@ Here are some steps to start you off updating your code: AttributeDescriptor and AttributeType ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The concept of an AttributeType has been split into two now (allowing you to reuse common types). +The concept of an ``AttributeType`` has been split into two now (allowing you to reuse common types). * BEFORE (GeoTools 2.4 Code):: @@ -1332,8 +1334,8 @@ Name ^^^^ In order to better support app-schema work we can no longer assume names are a simple String. The -**Name** class has been introduced to make this easier and is available -throughout the library: example FeatureSource.getName(). +``Name`` class has been introduced to make this easier and is available +throughout the library: example ``FeatureSource.getName()``. * BEFORE (GeoTools 2.4 Code):: @@ -1362,7 +1364,7 @@ Transition to use of Java 5 Generics with DataStore API. .. tip We have removed the need to use Generics in GeoTools 2.7 allowing the use of - SimpleFeatureSource, SimpleFeatureCollection, SimpleFeatureStore etc. + ``SimpleFeatureSource``, ``SimpleFeatureCollection``, ``SimpleFeatureStore`` etc. * BEFORE (GeoTools 2.4 Code):: @@ -1416,7 +1418,7 @@ Transition to use of Java 5 Generics with DataStore API. DataAccess and DataStore ^^^^^^^^^^^^^^^^^^^^^^^^ -* The DataAcess super class has been introduced, leaving DataStore to *only* work with SimpleFeature +* The ``DataAccess`` super class has been introduced, leaving DataStore to *only* work with ``SimpleFeature`` capable implementations.:: import org.opengis.feature.type.Name; @@ -1439,7 +1441,7 @@ DataAccess and DataStore FeatureReader reader = ds.getFeatureReader(new DefaultQuery(typeName), transaction); FeatureWriter writer = ds.getFeatureWriter(typeName, transaction); -* DataAccess: works both with SimpleFeature and normal Feature capable implementations:: +* ``DataAccess``: works both with ``SimpleFeature`` and normal ``Feature`` capable implementations:: import org.opengis.feature.FeatureType; import org.opengis.feature.Feature; @@ -1470,16 +1472,16 @@ GeoTools 2.4 You are encouraged to review the change proposals for GeoTools 2.4.0 for background information on the following changes. -The GeoTools 2.4.0 release is a major change to the GeoTools library due to the adoption of geoapi -Filter model. This new filter model is immutable making it impossible to modify filters that -have already been constructed; in trade it is threadsafe. +The GeoTools 2.4.0 release is a major change to the GeoTools library due to the adoption of GeoAPI +``Filter`` model. This new filter model is immutable making it impossible to modify filters that +have already been constructed; in trade it is thread safe. The following is needed when upgrading to 2.4. ReferencingFactoryFinder ^^^^^^^^^^^^^^^^^^^^^^^^ -Rename FactoryFinder to ReferencingFactoryFinder +Rename ``FactoryFinder`` to ``ReferencingFactoryFinder`` * BEFORE (GeoTools 2.2 Code):: @@ -1489,10 +1491,10 @@ Rename FactoryFinder to ReferencingFactoryFinder CRSFactory factory = ReferencingFactoryFinder.getCSFactory( null ); -FeatureStore addFeatures -^^^^^^^^^^^^^^^^^^^^^^^^ +``FeatureStore`` ``addFeatures`` +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The use of FeatureReader has been removed from the FeatureStore API. +The use of ``FeatureReader`` has been removed from the ``FeatureStore`` API. * Before (GeoTools 2.2 Code):: @@ -1510,14 +1512,14 @@ The use of FeatureReader has been removed from the FeatureStore API. Note: -* DataUtilities.collection( reader ) will currently load the contents into memory, if you have +* ``DataUtilities.collection(reader)`` will currently load the contents into memory, if you have any volunteer time a "lazy" implementation would be helpful. -FeatureSource getSupportedHints -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +``FeatureSource`` ``getSupportedHints`` +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -We added a getSupportedHints() method that can be used to check which Query hints are supported -by a certain FeatureSource. If your FeatureSource does not intend to leverage query hints, just +We added a ``getSupportedHints()`` method that can be used to check which ``Query`` hints are supported +by a certain ``FeatureSource``. If your ``FeatureSource`` does not intend to leverage query hints, just return an empty set. * After (GeoTools 2.4 Code):: @@ -1529,13 +1531,13 @@ return an empty set. return Collections.EMPTY_SET; } -Query getHints -^^^^^^^^^^^^^^ +``Query`` ``getHints`` +^^^^^^^^^^^^^^^^^^^^^^ -We have added the method Query.getHints() allow users to pass in hints to control the query +We have added the method ``Query.getHints()`` allow users to pass in hints to control the query process. -If you have a Query implementation other than DefaultQuery you'll need to add the getHints() method. +If you have a ``Query`` implementation other than ``DefaultQuery`` you'll need to add the ``getHints()`` method. The default implementation, if you don't plan to leverage hints, can just return an empty Hints object. @@ -1596,26 +1598,26 @@ Here are the steps to follow to update your own code: 1. Substitute. - =================================== ================================================= - Search Replace - =================================== ================================================= - import org.geotools.filter.Filter; import org.opengis.filter.Filter; - import org.geotools.filter.SortBy; import org.opengis.filter.sort.SortBy; - Filter.NONE Filter.INCLUDE - Filter.ALL Filter.EXCLUDE - AbstractFilter.COMPARE FilterType.COMPARE - Filter.COMPARE FilterType.COMPARE - Filter.GEOMETRY FilterType.GEOMETRY - Filter.LOGIC FilterType.LOGIC - =================================== ================================================= + ======================================= ================================================= + Search Replace + ======================================= ================================================= + ``import org.geotools.filter.Filter;`` ``import org.opengis.filter.Filter;`` + ``import org.geotools.filter.SortBy;`` ``import org.opengis.filter.sort.SortBy;`` + ``Filter.NONE`` ``Filter.INCLUDE`` + ``Filter.ALL`` ``Filter.EXCLUDE`` + ``AbstractFilter.COMPARE`` ``FilterType.COMPARE`` + ``Filter.COMPARE`` ``FilterType.COMPARE`` + ``Filter.GEOMETRY`` ``FilterType.GEOMETRY`` + ``Filter.LOGIC`` ``FilterType.LOGIC`` + ======================================= ================================================= + +2. ``Filterype`` is no longer supported directly. -2. FilterType is no longer supported directly. - - BEFORE: + BEFORE:: int type = filter.getFilterType(); - AFTER: + AFTER:: int type = Filters.getFilterType( filter ); @@ -1629,7 +1631,7 @@ Here are the steps to follow to update your own code: filter = filterFactory.and( filter, other ); -4. We have provided an adaptor for your old filter visitors. +4. We have provided an adapter for your old filter visitors. BEFORE:: @@ -1672,7 +1674,7 @@ Here are the steps to follow to update your own code: Filter filter = filterFactory.property(name); -h4. After (GeoTools 2.4 Code):: +After (GeoTools 2.4 Code):: public void testAfter() throws Exception { FilterFactory ff = CommonFactoryFinder.getFilterFactory(null); @@ -1688,17 +1690,17 @@ h4. After (GeoTools 2.4 Code):: 1. Substitute - =============================================== =================================================== - Search Replace - =============================================== =================================================== - import org.geotools.filter.FilterFactory; import org.opengis.filter.FilterFactory; - FilterFactoryFinder.createFilterFactory() CommonFactoryFinder.getFilterFactory(null); - import org.geotools.filter.FilterFactoryFinder; import org.geotools.factory.CommonFactoryFinder - import org.geotools.filter.CompareFilter; import org.geoapi.spatial.BinaryComparisonOperator - CompareFilter BinaryComparisonOperator - =============================================== =================================================== + =================================================== ======================================================= + Search Replace + =================================================== ======================================================= + ``import org.geotools.filter.FilterFactory;`` ``import org.opengis.filter.FilterFactory;`` + ``FilterFactoryFinder.createFilterFactory()`` ``CommonFactoryFinder.getFilterFactory(null);`` + ``import org.geotools.filter.FilterFactoryFinder;`` ``import org.geotools.factory.CommonFactoryFinder`` + ``import org.geotools.filter.CompareFilter;`` ``import org.geoapi.spatial.BinaryComparisonOperator`` + ``CompareFilter`` ``BinaryComparisonOperator`` + =================================================== ======================================================= -2. Update code to use evaulate. +2. Update code to use evaluate. BEFORE:: @@ -1708,7 +1710,7 @@ h4. After (GeoTools 2.4 Code):: if( filter.evaluate( feature ){ -3. Update code to use instanceof checks. +3. Update code to use ``instanceof`` checks. BEFORE:: @@ -1721,17 +1723,17 @@ h4. After (GeoTools 2.4 Code):: Note regarding different Geometries -* Geotools was formally limited to only JTS Geometry -* GeoTools filter nows can take either JTS Geometry or ISO Geometry +* GeoTools was formally limited to only JTS Geometry +* GeoTools filter now can take either JTS Geometry or ISO Geometry * If you need to convert from one to the other:: JTSUtils.jtsToGo1(p, CRS.decode("EPSG:4326")); -Feature.getParent removed -^^^^^^^^^^^^^^^^^^^^^^^^^ +``Feature.getParent`` removed +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The feature.getParent() method have been deprecated as a mistake and has now been removed. +The ``feature.getParent()`` method have been deprecated as a mistake and has now been removed. * BEFORE (GeoTools 2.0 Code):: @@ -1784,41 +1786,41 @@ Notes: * you will have to make API changes to pass the intended parent collection in This is a mistake with the previous feature model (for a feature can exist in more then one -collection) and we apologise for the inconvenience. +collection) and we apologize for the inconvenience. Split Classification Expressions -The biggest user of the feature.getParent() mistake was the implementation of classification +The biggest user of the ``feature.getParent()`` mistake was the implementation of classification functions. You will now need to split up these expressions into two parts. * BEFORE (GeoTools 2.3): - 1. equal_interval( SPEED, 12 ) - 2. uses getParent() internally to produce classification on feature collection; + 1. ``equal_interval( SPEED, 12 )`` + 2. uses ``getParent()`` internally to produce classification on feature collection; 3. then checks which category each feature falls into Notes: - * please note the above code depends on getParent(), so it is not safe even for GeoTools 2.3 (as some features have a null parent). + * please note the above code depends on ``getParent()`` so it is not safe even for GeoTools 2.3 (as some features have a null parent). * AFTER (GeoTools 2.4): Apply the aggregation function to the feature collection: - 1. equalInterval( SPEED, 12 ) + 1. ``equalInterval( SPEED, 12 )`` 2. produce classification on provided feature collection 3. Construct a slot expression using the resulting literal:: classify( SPEED, {0} ) - 4. uses literal classification from step one + 4. use literal classification from step one GTRenderer ^^^^^^^^^^ -The GTRender interface was produced as a neutral ground for client code; traditional users of -LiteRenderer and LiteRenderer2 are asked to move to the implementation of GTRenderer called -StreamingRenderer. +The ``GTRender`` interface was produced as a neutral ground for client code; traditional users of +``LiteRenderer`` and ``LiteRenderer2`` are asked to move to the implementation of ``GTRenderer`` called +``StreamingRenderer``. * BEFORE (GeoTools 2.1): @@ -1847,7 +1849,7 @@ StreamingRenderer. draw.paint(g2d, outputArea, map.getLayerBounds() ); - By letting your code depend only on the GTRenderer interface you can experiment with + By letting your code depend only on the ``GTRenderer`` interface you can experiment with alternative implementations to find the best fit. JTS @@ -1912,19 +1914,19 @@ Swap to moved Coverage utility classes. import org.geotools.data.coverage.grid.* import org.geotools.image.imageio.* - Wrapping a GridCoverage into a feature in 2.3:: + Wrapping a ``GridCoverage`` into a feature in 2.3:: org.geotools.data.DataUtilities#wrapGc(GridCoverage gridCoverage) org.geotools.data.DataUtilities#wrapGcReader( AbstractGridCoverage2DReader gridCoverageReader, GeneralParameterValue[] params) - GridCoverageExchange Utility classes in 2.3:: + ``GridCoverageExchange`` Utility classes in 2.3:: org.geotools.data.coverage.grid.file.* org.geotools.data.coverage.grid.stream .* - org.geotools.coverage.io classes in 2.3:: + ``org.geotools.coverage.io`` classes in 2.3:: org.geotools.coverage.io.AbstractGridCoverageReader.java, org.geotools.coverage.io.AmbiguousMetadataException.java, @@ -1938,31 +1940,31 @@ Swap to moved Coverage utility classes. import org.geotools.coverage.grid.io.* import org.geotools.coverage.grid.io.imageio.* - Wrapping a GridCoverage into a feature in 2.4:: + Wrapping a ``GridCoverage`` into a feature in 2.4:: org.geotools.referencing.util.coverage.CoverageUtilities #wrapGc(GridCoverage gridCoverage) org.geotools.referencing.util.coverage.CoverageUtilities #wrapGcReader( AbstractGridCoverage2DReader gridCoverageReader, GeneralParameterValue[] params) - GridCoverageExchange Utility classes in 2.4. + ``GridCoverageExchange`` Utility classes in 2.4. The classes have been dismissed since apparently nobody was using. If needed we can reintroduce them as deprecated. - org.geotools.coverage.io classes in 2.4. + ``org.geotools.coverage.io`` classes in 2.4. - These classes have been moved to spike/exoreferenced waiting for Martin to review and merge into - org.geotools.coverage.grid.io package + These classes have been moved to ``spike/exoreferenced`` waiting for Martin to review and merge into + ``org.geotools.coverage.grid.io`` package -spatialschema -^^^^^^^^^^^^^ +``spatialschema`` +^^^^^^^^^^^^^^^^^ -Renamed spatialschema to geometry. +Renamed ``spatialschema`` to ``geometry``. -* Do you know what **spatialschema** was? We did not find it clear either. +* Do you know what ``spatialschema`` was? We did not find it clear either. - Renamed to **geometry**? + Renamed to ``geometry``? * BEFORE:: @@ -1983,7 +1985,7 @@ Renamed spatialschema to geometry. Repackage ArcSDE ^^^^^^^^^^^^^^^^ -Repackage arcsde datastore. +Repackage ArcSDE datastore. * BEFORE:: @@ -1993,11 +1995,12 @@ Repackage arcsde datastore. import org.geotools.arcsde.ArcSDEDataStoreFactory; -WorldImage -^^^^^^^^^^ +World Image +^^^^^^^^^^^ -Sets of WorldImage extensions. Changed from a single String to a Set .. because -one wld is not enough? +Sets of World Image extensions. Changed from a single String to a +``Set`` .. because +one ``wld`` is not enough? * BEFORE:: diff --git a/docs/user/welcome/use.rst b/docs/user/welcome/use.rst index e1e03cce577..4815aa50079 100644 --- a/docs/user/welcome/use.rst +++ b/docs/user/welcome/use.rst @@ -24,7 +24,7 @@ Download: advised that some of the jars will be in conflict. 1. Dump everything from a binary distribution of GeoTools into your IDE - 2. Remove all the jars that say epsg in them - except for the gt2-epsg jar. + 2. Remove all the jars that say ``epsg`` in them - except for the ``gt2-epsg jar``. 3. Ensure your JRE has JAI and ImageIO if you are doing raster work 4. Ignore the rest of this page @@ -54,13 +54,13 @@ Interfaces for Concepts and Ideas Formally these interfaces come from three locations: -* gt-opengis - interfaces backed by ISO and OGC standards (as explained in the Use of Standards page). -* jts topology suite - geometry library implementing the Simple Features for SQL (SFSQL) OGC standard. -* gt-main - interfaces provided by GeoTools. +* ``gt-opengis`` - interfaces backed by ISO and OGC standards (as explained in the Use of Standards page). +* JTS Topology Suite - geometry library implementing the Simple Features for SQL (SFSQL) OGC standard. +* ``gt-main`` - interfaces provided by GeoTools. We also have one stalled work in progress: -* gt-opengis has a set of ISO19107 geometry interfaces (anyone interested in curves and 3D?) +* ``gt-opengis`` has a set of ISO19107 geometry interfaces (anyone interested in curves and 3D?) These interfaces represent spatial concepts and data structures in your application and are suitable for use in method signatures. @@ -73,13 +73,13 @@ public classes to get the job done. Public classes are provided for the purpose of: -* Utility classes to make things easier to work with. Examples are the CQL, DataUtilities and JTS +* Utility classes to make things easier to work with. Examples are the ``CQL``, ``DataUtilities`` and ``JTS`` classes. Each of these provide public methods to help you make the most of the services provided by GeoTools. -* Helping glue the library together at runtime - an example is the FactoryFinders which allow you +* Helping glue the library together at runtime - an example is the ``FactoryFinders`` which allow you to look up available implementations on the CLASSPATH. * GeoTools "Extensions" provide additional services on top of the library and require additional - public classes to make this happen. An example is the ColorBrewer class provided by gt-brewer. + public classes to make this happen. An example is the ColorBrewer class provided by ``gt-brewer``. You can make use of public classes in these modules directly, in all cases they are utilities to get the job done. These classes are suitable for use in your import section. There is no need to @@ -93,10 +93,10 @@ an object. In Java the work around is to provide a "factory" that provides "crea you can use instead of **new**. GeoTools provides Factory classes allowing you to create the various objects used by the library, -such as Features, Styles, Filters, CoordinateReferencingSystems, and DataStores. +such as Features, Styles, Filters, ``CoordinateReferencingSystems``, and ``DataStore``\ s. -GeoTools provides a FactoryFinder system to locate the available factory implementations on the -CLASSPATH. By using a FactoryFinder your code can be built to function using only interfaces. +GeoTools provides a ``FactoryFinder`` system to locate the available factory implementations on the +CLASSPATH. By using a ``FactoryFinder`` your code can be built to function using only interfaces. For more information review the page How to Create Something which outlines how to locate an appropriate implementation at runtime. @@ -109,7 +109,7 @@ introduce a **dependency** between your code and that exact implementation. This depending on a specific implementation makes your code brittle with respect to change, and prevents you from taking advantage of a better implementation when it is made available in the future. -Bad practice with direct dependency on ShapeFileDataStoreFactory:: +Bad practice with direct dependency on ``ShapeFileDataStoreFactory``:: ShapefileDataStoreFactory factory = new ShapefileDataStoreFactory(); ShapeFileDataStore = factory.createDataStore( file ); @@ -121,7 +121,7 @@ Here is a replacement that allows GeoTools to return an indexed datastore if one DataStore dataStore = DataStoreFinder.getDataStore( file ); -The DataStoreFinder class looks up all the DataStoreFactory implementations available on the +The ``DataStoreFinder`` class looks up all the ``DataStoreFactory`` implementations available on the CLASSPATH and sorts out which one can make a DataStore to access the provided file. How to Create @@ -130,12 +130,13 @@ How to Create Code leveraging GeoTools usually works against the Java interfaces only but interfaces in Java don't provide any way to create actual objects. GeoTools therefore provides Factories which are concrete implementations through whose interface users can create actual GeoTools objects such as -Features, Styles, Filters, DataStores, and MathTransforms. +``Features``, ``Styles``, ``Filters``, ``DataStore``\ s, and ``MathTransform``\ s. -This page explains how to use the FactoryFinder system to find the appropriate Factory + +This page explains how to use the ``FactoryFinder`` system to find the appropriate Factory implementations to instantiate particular objects. The section page will show alternative approaches -to obtain and use a particular implementation of an appropriate DataStore interface; those examples -show the utility of the FactoryFinder system. +to obtain and use a particular implementation of an appropriate ``DataStore`` interface; those examples +show the utility of the ``FactoryFinder`` system. Creating in GeoTools ^^^^^^^^^^^^^^^^^^^^ @@ -144,7 +145,7 @@ To create an implementation (and not get your hands dirty by depending on a spec developers are asked to use a Factory. Other languages like Scala allow the definition of a constructors as part of the interface itself. -In GeoTools we use a "FactoryFinder" to look for a factory implementation on the classpath. +In GeoTools we use a ``FactoryFinder`` to look for a factory implementation on the classpath. Here is a quick example showing how to create and use a Filter:: @@ -157,18 +158,18 @@ Here is a quick example showing how to create and use a Filter:: In this example we: -1. Found an object which implements the GeoAPI FilterFactory2 interface using a FactoryFinder. +1. Found an object which implements the GeoAPI ``FilterFactory2`` interface using a ``FactoryFinder``. - (CommonFactoryFinder gave us FilterFactoryImpl in this case) + (``CommonFactoryFinder`` gave us ``FilterFactoryImpl`` in this case) 2. Used the Factory to produce our Instance. - (FilterFactoryImpl.less(..) method was used to create a PropertyIsLessThan Filter) + (``FilterFactoryImpl.less(..)`` method was used to create a ``PropertyIsLessThan`` Filter) 3. Used the instance to accomplish something. - (we used the filter to check the size of a Feature ) + (we used the filter to check the size of a ``Feature`` ) -FactoryFinder Reference -^^^^^^^^^^^^^^^^^^^^^^^ +``FactoryFinder`` Reference +^^^^^^^^^^^^^^^^^^^^^^^^^^^ There is a loose naming convention where we try and have a clear progression from interface name, factory name to factory finder name. @@ -176,66 +177,68 @@ factory name to factory finder name. However in practice we found it useful to gather many of the common factories together into a common class for lookup. -CommonFactoryFinder +``CommonFactoryFinder`` + + +* ``FilterFactory`` +* ``StyleFactory`` +* ``Function`` +* ``FileDataStore`` - factory used to work with file data stores +* ``FeatureFactory`` - factory used to create features +* ``FeatureTypeFactory`` - factory used to create feature type description +* ``FeatureCollections`` - factory used to create feature collection -* FilterFactory -* StyleFactory -* Function -* FileDataStore - factory used to work with file datastores -* FeatureFactory - factory used to create features -* FeatureTypeFactory - factory used to create feature type description -* FeatureCollections - factory used to create feature collection For access to feature (i.e. vector) information: -* DataAccessFinder - listing DataAccessFactory for working with feature data -* DataStoreFinder - lists DataStoreFactorySpi limited to simple features -* FileDataStoreFinder - Create of FileDataStoreFactorySpi instances limited to file formats +* ``DataAccessFinder`` - listing ``DataAccessFactory`` for working with feature data +* ``DataStoreFinder`` - lists ``DataStoreFactorySpi`` limited to simple features +* ``FileDataStoreFinder`` - Create of ``FileDataStoreFactorySpi`` instances limited to file formats For access to coverage (i.e. raster) information: -* GridFormatFinder - access to GridFormatFactorySpi supporting raster formats -* CoverageFactoryFinder - access to GridCoverageFactory +* ``GridFormatFinder`` - access to ``GridFormatFactorySpi`` supporting raster formats +* ``CoverageFactoryFinder`` - access to ``GridCoverageFactory`` -JTSFactoryFinder - used to create JTS GeometryFactory and PercisionModel +``JTSFactoryFinder`` - used to create JTS ``GeometryFactory`` and ``PercisionModel`` -* GeometryFactory -* PrecisionModel +* ``GeometryFactory`` +* ``PrecisionModel`` -ReferencingFactoryFinder - used to list referencing factories +``ReferencingFactoryFinder`` - used to list referencing factories -* DatumFactory -* CSFactory -* DatumAuthorityFactory -* CSAuthorityFactory -* CRSAuthorityFactory -* MathTransformFactory -* CoordinateOperationFactory -* CoordinateOperationAuthorityFactory +* ``DatumFactory`` +* ``CSFactory`` +* ``DatumAuthorityFactory`` +* ``CSAuthorityFactory`` +* ``CRSAuthorityFactory`` +* ``MathTransformFactory`` +* ``CoordinateOperationFactory`` +* ``CoordinateOperationAuthorityFactory`` Where to get a Factory ---------------------- It really depends on your application, depending on your environment you may locate a factory by either: -* Using a GeoTools "FactoryFinder". Most factory finders are provided by the main module. They will hunt down an implementation on the CLASSPATH for you to use. -* Use of "Container" - you may find an implementation provided as part of your application container (especially for a Java EE application). You can take this approach in normal applications with a container implementation like Spring, or PicoContainer +* Using a GeoTools ``FactoryFinder``. Most factory finders are provided by the main module. They will hunt down an implementation on the CLASSPATH for you to use. +* Use of "Container" - you may find an implementation provided as part of your application container (especially for a Java EE application). You can take this approach in normal applications with a container implementation like Spring, or ``PicoContainer`` * Use of "JNDI" - your application may also store an implementation in JNDI (this approach is often used to locate a DataSource in a JEE application) * Direct use of a known factory. You can always create a new Factory yourself and make use of it to create interfaces. * Direct use of an implementation. You may decide to duck the factory game completely and make use of a specific implementation using new. These examples will usually use a factory finder of some sort. For the details please review the How to Find a Factory page. -FactoryFinder -^^^^^^^^^^^^^ +``FactoryFinder`` +^^^^^^^^^^^^^^^^^ -While the use of Factories has become common place (especially in development environments like Spring). GeoTools has its own "FactoryFinder" classes, unique to project, which is how the library looks up what plugins are available for use. +While the use of Factories has become common place (especially in development environments like Spring). GeoTools has its own ``FactoryFinder`` classes, unique to project, which is how the library looks up what plugins are available for use. These facilities are also available for use in your own application. -FactoryFinder uses the "built-in" Java plug-in system known as Factory Service Provide Interface. This technique allows a jar to indicate what services it makes available (in this case implementations of a factory interface). +``FactoryFinder`` uses the "built-in" Java plug-in system known as Factory Service Provide Interface. This technique allows a jar to indicate what services it makes available (in this case implementations of a factory interface). -To make this easier to use we have a series of utility classes called "FactoryFinders". These classes work as a match maker - looking around at what is available on the CLASSPATH. They will perform the "search" and locate a the implementation you need. +To make this easier to use we have a series of utility classes called ``FactoryFinders``. These classes work as a match maker - looking around at what is available on the CLASSPATH. They will perform the "search" and locate the implementation you need. Here is an example:: @@ -244,13 +247,13 @@ Here is an example:: About FactorySPI '''''''''''''''' -The "FactorySPI" system is the out of the box plug in system that ships with Java. That is why we like it - we are sure you already are using the Java software after all. The SPI part is pronounced "spy" and stands for Service, Provider, Interface. +The ``FactorySPI`` system is the out of the box plug in system that ships with Java. That is why we like it - we are sure you already are using the Java software after all. The SPI part is pronounced "spy" and stands for Service, Provider, Interface. -The FactorySPI system has a look on your CLASSPATH and locates implementations of a requested service scattered around all the jars you have. It does this by looking in the jar MANIFEST folder in a services directory. +The ``FactorySPI`` system has a look on your CLASSPATH and locates implementations of a requested service scattered around all the jars you have. It does this by looking in the jar MANIFEST folder in a services directory. Factory SPI is a runtime plugin system; so your application can "discover" and use new abilities that GeoTools provides over time. As our shapefile support gets better and better your application will notice and make use of the best implementation for the job. -If you are curious you can make use of the FactorySPI system yourself to locate anything we got going on in GeoTools:: +If you are curious you can make use of the ``FactorySPI`` system yourself to locate anything we got going on in GeoTools:: Hints hints = GeoTools.getDefaultHints(); FactoryRegistry registry = new FactoryCreator(Arrays.asList(new Class[] {FilterFactory.class,})); @@ -261,11 +264,11 @@ If you are curious you can make use of the FactorySPI system yourself to locate Notes: -* keep your FactoryRegistry around, hold it in a static field or global lookup service such as JNDI. +* keep your ``FactoryRegistry`` around, hold it in a static field or global lookup service such as JNDI. * The registry usually creates one instance (the first time you ask) and will return it to you again next time * Specifically it will create you one instance per configuration (i.e. that Hints object), so if you ask again using the same hints you will get the same instance back -Think of FactoryRegistry keeping instances as singletons for you. In the same manner as it is a Java best practice (when making a singleton) to "partition" by ThreadGroup (so different applets use different singletons). FactoryRegistry does not follow this practice - it uses Hints to "partition" - so two applets that are configured the same will end up using the same FilterFactory. +Think of ``FactoryRegistry`` keeping instances as singletons for you. In the same manner as it is a Java best practice (when making a singleton) to "partition" by ``ThreadGroup`` (so different applets use different singletons). ``FactoryRegistry`` does not follow this practice - it uses Hints to "partition" - so two applets that are configured the same will end up using the same ``FilterFactory``. Application specific Alternatives ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -277,7 +280,7 @@ Container A container is a great way to take care of a lot of the boiler plate code involved in working with factories. Much of this documentation -will use PicoContainer (just because it is small), while many real +will use ``PicoContainer`` (just because it is small), while many real world applications use the Spring container. A container is basically a Map where you can look up instances. @@ -287,7 +290,7 @@ factories together. Popular techniques: -* reflection - picocontainer looks the constructors using reflection to see if any of the required parameters are available +* reflection - ``picocontainer`` looks the constructors using reflection to see if any of the required parameters are available * configuration - Spring uses a big XML file marking how each factory is created The other nice thing is the container can put off creating the @@ -303,27 +306,27 @@ factories until you actually ask for them.:: WKTParser parser = (WKTParser) container.newInstance( WKTParser.class ); -In the above example the WKTParser needs to be constructed with a PositionFactory, CoordinateFactory, PrimitiveFactory and ComplexFactory. Each one of these factories can only be constructed for a specific CoordinateReferenceSystem. +In the above example the ``WKTParser`` needs to be constructed with a ``PositionFactory``, ``CoordinateFactory``, ``PrimitiveFactory`` and ``ComplexFactory``. Each one of these factories can only be constructed for a specific ``CoordinateReferenceSystem``. -If we were not using a container to manage our factories it would of taken three times the number of lines of code just to set up a WKTParser. +If we were not using a container to manage our factories it would of taken three times the number of lines of code just to set up a ``WKTParser``. JNDI '''' -If you are writing a Java EE Application there is a big global map in the sky called "InitialContext". Literally this is a map you can do look up by name and find Java instances in. It is so global in fact that the instances will be shared between applications. +If you are writing a Java EE Application there is a big global map in the sky called ``InitialContext``. Literally this is a map you can do look up by name and find Java instances in. It is so global in fact that the instances will be shared between applications. This idea of a global cross application map is great for configuration and common services. If you are working with a Java EE application you will often find such things as: -* a CRSAuthorityFactory registered for any code wanting to use the referencing module +* a ``CRSAuthorityFactory`` registered for any code wanting to use the referencing module * a database listed under the Name "jdbc/EPSG" used to hold the EPSG tables -* a GeometryFactory, or FeatureTypeFactory and so on ... +* a ``GeometryFactory``, or ``FeatureTypeFactory`` and so on ... Here is the GeoTools code that looks up a DataSource for an EPSG authority:: Context context = JNDI.getInitialContext(null); DataSource source = (DataSource) context.lookup("jdbc/EPSG"); -The JNDI interfaces are shipped with Java; and two implementations are provided (one to talk to LDAP directories such as organisations deploy for email address information, and another for configuration information stored on the file system with your JRE). +The JNDI interfaces are shipped with Java; and two implementations are provided (one to talk to LDAP directories such as organizations deploy for email address information, and another for configuration information stored on the file system with your JRE). The difference between JNDI and a Container: @@ -336,11 +339,11 @@ The difference between JNDI and a Container: Application Server makes available to all applications. This same directory service can be used by you to share global - variables between applications. Some things like the CRSAuthority + variables between applications. Some things like the ``CRSAuthority`` can be treated as a "utility" and it makes sense to only have one of them for use from several applications at once. -Because making use of an application container is a good idea, and too hard to set up. There are a lot of alternative "light weight" containers available. Examples include pico container, JBoss container, Spring container and many many more. These containers focus on the storing of global variables (and making a lot of the difficult configuration automatic - like what factory needs to be created first). +Because making use of an application container is a good idea, and too hard to set up. There are a lot of alternative "light weight" containers available. Examples include picocontainer, JBoss container, Spring container and many many more. These containers focus on the storing of global variables (and making a lot of the difficult configuration automatic - like what factory needs to be created first). Direct use of Factory ^^^^^^^^^^^^^^^^^^^^^ @@ -382,8 +385,8 @@ You can skip the whole Factory madness and just do normal Java coding:: shapefile.setNamespace(namespace); shapefile.setMemoryMapped(true); -You are depending on a exact class here, violating the plug-in system and so on. Chances are that GeoTools should not let you do this (by making the constructor package visible and forcing you to use the associated DataStoreFactory instead). +You are depending on a exact class here, violating the plug-in system and so on. Chances are that GeoTools should not let you do this (by making the constructor package visible and forcing you to use the associated ``DataStoreFactory`` instead). -This option is fine for quick hacks, you may find that the ShapefileDataStore has additional methods (to handle such things as forcing the "prj" file to be rewritten):: +This option is fine for quick hacks, you may find that the ``ShapefileDataStore`` has additional methods (to handle such things as forcing the ``prj`` file to be rewritten):: shapefile.forceSchemaCRS( CRS.decode( "EPSG:4326" ) );