I have the some features and its coordinates in excel file and have an XML with the same features. I need to update the coordinates from excel to XML. Please suggest me the transformers and the process to update the geometry coordinates from excel to XML. I have point and linear features also. Please suggest. Thanks in advance.
Hi @chagantisasikir, the first idea that comes to mind when working with XML are the XML transformers. For updating XML have a look at the XMLUpdater
Â
Â
Actually I am transforming the coordinate system. I took the reader as Shape file, transformed the coordinates for all the features and written in an excel. Now the excel file contains the Key unique field for all the features with their transformed coordinates. For linear features, i have the vertex numbers as well in the excel file. Apart from this i have the data with old coordinates in XML file. I need to update the Geometry attribute in the XML, querying based on its unique field, Name.
For example: I have some 100 records in an XML. Name and Geometry are attributes. Based on its name, i need to query and update its geometry attribute. I will get both the values from excel, query Name in XML and update its geometry attribute. XML will have the Attribute name in the format <NAME>XXX</NAME>, Geometry attribute in format <GEOMETRY>X="123.456" Y="789.456"</GEOMETRY>. Excel will have the Name and Geometry columns with the values given above.
Â
Please suggest better procedure and transformers to be used.
Hi @chagantisasikir, as @itay suggested at first, the XMLUpdater can be used to update XML in general but it's hard to provide a solution that can be applied directly to your XML, since the concrete parameters setting should be considered depending on the actual XML schema.
Just an example. If your XML schema is the same as this example,
<?xml version="1.0"?>
<dataset>
    <NAME>AAA</NAME>
    <GEOMETRY>X="123.456" Y="789.123"</GEOMETRY>
    <NAME>XXX</NAME>
    <GEOMETRY>X="456.789" Y="123.456"</GEOMETRY>
    <NAME>ZZZ</NAME>
    <GEOMETRY>X="789.123" Y="456.789"</GEOMETRY>
