latitude/longitude info in a GML Bounding box - latitude-longitude

If, for example, we have bounding box as given below in gml:
<gml:Envelope>
<gml:lowerCorner>42.943 -71.032</gml:lowerCorner>
<gml:upperCorner>43.039 -69.856</gml:upperCorner>
</gml:Envelope>
Now, for the lower corner, which value is the latitude and which is the longitude. Could not find this info in online documentation.
Thanks
Wanderer
The above GML is formatted in GeoRSS

From the GML schema:
<complexType name="EnvelopeType">
<choice>
<sequence>
<element name="lowerCorner" type="gml:DirectPositionType"/>
<element name="upperCorner" type="gml:DirectPositionType"/>
</sequence>
<element ref="gml:pos" minOccurs="2" maxOccurs="2">
<annotation>
<appinfo>deprecated</appinfo>
</annotation>
</element>
<element ref="gml:coordinates"/>
</choice>
<attributeGroup ref="gml:SRSReferenceGroup"/>
</complexType>
<element name="Envelope" type="gml:EnvelopeType" substitutionGroup="gml:AbstractObject">
<annotation>
<documentation>
Envelope defines an extent using a pair of positions defining opposite corners in arbitrary dimensions. The first direct position is the "lower corner" (a coordinate position consisting of all the minimal ordinates for each dimension for all points within the envelope), the second one the "upper corner" (a coordinate position consisting of all the maximal ordinates for each dimension for all points within the envelope). The use of the properties "coordinates" and "pos" has been deprecated. The explicitly named properties "lowerCorner" and "upperCorner" shall be used instead.
</documentation>
</annotation>
</element>
which leads to SRSReference group which contains the code to allow you to look up the axis order and units (amongst other things) about your coordinates.:
<attributeGroup name="SRSReferenceGroup">
<annotation>
<documentation>
The attribute group SRSReferenceGroup is an optional reference to the CRS used by this geometry, with optional additional information to simplify the processing of the coordinates when a more complete definition of the CRS is not needed. In general the attribute srsName points to a CRS instance of gml:AbstractCoordinateReferenceSystem. For well-known references it is not required that the CRS description exists at the location the URI points to. If no srsName attribute is given, the CRS shall be specified as part of the larger context this geometry element is part of.
</documentation>
</annotation>
<attribute name="srsName" type="anyURI"/>
<attribute name="srsDimension" type="positiveInteger"/>
<attributeGroup ref="gml:SRSInformationGroup"/>
</attributeGroup>
So without a specified SRS it is impossible to answer your question, we don't even know what units your coordinates are in.

Related

How can I generate the density information of vehicles in only SUMO?

This is my sumocfg file code in the SUMO program.
<input>
<net-file value="updated.net.xml"/>
<route-files value="trips.trips.xml"/>
</input>
<time>
<begin value="0"/>
</time>
<report>
<verbose value="true"/>
<no-step-log value="true"/>
</report>
updated.net.xml is network file which I write, and trips.trips.xml is just the vehicle mobility file.
In https://sumo.dlr.de/wiki/Simulation/Output/Lane-_or_Edge-based_Traffic_Measures, there is the density information format, but I don't know how can I generate the additional output file including vehicle density information.
What code should I add here?
As it is stated under 'Instantiating within the Simulation', you need to add an additional file under as follows:
<input>
<net-file value = 'xxx'/>
<route-files value = 'xxx'/>
<additional-files value = 'xxx'/>
</input>
In the additional file, add the required edge and lane ids that are to be measured.

MDX Attribute Value Key

