Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info

This functionality requires at least Weave version 2.4.14 to run.

It also requires at least version 1.6.0 of the com.cohga.server.user.core bundle.
That version can be downloaded from https://dl.dropbox.com/u/6745119/plugins/com.cohga.server.user.core_1.6.0.jar if you do not have a newer version already installed (it was included in Weave 2.4.23).

The following .zip file contains the upload bundles that need to be extracted and started using the usual bundle installation procedure.
https://dl.dropbox.com/u/6745119/upload_331_20130918.zip

Note

You need to ensure that the following bundles are started:

  • com.cohga.spatial.upload.client
  • com.cohga.spatial.upload.core
  • com.cohga.spatial.upload.csv
  • com.cohga.spatial.upload.kml
  • com.cohga.spatial.upload.shp

either by starting them manually at the osgi prompt, or by editing weave\platform\configuration\config.ini and including them in the list of bundles to be started automatically.

Changes from older version

  • No dummy map engine required.
    • This version does not require that you create a dummy mapengine.upload map engine, and if you have one it must be removed.
    • The map engine is created and registered automatically.
    • The client does not need to reference the mapengine.upload map engine.
      • If the client does not reference the mapengine.upload map engine it will automatically added on top of the map, which may obscure selections and redlines, so you may want to add the mapengine.upload map engine anyway.
  • Layer names are automatically generated.
    • The name of the layer to include in the table of contents is generated based on information in the uploaded file or the base filename.
  • Multiple file upload.
    • On browsers that support it, basically anything except Internet Explorer, you can select multiple files to be uploaded at once, using the Control and Shift keys which choosing files in the file selector dialog box.
  • .kml improvements.
    • .kml files compressed in a .kmz file are now supported.
    • Improved style support for .kml files.
      • Polygon, line and point (including graphic markers) styles embedded in the .kml file are now used.
      • Point markers that reference external graphics that are hosted on third party web sites will require that the Weave server has internet access to download the images.
      • Graphic markers embedded in .kmz file and referenced from point styles in the .kml file are now supported.
  • .csv improvements.
    • .prj file support.
      • If you also upload a .prj file the projection of the data will be based on the projection information in the .prj file, so you don't have to choose the projection from a list.
    • .sld file support.
      • If you also upload a .sld file the rendering of the data will be based on the style layer description contained in the .sld file.
      • The .sld file can reference attributes contained in the .csv file.
  • .shp improvements.
    • .prj file support.
      • If you also upload a .prj file the projection of the data will be based on the projection information in the .prj file, so you don't have to choose the projection from a list.
    • .sld file support.
      • If you also upload a .sld file the rendering of the data will be based on the style layer description contained in the .sld file.
      • This requires that a .shx and .dbf file are also uploaded if the style contains references to feature attributes.
  • Style improvements.
    • The user has more control over the style that uploaded data is drawn.
      • If the uploaded data does not contain a .sld file, or does not have any embedded style information, then the user is asked to provide suitable fill/stroke/marker information, not just a single colour.
  • Simplified configuration.
    • No configuration of upload parameters is required.
    • You can provide configuration of upload parameters to change the projections available to the user.
    • You no longer can configure the colours or markers.
  • .gml not currently supported.
    • The existing gml implementation has not been migrated to the new version.

Configuration

The namespace for the upload parameters is urn:com.cohga.spatial.upload#1.0, so the following should be added to the list of namespaces at the top of the config file:
xmlns:upload="urn:com.cohga.spatial.upload#1.0"

Then you can create a new top level configuration item to contain the customisation to the upload parameters.

Note

The following upload parameter examples are each showing examples of changing one part of the upload configuration, when creating for your configuration for the upload there should only be a single <upload:parameters/> item


Code Block
xml
xml
titleUpload parameters, containing all the available options and their default values, if you don't create an upload:parameters configuration item this is what you'll get

<upload:parameters>
	<cleaning maximumFileAgeInHours="96" checkDelayInHours="6" />
	<projections label="Projection"/>
	<csv xlabel="X Field Column" ylabel="Y Field Column"/>
	<drawing timeout="60"/>
</upload:parameters>

...

Code Block
xml
xml
titleUpload parameters, overriding default projection list

<upload:parameters>
	<projections>
		<entry value="EPSG:4326">Geographic (WGS84)</entry>
		<entry value="EPSG:4283">Geographic (GDA94)</entry>
		<entry value="EPSG:20254">MGA Zone 54 (AGD66)</entry>
		<entry value="EPSG:20255">MGA Zone 55 (AGD66)</entry>
		<entry value="EPSG:28354">MGA Zone 54 (GDA94)</entry>
		<entry value="EPSG:28355" default="true">MGA Zone 55 (GDA94)</entry>
		<entry value="EPSG:3111">VicGrid94 (GDA94)</entry>
	</projections>