</dataset>
you can update the value of GEOMETRY element specified by the NAME with this workflow.
See here to learn more about XPath: XPath Tutorial
Hi Takashi thank you for the detailed process. Yes my XML looks in a similar, the change in this is:
<?xml version="1.0"?>
<DATASET>
<FEATURE>
<NAME>AAA</NAME>
<GEOMETRY>X="123.456"Â Y="789.123"</GEOMETRY>
</FEATURE>
<FEATURE>
<NAME>XXX</NAME>Â Â Â Â
<GEOMETRY>X="456.789"Â Y="123.456"</GEOMETRY>
</FEATURE>
<FEATURE>Â Â Â Â
<NAME>ZZZ</NAME>Â Â Â Â
<GEOMETRY>X="789.123"Â Y="456.789"</GEOMETRY>
</FEATURE>
</DATASET>
I will try the process explained above and will come back to you.
Thank you.
Hi Takashi thank you for the detailed process. Yes my XML looks in a similar, the change in this is:
<?xml version="1.0"?>
<DATASET>
<FEATURE>
<NAME>AAA</NAME>
<GEOMETRY>X="123.456"Â Y="789.123"</GEOMETRY>
</FEATURE>
<FEATURE>
<NAME>XXX</NAME>Â Â Â Â
<GEOMETRY>X="456.789"Â Y="123.456"</GEOMETRY>
</FEATURE>
<FEATURE>Â Â Â Â
<NAME>ZZZ</NAME>Â Â Â Â
<GEOMETRY>X="789.123"Â Y="456.789"</GEOMETRY>
</FEATURE>
</DATASET>
I will try the process explained above and will come back to you.
Thank you.
Â
//FEATUREÂchild::NAMEatext()="@Value(NAME)"]]/GEOMETRYÂ
Â
I have tried the same. But throwing an error "
XMLUpdater(XQueryFactory2): invalid content passed to fn:parse-xml(): loader parsing error: Document is empty".
Can you check that the flow and the queries are correct or not. Please see the attached.flow.jpg
This is the actual xml format:
<?xml version="1.0"?>
Â
<INVENTORY>Â
<STRUCTURE>Â
<GEOMETRY>X="123456.789" Y="987654.321"</GEOMETRY>Â
<STRUCTURE_NAME>ABC:DEF::1234</STRUCTURE_NAME>Â
</STRUCTURE>Â
</INVENTORY>Â
I have tried the same. But throwing an error "
XMLUpdater(XQueryFactory2): invalid content passed to fn:parse-xml(): loader parsing error: Document is empty".
Can you check that the flow and the queries are correct or not. Please see the attached.flow.jpg
This is the actual xml format:
<?xml version="1.0"?>
Â
<INVENTORY>Â
<STRUCTURE>Â
<GEOMETRY>X="123456.789" Y="987654.321"</GEOMETRY>Â
<STRUCTURE_NAME>ABC:DEF::1234</STRUCTURE_NAME>Â
</STRUCTURE>Â
</INVENTORY>Â
As I have mentioned above, the XML document contains the GEOMETRY tag as an attribute. If any issue in the above given XML, can you suggest the way forward.
As I have mentioned above, the XML document contains the GEOMETRY tag as an attribute. If any issue in the above given XML, can you suggest the way forward.
Â
Yes checked and finally issue solved. Thank you for the great support. Now i am trying for linear features which will have multiple geometry tags inside geometries tag..like
<?xml version="1.0"?>
Â
<INVENTORY>Â
<LINEAR><GEOMETRIES>
Â
<GEOMETRY>X="123456.789" Y="987654.321"</GEOMETRY><GEOMETRY>X="1234.789" Y="987.321"</GEOMETRY>
</GEOMETRIES>
Â
<STRUCTURE_NAME>ABC:DEF::1234</STRUCTURE_NAME>Â
</LINEAR>Â
</INVENTORY>Yes checked and finally issue solved. Thank you for the great support. Now i am trying for linear features which will have multiple geometry tags inside geometries tag..like
<?xml version="1.0"?>
Â
<INVENTORY>Â
<LINEAR><GEOMETRIES>
Â
<GEOMETRY>X="123456.789" Y="987654.321"</GEOMETRY><GEOMETRY>X="1234.789" Y="987.321"</GEOMETRY>
</GEOMETRIES>
Â
<STRUCTURE_NAME>ABC:DEF::1234</STRUCTURE_NAME>Â
</LINEAR>Â
</INVENTORY>Â
- Create new <GEOMETRIES> element that contains multiple child <GEOMETRY> elements.
- Replace the original <GEOMETRIES> element in the source XML document with the new <GEOMETRIES> element, using the XMLUpdater transformer (Update Type: Replace, Value Type: XML/XQuery).
Â
Hi Takashi, Yes as guided and with your continuous great support, i have used the XMLTemplater and XMLUpdater to update the geometries in linear features. Everything is done. After all the ready XMLs, i have loaded the data and it looks good. But observed some deviation in the coordinates with respect to the data which is transformed through the ESRI in built Transformation functionality. Please find the deviation in the graphical representation also in the attached testing-fme.jpg. Polygons are the top view of the Buildings, "Circles" on it are the Features transformed using ESRI in built transformation functionality and "Rectangle with a Brown dot in it" are the features(almost of these feaatures are at the edge of the buildings) transformed through FME.
Please can you comment on the reason for deviation and suggest me further.
Hi Takashi, Yes as guided and with your continuous great support, i have used the XMLTemplater and XMLUpdater to update the geometries in linear features. Everything is done. After all the ready XMLs, i have loaded the data and it looks good. But observed some deviation in the coordinates with respect to the data which is transformed through the ESRI in built Transformation functionality. Please find the deviation in the graphical representation also in the attached testing-fme.jpg. Polygons are the top view of the Buildings, "Circles" on it are the Features transformed using ESRI in built transformation functionality and "Rectangle with a Brown dot in it" are the features(almost of these feaatures are at the edge of the buildings) transformed through FME.
Please can you comment on the reason for deviation and suggest me further.
Â
I am transforming the coordinates from Naparima 1955/UTM zone 20N to UTM-WGS 1984 zone 20N. Please find the attached snapshot reprojector.jpg for the source and target coordinate systems set in Reprojector and suggest further.
I am transforming the coordinates from Naparima 1955/UTM zone 20N to UTM-WGS 1984 zone 20N. Please find the attached snapshot reprojector.jpg for the source and target coordinate systems set in Reprojector and suggest further.
Â
If you open the two datasets (the "Circles" and the "Rectangle with a Brown dot in it") with FME Data Inspector, would the deviation still appear?Â
Â
Hi Takashi, Yes as guided and with your continuous great support, i have used the XMLTemplater and XMLUpdater to update the geometries in linear features. Everything is done. After all the ready XMLs, i have loaded the data and it looks good. But observed some deviation in the coordinates with respect to the data which is transformed through the ESRI in built Transformation functionality. Please find the deviation in the graphical representation also in the attached testing-fme.jpg. Polygons are the top view of the Buildings, "Circles" on it are the Features transformed using ESRI in built transformation functionality and "Rectangle with a Brown dot in it" are the features(almost of these feaatures are at the edge of the buildings) transformed through FME.
Please can you comment on the reason for deviation and suggest me further.
Â
Please find the attached snapshot fme-data-inspector.jpg from the FME Data inspector. Please observe the deviation, Black color features transformed through ESRI in built functionality. Blue color features transformed through FME. Please suggest. If required, for further details, we can discuss one to one..
Please need your comments on the above issue. So is it that deviation will be available if we use Reprojector? Is there any way to transform to the coordinates to match the ESRI transformed coordinates?
Please need your comments on the above issue. So is it that deviation will be available if we use Reprojector? Is there any way to transform to the coordinates to match the ESRI transformed coordinates?
Thank you for the information. I am unable to find the EsriReprojector. Do i need to install any plugins for that ?
Thank you for the information. I am unable to find the EsriReprojector. Do i need to install any plugins for that ?
Â
Â
Â
Â
I am getting an error while using ESRIReprojector. Please suggest . The error is "Esri Reprojector: Specified geotransformation `' (forward) may be inappropriate for reprojection from `Naparima55.UTM-20N' (GCS: `GCS_Naparima_1955') to `UTM84-20N' (GCS: `GCS_WGS_1984') using the ESRI reprojection engine"