I've faced such a problem:
I have a dimension [Project_sales] with one hierarchy [Default] in my cube [Sales_planning_RP].
I've created a custom property for this dimension and named it "Object".
When I created it I was asked for:
1)Property Key
2)Property value
Now I Have Source-table for this dimension with 2 additional fields:
1) [Object_code] ex:('O01') <-This is what I need (see question below)
2) [Object_name] ex: ('Object # 3213, editable') <-This is What I get
But I see only one property in OLAP:
[Project_sales].[Default].CurrentMember.Properties("Object")
Which gives me just Object_name.
So my question is how can I get the key of my property "Object" with MDX?
My dimension properties:
http://i.stack.imgur.com/N2Aej.png
My dimension has the following "parent_child" hierarchy:
Project->Object->Element_of_area
Every element of this hierarchy has as attribute "Object", which can be called in such a way:
[Project_sales].[Default].CurrentMember.Properties("Object")
In the properties window (in my picture) of the attribute "Object" there are 2 properties:
1)keyColumns
2)NameColumns
I repeat: "Object" here is not a member of dimension, it's an attribute!
And it has its own key and name.
I can get its name, but can't understand how to get its key, which is also loaded into cube.
Look at my member_properties list:
image_2
And here is a part of XMLA-code of my dimension to makes things clear:
<Attribute>
<Annotations>
<Annotation>
<Name>TypeOfInformation</Name>
<Value>1</Value>
</Annotation>
<Annotation>
<Name>TypeOfNameInformation</Name>
<Value>1</Value>
</Annotation>
<Annotation>
<Name>P4SSAMOVersion</Name>
<Value>2</Value>
</Annotation>
</Annotations>
<ID>Object</ID>
<Name>Object</Name>
<KeyColumns>
<KeyColumn>
<DataType>WChar</DataType>
<DataSize>40</DataSize>
<Source xsi:type="ColumnBinding">
<TableID>_x0036_Project_sales</TableID>
<ColumnID>Object_code</ColumnID>
</Source>
</KeyColumn>
</KeyColumns>
<NameColumn>
<DataType>WChar</DataType>
<DataSize>255</DataSize>
<Source xsi:type="ColumnBinding">
<TableID>_x0036_Project_sales</TableID>
<ColumnID>Object_name</ColumnID>
</Source>
</NameColumn>
<OrderBy>Key</OrderBy>
<MembersWithData>NonLeafDataHidden</MembersWithData>
<AttributeHierarchyVisible>false</AttributeHierarchyVisible>
</Attribute>
Ok, now it's clear!
There are 3 properties of an Attribute that may contain data:
1)Key
2)Name
3)Value
If Name is not empty and Key is not empty, you get Name when call .Properties() function.
If Name is empty and Key is not empty, you get Key.
Here is the source: https://www.mssqltips.com/sqlservertip/3271/sql-server-analysis-server-ssas-keycolumn-vs-namecolumn-vs-valuecolumn/

How to map specified pattern string into a xml using Mule data mapper

I have requirement to map specified patterned string to xml using data mapper in Mule.
Input payload (String) to Data mapper:
key1:value1,key2:value2
output payload (xml) from Data Mapper:
<control>
<Parameter>
<Key>key1</Key>
<Value>value1</Value>
</Parameter>
<Parameter>
<Key>key2</Key>
<Value>value2</Value>
</Parameter>
</control>
Can someone give me the solution to achieve this using data mapper in mule?
DataMapper has a script view (upper right-hand corner of the DataMapper console).
Create a mapping of the string to the key, then edit the mapping, by default it's written in the Mulee Expression Language. With it you can just split the value in two, and set to output values rathen than one. This will leave only one visual line.
You could also draw to mappings an then split on both, just taking value 0 in one and 1 in the other, this will be represented more beatifully in the visual editor but will perform worse.

Many to one mapping in Mule

Example I have an input xml,
<root>
<first>
<a>2</a>
</first>
<first>
<a>3</a>
</first>
<first>
<a>4</a>
</first>
</root>
That should be mapped to,
<root>
<a>2</a>
<a>3</>
<a>4</a>
</root>
I already have output xsd defined that is derived from second xml above but I don't see the mapping in my target because it is one level.
First xml has 3 level and second one is 2 level. So I could not map the child element mapping.
Look at the Branch tangs in the attached image.
You just need to set a mapping where for each input.first -> for each input.a create a output.a.
This is doine using the element mapping controls at the top center (over the lines).