</upload:parameters>

...

Code Block
xml
xml
titleBasic button to add to toolbar in client config using default values and including a label for the button

	<item action="com.cohga.spatial.upload.uploadFile" text="Upload"/>

...

Code Block
xml
xml
titleAdvanced button to add to toolbar in client config with default values, if you don't override any of these values they are what you'll get

	<item action="com.cohga.spatial.upload.uploadFile">
		<maxFileCount>5</maxFileCount>
		<windowTitle>Upload File</windowTitle>
		<windowWidth>400</windowWidth>
		<windowHeight>300</windowHeight>
		<addText>Add</addText>
		<addTooltip>Add local files</addTooltip>
		<clearAllText>Clear</clearAllText>
		<clearAllTooltip>Clear all uploading files</clearAllTooltip>
		<uploadText>Upload</uploadText>
		<uploadTooltip>Upload All Files</uploadTooltip>
		<stopText>Stop</stopText>
		<stopTooltip>Stop uploading</stopTooltip>
		<step1PromtText>Please select files</step1PromtText>
		<supportedFormats><![CDATA[
		 SuportedSupported formats are:<p>
		 <ol>
		  <li>- Keyhole Markup (.kml or .kmz)</li>
		  <li>- Shapefile (.shp, .shx, .dbf)<li>
		  <li>- Comma Separated (.csv or .txt)</li>
		 </ol>
		 You can also include
		 <ol>
		  <li>- Style Layer Description file (.sld)</li>
		  <li>- Projection file (.prj)</li>
		 </ol>
		 for shapefiles and comma separated files
		]]></supportedFormats>
		<tocGroupLabel>Upload</tocGroupLabel>
		<tocGroupDescription>Uploaded Layers</tocGroupDescription>
		<pointsLabel>Points</pointsLabel>
		<linesLabel>Lines</linesLabel>
		<polygonsLabel>Polygons</polygonsLabel>
		<markLabel>Mark</markLabel>
		<fillLabel>Fill</fillLabel>
		<strokeLabel>Stroke</strokeLabel>
	</item>

...

Upload a shapefile with a style layer description and a projection

Changes from older version

  • No dummy map engine required.
    • This version does not require that you create a dummy mapengine.upload map engine, and if you have one it must be removed.
    • The map engine is created and registered automatically.
    • The client does not need to reference the mapengine.upload map engine.
      • If the client map view does not reference the mapengine.upload map engine it will automatically added on top of the map, which may obscure selections and redlines, so you may want to add the mapengine.upload map engine to the client map view configuration anyway.
  • Layer names are automatically generated.
    • The name of the layer to include in the table of contents is generated based on information in the uploaded file or the base filename.
  • Multiple file upload.
    • On browsers that support it, basically anything except Internet Explorer, you can select multiple files to be uploaded at once, using the Control and Shift keys which choosing files in the file selector dialog box.
  • .kml improvements.
    • .kml files compressed in a .kmz file are now supported.
    • Improved style support for .kml files.
      • Polygon, line and point (including graphic markers) styles embedded in the .kml file are now used.
      • Point markers that reference external graphics that are hosted on third party web sites will require that the Weave server has internet access to download the images.
      • Graphic markers embedded in .kmz file and referenced from point styles in the .kml file are now supported.
  • .csv improvements.
    • .prj file support.
      • If you also upload a .prj file the projection of the data will be based on the projection information in the .prj file, so you don't have to choose the projection from a list.
    • .sld file support.
      • If you also upload a .sld file the rendering of the data will be based on the style layer description contained in the .sld file.
      • The .sld file can reference attributes contained in the .csv file.
  • .shp improvements.
    • .prj file support.
      • If you also upload a .prj file the projection of the data will be based on the projection information in the .prj file, so you don't have to choose the projection from a list.
    • .sld file support.
      • If you also upload a .sld file the rendering of the data will be based on the style layer description contained in the .sld file.
      • This requires that a .shx and .dbf file are also uploaded if the style contains references to feature attributes.
  • Style improvements.
    • The user has more control over the style that uploaded data is drawn.
      • If the uploaded data does not contain a .sld file, or does not have any embedded style information, then the user is asked to provide suitable fill/stroke/marker information, not just a single colour.
  • Simplified configuration.
    • No configuration of upload parameters is required.
    • You can provide configuration of upload parameters to change the projections available to the user.
    • You no longer can configure the colours or markers.
  • .gml not currently supported.
    • The existing gml implementation has not been migrated to the new version.