[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1946: Modified DXF, coordinates are now nested within feature, and feature type is an attribute of feat...

revision-diff.txt (4.42 KB)

Minor tweak: suggest <coordinate> is renamed <coordinates>.. You are
storing multiple coordinates in this element.

···

On 2 June 2010 10:52, <noreply@launchpad.net> wrote:

------------------------------------------------------------
revno: 1946
committer: Lars <larshelg@larshelg-laptop>
branch nick: trunk
timestamp: Wed 2010-06-02 11:51:11 +0200
message:
Modified DXF, coordinates are now nested within feature, and feature type is an attribute of feature.
modified:
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/OrganisationUnitConverter.java
dhis-2/dhis-services/dhis-service-importexport/src/test/resources/dxfOrganisationUnits.xml

--
lp:dhis2
trunk : Code : DHIS

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to OpenID transaction in progress

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/OrganisationUnitConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/OrganisationUnitConverter.java 2010-05-29 16:06:56 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/OrganisationUnitConverter.java 2010-06-02 09:51:11 +0000
@@ -65,10 +65,10 @@
private static final String FIELD_ACTIVE = "active";
private static final String FIELD_COMMENT = "comment";
private static final String FIELD_GEO_CODE = "geoCode";
- private static final String FIELD_COORDINATES = "coordinates";
private static final String FIELD_COORDINATE = "coordinate";
- private static final String FIELD_FEATURE_TYPE = "featureType";
+ private static final String FIELD_FEATURE = "feature";
private static final String FIELD_LAST_UPDATED = "lastUpdated";
+ private static final String ATTRIBUTE_TYPE = "type";

// \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
// Constructor

@@ -126,9 +126,8 @@
writer.writeElement( FIELD_ACTIVE, String.valueOf( unit.isActive() ) );
writer.writeElement( FIELD_COMMENT, unit.getComment() );
writer.writeElement( FIELD_GEO_CODE, unit.getGeoCode() );
- writer.writeElement( FIELD_FEATURE_TYPE, unit.getFeatureType() );

- writer.openElement( FIELD_COORDINATES );
+ writer.openElement( FIELD_FEATURE, ATTRIBUTE_TYPE, unit.getFeatureType() );
for ( String coordinate : unit.getCoordinatesAsCollection() )
{
writer.writeElement( FIELD_COORDINATE, coordinate );
@@ -182,11 +181,11 @@
reader.moveToStartElement( FIELD_GEO_CODE );
unit.setGeoCode( reader.getElementValue() );

- reader.moveToStartElement( FIELD_FEATURE_TYPE );
- unit.setFeatureType( reader.getElementValue() );
+ reader.moveToStartElement( FIELD_FEATURE );
+ unit.setFeatureType( reader.getAttributeValue( ATTRIBUTE_TYPE ) );

            Collection&lt;String&gt; coordinates = new ArrayList&lt;String&gt;\(\);

- while ( reader.moveToStartElement( FIELD_COORDINATE, FIELD_COORDINATES ) )
+ while ( reader.moveToStartElement( FIELD_COORDINATE, FIELD_FEATURE ) )
{
coordinates.add( reader.getElementValue() );
}

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/test/resources/dxfOrganisationUnits.xml'
--- dhis-2/dhis-services/dhis-service-importexport/src/test/resources/dxfOrganisationUnits.xml 2010-05-25 17:36:53 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/test/resources/dxfOrganisationUnits.xml 2010-06-02 09:51:11 +0000
@@ -11,12 +11,11 @@
<active>true</active>
<comment>Comment</comment>
<geoCode>GeoCode</geoCode>
-<featureType>MultiPolygon</featureType>
-<coordinates>
+<feature type="MultiPolygon">
<coordinate>11.11,22.22 33.33,44.44 55.55,66.66</coordinate>
<coordinate>77.77,88.88 99.99,11.11 22.22,33.33</coordinate>
<coordinate>44.44,55.55 66.66,77.77 88.88,99.99</coordinate>
-</coordinates>
+</feature>
<lastUpdated>2010-01-01</lastUpdated>
</organisationUnit>
<organisationUnit>
@@ -30,12 +29,11 @@
<active>true</active>
<comment>Comment</comment>
<geoCode>GeoCode</geoCode>
-<featureType>MultiPolygon</featureType>
-<coordinates>
+<feature type="MultiPolygon">
<coordinate>11.11,22.22 33.33,44.44 55.55,66.66</coordinate>
<coordinate>77.77,88.88 99.99,11.11 22.22,33.33</coordinate>
<coordinate>44.44,55.55 66.66,77.77 88.88,99.99</coordinate>
-</coordinates>
+</feature>
<lastUpdated>2010-01-01</lastUpdated>
</organisationUnit>
<organisationUnit>
@@ -49,12 +47,11 @@
<active>true</active>
<comment>Comment</comment>
<geoCode>GeoCode</geoCode>
-<featureType>MultiPolygon</featureType>
-<coordinates>
+<feature type="MultiPolygon">
<coordinate>11.11,22.22 33.33,44.44 55.55,66.66</coordinate>
<coordinate>77.77,88.88 99.99,11.11 22.22,33.33</coordinate>
<coordinate>44.44,55.55 66.66,77.77 88.88,99.99</coordinate>
-</coordinates>
+</feature>
<lastUpdated>2010-01-01</lastUpdated>
</organisationUnit>
</organisationUnits>

_______________________________________________
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help : https://help.launchpad.net/ListHelp

Although it (maybe) is a bit overkill to implement GML for our
purposes, it would probably be a good idea to at least look at some
examples and follow what we can..

http://openlayers.org/dev/examples/gml/ for example

It might be a good idea to declare the coordinate system someplace as
well (EPSG 4326 so far).

Regards,
JPP

···

On Wed, Jun 2, 2010 at 12:39 PM, Bob Jolliffe <bobjolliffe@gmail.com> wrote:

Minor tweak: suggest <coordinate> is renamed <coordinates>.. You are
storing multiple coordinates in this element.

On 2 June 2010 10:52, <noreply@launchpad.net> wrote:

------------------------------------------------------------
revno: 1946
committer: Lars <larshelg@larshelg-laptop>
branch nick: trunk
timestamp: Wed 2010-06-02 11:51:11 +0200
message:
Modified DXF, coordinates are now nested within feature, and feature type is an attribute of feature.
modified:
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/OrganisationUnitConverter.java
dhis-2/dhis-services/dhis-service-importexport/src/test/resources/dxfOrganisationUnits.xml

--
lp:dhis2
trunk : Code : DHIS

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to OpenID transaction in progress

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/OrganisationUnitConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/OrganisationUnitConverter.java 2010-05-29 16:06:56 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/OrganisationUnitConverter.java 2010-06-02 09:51:11 +0000
@@ -65,10 +65,10 @@
private static final String FIELD_ACTIVE = "active";
private static final String FIELD_COMMENT = "comment";
private static final String FIELD_GEO_CODE = "geoCode";
- private static final String FIELD_COORDINATES = "coordinates";
private static final String FIELD_COORDINATE = "coordinate";
- private static final String FIELD_FEATURE_TYPE = "featureType";
+ private static final String FIELD_FEATURE = "feature";
private static final String FIELD_LAST_UPDATED = "lastUpdated";
+ private static final String ATTRIBUTE_TYPE = "type";

// \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
// Constructor

@@ -126,9 +126,8 @@
writer.writeElement( FIELD_ACTIVE, String.valueOf( unit.isActive() ) );
writer.writeElement( FIELD_COMMENT, unit.getComment() );
writer.writeElement( FIELD_GEO_CODE, unit.getGeoCode() );
- writer.writeElement( FIELD_FEATURE_TYPE, unit.getFeatureType() );

- writer.openElement( FIELD_COORDINATES );
+ writer.openElement( FIELD_FEATURE, ATTRIBUTE_TYPE, unit.getFeatureType() );
for ( String coordinate : unit.getCoordinatesAsCollection() )
{
writer.writeElement( FIELD_COORDINATE, coordinate );
@@ -182,11 +181,11 @@
reader.moveToStartElement( FIELD_GEO_CODE );
unit.setGeoCode( reader.getElementValue() );

- reader.moveToStartElement( FIELD_FEATURE_TYPE );
- unit.setFeatureType( reader.getElementValue() );
+ reader.moveToStartElement( FIELD_FEATURE );
+ unit.setFeatureType( reader.getAttributeValue( ATTRIBUTE_TYPE ) );

            Collection&lt;String&gt; coordinates = new ArrayList&lt;String&gt;\(\);

- while ( reader.moveToStartElement( FIELD_COORDINATE, FIELD_COORDINATES ) )
+ while ( reader.moveToStartElement( FIELD_COORDINATE, FIELD_FEATURE ) )
{
coordinates.add( reader.getElementValue() );
}

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/test/resources/dxfOrganisationUnits.xml'
--- dhis-2/dhis-services/dhis-service-importexport/src/test/resources/dxfOrganisationUnits.xml 2010-05-25 17:36:53 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/test/resources/dxfOrganisationUnits.xml 2010-06-02 09:51:11 +0000
@@ -11,12 +11,11 @@
<active>true</active>
<comment>Comment</comment>
<geoCode>GeoCode</geoCode>
-<featureType>MultiPolygon</featureType>
-<coordinates>
+<feature type="MultiPolygon">
<coordinate>11.11,22.22 33.33,44.44 55.55,66.66</coordinate>
<coordinate>77.77,88.88 99.99,11.11 22.22,33.33</coordinate>
<coordinate>44.44,55.55 66.66,77.77 88.88,99.99</coordinate>
-</coordinates>
+</feature>
<lastUpdated>2010-01-01</lastUpdated>
</organisationUnit>
<organisationUnit>
@@ -30,12 +29,11 @@
<active>true</active>
<comment>Comment</comment>
<geoCode>GeoCode</geoCode>
-<featureType>MultiPolygon</featureType>
-<coordinates>
+<feature type="MultiPolygon">
<coordinate>11.11,22.22 33.33,44.44 55.55,66.66</coordinate>
<coordinate>77.77,88.88 99.99,11.11 22.22,33.33</coordinate>
<coordinate>44.44,55.55 66.66,77.77 88.88,99.99</coordinate>
-</coordinates>
+</feature>
<lastUpdated>2010-01-01</lastUpdated>
</organisationUnit>
<organisationUnit>
@@ -49,12 +47,11 @@
<active>true</active>
<comment>Comment</comment>
<geoCode>GeoCode</geoCode>
-<featureType>MultiPolygon</featureType>
-<coordinates>
+<feature type="MultiPolygon">
<coordinate>11.11,22.22 33.33,44.44 55.55,66.66</coordinate>
<coordinate>77.77,88.88 99.99,11.11 22.22,33.33</coordinate>
<coordinate>44.44,55.55 66.66,77.77 88.88,99.99</coordinate>
-</coordinates>
+</feature>
<lastUpdated>2010-01-01</lastUpdated>
</organisationUnit>
</organisationUnits>

_______________________________________________
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help : https://help.launchpad.net/ListHelp

_______________________________________________
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help : https://help.launchpad.net/ListHelp

--
--
Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+260968395190

Hi Jason

Although it (maybe) is a bit overkill to implement GML for our
purposes, it would probably be a good idea to at least look at some
examples and follow what we can..

http://openlayers.org/dev/examples/gml/ for example

I'm not yet convinced that is too much overkill to implement a small
featureset dialect. I guess the main problem is there would be a few
redundant elements (<gml:outerBoundaryIs>, <gml:LinearRing> etc) which
we would not be doing anything useful with except just pushing them in
and out of the xml to make it valid gml. So in our concise gml-like
markup Lars has just stripped these out and gone straight from the
feature to the coordinates. I can see his point.

But I would argue that
(i) compared to the bulk of coordinates data, the proportion of
overhead introduced by the extra elements is not too significant; and
(ii) we can still be as concise as our underlying model allows re the
actual storage.

But its a matter of gaining on the swings and losing on the
roundabouts. What we gain is that any third party app can look at the
GIS info in our dxf export and be able to understand it without too
much additional documentation (the benefit of reuse). The cost is
that from a dhis internal perspective there's some redundancy in the
markup.

Lars would argue that we can always do a gml export of our dxf gis
data anyway by passing it through a dxf2gml transformer.

Mind you, to do this we would have to define a simple
dxf:FeatureCollection (schema) to host the transformed gml elements
anyway (like the wfs in the example you gave). So if we're going to
do that for the purpose of export my sense is that we might as well
just use the <dxf:Feature> ... gml stuff ... </dxf:Feature> directly
in the <dxf:OrganisationUnit> in the first place.

I'm happy to have it as it is for the moment. Its pretty cool to be
able to read this stuff in anyway. When I get back to motivating
dxfv2 (real soon now) I'll revisit the issue.

It might be a good idea to declare the coordinate system someplace as
well (EPSG 4326 so far).

Don't know enough about this stuff, but is there any immediate
prospect of us using anything but EPSG 4326 ?

Cheers
Bob

···

On 2 June 2010 12:56, Jason Pickering <jason.p.pickering@gmail.com> wrote:

Regards,
JPP

On Wed, Jun 2, 2010 at 12:39 PM, Bob Jolliffe <bobjolliffe@gmail.com> wrote:

Minor tweak: suggest <coordinate> is renamed <coordinates>.. You are
storing multiple coordinates in this element.

On 2 June 2010 10:52, <noreply@launchpad.net> wrote:

------------------------------------------------------------
revno: 1946
committer: Lars <larshelg@larshelg-laptop>
branch nick: trunk
timestamp: Wed 2010-06-02 11:51:11 +0200
message:
Modified DXF, coordinates are now nested within feature, and feature type is an attribute of feature.
modified:
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/OrganisationUnitConverter.java
dhis-2/dhis-services/dhis-service-importexport/src/test/resources/dxfOrganisationUnits.xml

--
lp:dhis2
trunk : Code : DHIS

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to OpenID transaction in progress

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/OrganisationUnitConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/OrganisationUnitConverter.java 2010-05-29 16:06:56 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/OrganisationUnitConverter.java 2010-06-02 09:51:11 +0000
@@ -65,10 +65,10 @@
private static final String FIELD_ACTIVE = "active";
private static final String FIELD_COMMENT = "comment";
private static final String FIELD_GEO_CODE = "geoCode";
- private static final String FIELD_COORDINATES = "coordinates";
private static final String FIELD_COORDINATE = "coordinate";
- private static final String FIELD_FEATURE_TYPE = "featureType";
+ private static final String FIELD_FEATURE = "feature";
private static final String FIELD_LAST_UPDATED = "lastUpdated";
+ private static final String ATTRIBUTE_TYPE = "type";

// \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
// Constructor

@@ -126,9 +126,8 @@
writer.writeElement( FIELD_ACTIVE, String.valueOf( unit.isActive() ) );
writer.writeElement( FIELD_COMMENT, unit.getComment() );
writer.writeElement( FIELD_GEO_CODE, unit.getGeoCode() );
- writer.writeElement( FIELD_FEATURE_TYPE, unit.getFeatureType() );

- writer.openElement( FIELD_COORDINATES );
+ writer.openElement( FIELD_FEATURE, ATTRIBUTE_TYPE, unit.getFeatureType() );
for ( String coordinate : unit.getCoordinatesAsCollection() )
{
writer.writeElement( FIELD_COORDINATE, coordinate );
@@ -182,11 +181,11 @@
reader.moveToStartElement( FIELD_GEO_CODE );
unit.setGeoCode( reader.getElementValue() );

- reader.moveToStartElement( FIELD_FEATURE_TYPE );
- unit.setFeatureType( reader.getElementValue() );
+ reader.moveToStartElement( FIELD_FEATURE );
+ unit.setFeatureType( reader.getAttributeValue( ATTRIBUTE_TYPE ) );

            Collection&lt;String&gt; coordinates = new ArrayList&lt;String&gt;\(\);

- while ( reader.moveToStartElement( FIELD_COORDINATE, FIELD_COORDINATES ) )
+ while ( reader.moveToStartElement( FIELD_COORDINATE, FIELD_FEATURE ) )
{
coordinates.add( reader.getElementValue() );
}

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/test/resources/dxfOrganisationUnits.xml'
--- dhis-2/dhis-services/dhis-service-importexport/src/test/resources/dxfOrganisationUnits.xml 2010-05-25 17:36:53 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/test/resources/dxfOrganisationUnits.xml 2010-06-02 09:51:11 +0000
@@ -11,12 +11,11 @@
<active>true</active>
<comment>Comment</comment>
<geoCode>GeoCode</geoCode>
-<featureType>MultiPolygon</featureType>
-<coordinates>
+<feature type="MultiPolygon">
<coordinate>11.11,22.22 33.33,44.44 55.55,66.66</coordinate>
<coordinate>77.77,88.88 99.99,11.11 22.22,33.33</coordinate>
<coordinate>44.44,55.55 66.66,77.77 88.88,99.99</coordinate>
-</coordinates>
+</feature>
<lastUpdated>2010-01-01</lastUpdated>
</organisationUnit>
<organisationUnit>
@@ -30,12 +29,11 @@
<active>true</active>
<comment>Comment</comment>
<geoCode>GeoCode</geoCode>
-<featureType>MultiPolygon</featureType>
-<coordinates>
+<feature type="MultiPolygon">
<coordinate>11.11,22.22 33.33,44.44 55.55,66.66</coordinate>
<coordinate>77.77,88.88 99.99,11.11 22.22,33.33</coordinate>
<coordinate>44.44,55.55 66.66,77.77 88.88,99.99</coordinate>
-</coordinates>
+</feature>
<lastUpdated>2010-01-01</lastUpdated>
</organisationUnit>
<organisationUnit>
@@ -49,12 +47,11 @@
<active>true</active>
<comment>Comment</comment>
<geoCode>GeoCode</geoCode>
-<featureType>MultiPolygon</featureType>
-<coordinates>
+<feature type="MultiPolygon">
<coordinate>11.11,22.22 33.33,44.44 55.55,66.66</coordinate>
<coordinate>77.77,88.88 99.99,11.11 22.22,33.33</coordinate>
<coordinate>44.44,55.55 66.66,77.77 88.88,99.99</coordinate>
-</coordinates>
+</feature>
<lastUpdated>2010-01-01</lastUpdated>
</organisationUnit>
</organisationUnits>

_______________________________________________
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help : https://help.launchpad.net/ListHelp

_______________________________________________
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help : https://help.launchpad.net/ListHelp

--
--
Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+260968395190

Minor tweak: suggest is renamed … You are

storing multiple coordinates in this element.

Agree, done.

···

On Wed, Jun 2, 2010 at 12:39 PM, Bob Jolliffe bobjolliffe@gmail.com wrote:

On 2 June 2010 10:52, noreply@launchpad.net wrote:


revno: 1946

committer: Lars larshelg@larshelg-laptop

branch nick: trunk

timestamp: Wed 2010-06-02 11:51:11 +0200

message:

Modified DXF, coordinates are now nested within feature, and feature type is an attribute of feature.

modified:

dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/OrganisationUnitConverter.java

dhis-2/dhis-services/dhis-service-importexport/src/test/resources/dxfOrganisationUnits.xml

lp:dhis2

https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.

To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription

=== modified file ‘dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/OrganisationUnitConverter.java’

— dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/OrganisationUnitConverter.java 2010-05-29 16:06:56 +0000

+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/OrganisationUnitConverter.java 2010-06-02 09:51:11 +0000

@@ -65,10 +65,10 @@

private static final String FIELD_ACTIVE = "active";
private static final String FIELD_COMMENT = "comment";
private static final String FIELD_GEO_CODE = "geoCode";
  • private static final String FIELD_COORDINATES = “coordinates”;
private static final String FIELD_COORDINATE = "coordinate";
  • private static final String FIELD_FEATURE_TYPE = “featureType”;
  • private static final String FIELD_FEATURE = “feature”;
private static final String FIELD_LAST_UPDATED = "lastUpdated";
  • private static final String ATTRIBUTE_TYPE = “type”;
// -------------------------------------------------------------------------
// Constructor

@@ -126,9 +126,8 @@

            writer.writeElement( FIELD_ACTIVE, String.valueOf( unit.isActive() ) );
            writer.writeElement( FIELD_COMMENT, unit.getComment() );
            writer.writeElement( FIELD_GEO_CODE, unit.getGeoCode() );
  •            writer.writeElement( FIELD_FEATURE_TYPE, unit.getFeatureType() );
    
  •            writer.openElement( FIELD_COORDINATES );
    
  •            writer.openElement( FIELD_FEATURE, ATTRIBUTE_TYPE, unit.getFeatureType() );
    
            for ( String coordinate : unit.getCoordinatesAsCollection() )
            {
                writer.writeElement( FIELD_COORDINATE, coordinate );

@@ -182,11 +181,11 @@

            reader.moveToStartElement( FIELD_GEO_CODE );
            unit.setGeoCode( reader.getElementValue() );
  •            reader.moveToStartElement( FIELD_FEATURE_TYPE );
    
  •            unit.setFeatureType( reader.getElementValue() );
    
  •            reader.moveToStartElement( FIELD_FEATURE );
    
  •            unit.setFeatureType( reader.getAttributeValue( ATTRIBUTE_TYPE ) );
    
            Collection<String> coordinates = new ArrayList<String>();
  •            while ( reader.moveToStartElement( FIELD_COORDINATE, FIELD_COORDINATES ) )
    
  •            while ( reader.moveToStartElement( FIELD_COORDINATE, FIELD_FEATURE ) )
    
            {
                coordinates.add( reader.getElementValue() );
            }

=== modified file ‘dhis-2/dhis-services/dhis-service-importexport/src/test/resources/dxfOrganisationUnits.xml’

— dhis-2/dhis-services/dhis-service-importexport/src/test/resources/dxfOrganisationUnits.xml 2010-05-25 17:36:53 +0000

+++ dhis-2/dhis-services/dhis-service-importexport/src/test/resources/dxfOrganisationUnits.xml 2010-06-02 09:51:11 +0000

@@ -11,12 +11,11 @@

true

Comment

GeoCode

-MultiPolygon

-

+

11.11,22.22 33.33,44.44 55.55,66.66

77.77,88.88 99.99,11.11 22.22,33.33

44.44,55.55 66.66,77.77 88.88,99.99

-

+

2010-01-01

@@ -30,12 +29,11 @@

true

Comment

GeoCode

-MultiPolygon

-

+

11.11,22.22 33.33,44.44 55.55,66.66

77.77,88.88 99.99,11.11 22.22,33.33

44.44,55.55 66.66,77.77 88.88,99.99

-

+

2010-01-01

@@ -49,12 +47,11 @@

true

Comment

GeoCode

-MultiPolygon

-

+

11.11,22.22 33.33,44.44 55.55,66.66

77.77,88.88 99.99,11.11 22.22,33.33

44.44,55.55 66.66,77.77 88.88,99.99

-

+

2010-01-01


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp