Latitude/Longitude in the Pentaho Analyzer

67 views Asked by At

I have a mondrian scheme with the latitude and longitude for a city:

<Level name="Shop City" visible="true" column="city" type="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never">
          <Annotations>
            <Annotation name="Data.Role">
              <![CDATA[Geography]]>
            </Annotation>
            <Annotation name="Geo.Role">
              <![CDATA[location]]>
            </Annotation>
          </Annotations>
          <Property name="Latitude" column="latitude" type="String">
            <PropertyFormatter>
              <Script language="JavaScript">
                if(propertyValue != null) {
                    return parseFloat(propertyValue).toFixed(6);
                } else {
                    return propertyValue;
                }
              </Script>
            </PropertyFormatter>
          </Property>
          <Property name="Longitude" column="longitude" type="String">
          <PropertyFormatter>
          <Script language="JavaScript">
            if(propertyValue != null) {
                return parseFloat(propertyValue).toFixed(6);
            } else {
                return propertyValue;
            }
          </Script>
        </PropertyFormatter>
          </Property>
        </Level>

The "Dot" on the map get displayed with the latitude and longitude, but the decimals are missing and the "Dot" is not 100% precise (a few km´s off).

The database fields (postgres) are numeric.

How can I display/use the decimals in the lat/long property?

Greetings.

Googled the problem, found the "PropertyFormatter", used ChatGPT without success. Trying to get the decimals of the lat/long´s.

0

There are 0 answers