Quickest method for matching nested XML data against database table structure

I have an application which creates datarequests which can be quite complex. These need to be stored in the database as tables. An outline of a datarequest (as XML) would be...
<datarequest>
<datatask view="vw_ContractData" db="reporting" index="1">
<datefilter modifier="w0">
<filter index="1" datatype="d" column="Contract Date" param1="2009-10-19 12:00:00" param2="2012-09-27 12:00:00" daterange="" operation="Between" />
</datefilter>
<filters>
<alternation index="1">
<filter index="1" datatype="t" column="Department" param1="Stock" param2="" operation="Equals" />
</alternation>
<alternation index="2">
<filter index="1" datatype="t" column="Department" param1="HR" param2="" operation="Equals" />
</alternation>
</filters>
<series column="Turnaround" aggregate="avg" split="0" splitfield="" index="1">
<filters />
</series>
<series column="Requested 3" aggregate="avg" split="0" splitfield="" index="2">
<filters>
<alternation index="1">
<filter index="1" datatype="t" column="Worker" param1="Malcom" param2="" operation="Equals" />
</alternation>
</filters>
</series>
<series column="Requested 2" aggregate="avg" split="0" splitfield="" index="3">
<filters />
</series>
<series column="Reqested" aggregate="avg" split="0" splitfield="" index="4">
<filters />
</series>
</datatask>
</datarequest>
This encodes a datarequest comprising a daterange, main filters, series and series filters. Basically any element which has the index attribute can occur multiple times within its parent element - the exception to this being the filter within datefilter.
But the structure of this is kind of academic, the problem is more fundamental:
When a request comes through, XML like this is sent to SQLServer as a parameter to a stored proc. This XML is shredded into a de-normalised table and then written iteratively to normalised tables such as tblDataRequest (DataRequestID PK), tblDataTask, tblFilter, tblSeries. This is fine.
The problem occurs when I want to match a given XML defintion with one already held in the DB. I currently do this by...
Shredding the XML into a de-normalised table
Using a CTE to pull all the existing data in the database into that same de-normalised form
Matching using a huge WHERE condition (34 lines long)
..This will return me any DataRequestID which exactly matches the XML given. I fear that this method will end up being painfully slow - partly because I don't believe the CTE will do any clever filtering, it will pull all the data every single time before applying the huge WHERE.
I have thought there must be better solutions to this eg
When storing a datarequest, also store a hash of the datarequest somehow and simply match on that. In the case of collision, use the current method. I wanted however to do this using set-logic. And also, I'm concerned about irrelevant small differences in the XML changing the hash - spurious spaces etc.
Somehow perform the matching iteratively from the bottom up. Eg produce a list of filters which match on the lowest level. Use this as part of an IN to match Series. Use this as part of an IN to match DataTasks etc etc. The trouble is, I start to black-out when I think about this for too long.
Basically - Has anyone ever encountered this kind of problem before (they must have). And what would be the recommended route for tackling it? example (pseudo)code would be great :)
To get rid of the possibility of minor variances, I'd run the request through an XML transform (XSLT).
Alternatively, since you've already got the code to parse this out into a denormalized staging table that's fine too. I would then simply using FOR XML to create a new XML doc.
Your goal here is to create a standardized XML document that respects ordering where appropriate and removes inconsistencies where it is not.
Once that is done, store this in a new table. Now you can run a direct comparison of the "standardized" request XML against existing data.
To do the actual comparison, you can use a hash, store the XML as a string and do a direct string comparison, or do a full XML comparison like this: http://beyondrelational.com/modules/2/blogs/28/posts/10317/xquery-lab-36-writing-a-tsql-function-to-compare-two-xml-values-part-2.aspx
My preference, as long as the XML is never over 8000bytes, would be to create a unique string (either VARCHAR(8000) or NVARCHAR(4000) if you have special character support) and create a unique index on the column.