<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Converting Pixels to Lat/Lon for Floorplan in QlikSense in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Converting-Pixels-to-Lat-Lon-for-Floorplan-in-QlikSense/m-p/1671971#M50831</link>
    <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I have followed Christof in his tutorial of building Office Floor Plans (&lt;A href="https://www.youtube.com/watch?v=4uWlmNm95n8" target="_self"&gt;Qlik Sense Office Floor Plans with native GeoObject&lt;/A&gt;), and is able to replicate his work with Point layer. Now on my dashboard, I would like to switch to a different layer (Layer/Area) instead of (Layer/Point) to draw an area on the map to highlight an item (for e.g. vending machine or table) on the floor plan. I understand that in order to draw an area, we need four coordinates, i.e. [[x,y],[x2,y2],[x3,y3],[x4,y4]]. I have included all four coordinates of the item in a table imported over to the dashboard.&lt;/P&gt;&lt;P&gt;The units for these coordinates are in pixels measured using Irfanview and looks like this:&lt;BR /&gt;Item | X | Y | X2 | Y2 | X3 | Y3 | X4 | Y4&lt;BR /&gt;Table | 30 | 98 | 90 | 100 | 30 | 120 | 90 | 120&lt;BR /&gt;Vending Machine | 1475 | 99 | 1536 | 99 | 1475 | 121 | 1536 | 121&lt;BR /&gt;Using these values, I have defined a new dimension ("Area_Coordinates") that will include these four pairs of values in the following format: "[[x,y],[x2,y2],[x3,y3],[x4,y4]]". Area_Coordinates, the new dimension, will then be placed in the Data of the Area Layer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My background image's current size in pixels is 1570 x 265, and is using the projection of user defined (metres) in map settings as the video defines. However, the problem here is the map projection that I am unable to see anything highlighted. According to the &lt;A href="https://github.com/ChristofSchwarz/qs-GeoObject-BackgroundImg/blob/master/projection.png" target="_self"&gt;image link&lt;/A&gt; in Christof's &lt;A href="https://github.com/ChristofSchwarz/qs-GeoObject-BackgroundImg" target="_self"&gt;Github project link&lt;/A&gt;, I am supposed to convert the coordinates pixel to Lat/Lon projection? I have been trying this conversion in the Area_Coordinates but have been unsuccessful (I cant see any highlighted/coloured box). Does anyone has any good ideas to resolve this?&lt;/P&gt;&lt;P&gt;Some examples of formula I have tried:&lt;BR /&gt;1)&amp;nbsp;//&lt;A href="https://gis.stackexchange.com/questions/228489/how-to-convert-image-pixel-to-latitude-and-longitude" target="_blank"&gt;https://gis.stackexchange.com/questions/228489/how-to-convert-image-pixel-to-latitude-and-longitude&lt;/A&gt;&lt;BR /&gt;//mx = C + px * A&lt;BR /&gt;//my = F + py * D&lt;BR /&gt;='[[' &amp;amp; Round((RangeMax(X,Y)/2 - X/2) * 40075014 / RangeMax(X,Y) - 20037507) &amp;amp; ',' &amp;amp; Round((RangeMax(X,Y)/2 - Y/2) * -40075014 / RangeMax(X,Y) + 20037507) &amp;amp; '],'&lt;BR /&gt;&amp;amp; '[' &amp;amp; Round((RangeMax(X2,Y2)/2 - X2/2) * 40075014 / RangeMax(X2,Y2) - 20037507) &amp;amp; ',' &amp;amp; Round((RangeMax(X2,Y2)/2 - Y2/2) * -40075014 / RangeMax(X2,Y2) + 20037507) &amp;amp; '],'&lt;BR /&gt;&amp;amp; '[' &amp;amp; Round((RangeMax(X3,Y3)/2 - X3/2) * 40075014 / RangeMax(X3,Y3) - 20037507) &amp;amp; ',' &amp;amp; Round((RangeMax(X3,Y3)/2 - Y3/2) * -40075014 / RangeMax(X3,Y3) + 20037507) &amp;amp; '],'&lt;BR /&gt;&amp;amp; '[' &amp;amp; Round((RangeMax(X4,Y4)/2 - X4/2) * 40075014 / RangeMax(X4,Y4) - 20037507) &amp;amp; ',' &amp;amp; Round((RangeMax(X4,Y4)/2 - Y4/2) * -40075014 / RangeMax(X4,Y4) + 20037507) &amp;amp; ']]'&lt;BR /&gt;2)&amp;nbsp;//SET fX2Long = Round((RangeMax($2,$3)/2 - $2/2 + $1) * 40075014 / RangeMax($2,$3) - 20037507);&lt;BR /&gt;//SET fY2Lat = Round((RangeMax($2,$3)/2- $3/2 + $1) * -40075014 / RangeMax($2,$3) + 20037507);&lt;BR /&gt;$(fX2Long(X, vWidth, vHeight))&lt;BR /&gt;$(fY2Lat(Y, vWidth, vHeight))&lt;BR /&gt;='[[' &amp;amp; Round((RangeMax(W,L)/2- L/2 + X) * -40075014 / RangeMax(W,L) + 20037507) &amp;amp; ',' &amp;amp; Round((RangeMax(W,L)/2 - L/2 + Y) * 40075014 / RangeMax(W,L) - 20037507) &amp;amp; '],'&lt;BR /&gt;&amp;amp; '[' &amp;amp; Round((RangeMax(W,L)/2- L/2 + X2) * -40075014 / RangeMax(W,L) + 20037507) &amp;amp; ',' &amp;amp; Round((RangeMax(W,L)/2 - L/2 + Y2) * 40075014 / RangeMax(W,L) - 20037507) &amp;amp; '],'&lt;BR /&gt;&amp;amp; '[' &amp;amp; Round((RangeMax(W,L)/2- L/2 + X3) * -40075014 / RangeMax(W,L) + 20037507) &amp;amp; ',' &amp;amp; Round((RangeMax(W,L)/2 - L/2 + Y3) * 40075014 / RangeMax(W,L) - 20037507) &amp;amp; '],'&lt;BR /&gt;&amp;amp; '[' &amp;amp; Round((RangeMax(W,L)/2- L/2 + X4) * -40075014 / RangeMax(W,L) + 20037507) &amp;amp; ',' &amp;amp; Round((RangeMax(W,L)/2 - L/2 + Y4) * 40075014 / RangeMax(W,L) - 20037507) &amp;amp; ']]'&lt;BR /&gt;3) Adding GeoMakePoint to no. 2 -&amp;nbsp;&lt;BR /&gt;='[[' &amp;amp; GeoMakePoint(Round((RangeMax(W,L)/2- L/2 + X) * -40075014 / RangeMax(W,L) + 20037507), Round((RangeMax(W,L)/2 - L/2 + Y) * 40075014 / RangeMax(W,L) - 20037507)) &amp;amp; '],'&lt;BR /&gt;&amp;amp; '[' &amp;amp; GeoMakePoint(Round((RangeMax(W,L)/2- L/2 + X2) * -40075014 / RangeMax(W,L) + 20037507), Round((RangeMax(W,L)/2 - L/2 + Y2) * 40075014 / RangeMax(W,L) - 20037507)) &amp;amp; '],'&lt;BR /&gt;&amp;amp; '[' &amp;amp; GeoMakePoint(Round((RangeMax(W,L)/2- L/2 + X3) * -40075014 / RangeMax(W,L) + 20037507), Round((RangeMax(W,L)/2 - L/2 + Y3) * 40075014 / RangeMax(W,L) - 20037507)) &amp;amp; '],'&lt;BR /&gt;&amp;amp; '[' &amp;amp; GeoMakePoint(Round((RangeMax(W,L)/2- L/2 + X4) * -40075014 / RangeMax(W,L) + 20037507), Round((RangeMax(W,L)/2 - L/2 + Y4) * 40075014 / RangeMax(W,L) - 20037507)) &amp;amp; ']]'&lt;/P&gt;</description>
    <pubDate>Tue, 04 Feb 2020 07:34:32 GMT</pubDate>
    <dc:creator>edwardlay</dc:creator>
    <dc:date>2020-02-04T07:34:32Z</dc:date>
    <item>
      <title>Converting Pixels to Lat/Lon for Floorplan in QlikSense</title>
      <link>https://community.qlik.com/t5/App-Development/Converting-Pixels-to-Lat-Lon-for-Floorplan-in-QlikSense/m-p/1671971#M50831</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I have followed Christof in his tutorial of building Office Floor Plans (&lt;A href="https://www.youtube.com/watch?v=4uWlmNm95n8" target="_self"&gt;Qlik Sense Office Floor Plans with native GeoObject&lt;/A&gt;), and is able to replicate his work with Point layer. Now on my dashboard, I would like to switch to a different layer (Layer/Area) instead of (Layer/Point) to draw an area on the map to highlight an item (for e.g. vending machine or table) on the floor plan. I understand that in order to draw an area, we need four coordinates, i.e. [[x,y],[x2,y2],[x3,y3],[x4,y4]]. I have included all four coordinates of the item in a table imported over to the dashboard.&lt;/P&gt;&lt;P&gt;The units for these coordinates are in pixels measured using Irfanview and looks like this:&lt;BR /&gt;Item | X | Y | X2 | Y2 | X3 | Y3 | X4 | Y4&lt;BR /&gt;Table | 30 | 98 | 90 | 100 | 30 | 120 | 90 | 120&lt;BR /&gt;Vending Machine | 1475 | 99 | 1536 | 99 | 1475 | 121 | 1536 | 121&lt;BR /&gt;Using these values, I have defined a new dimension ("Area_Coordinates") that will include these four pairs of values in the following format: "[[x,y],[x2,y2],[x3,y3],[x4,y4]]". Area_Coordinates, the new dimension, will then be placed in the Data of the Area Layer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My background image's current size in pixels is 1570 x 265, and is using the projection of user defined (metres) in map settings as the video defines. However, the problem here is the map projection that I am unable to see anything highlighted. According to the &lt;A href="https://github.com/ChristofSchwarz/qs-GeoObject-BackgroundImg/blob/master/projection.png" target="_self"&gt;image link&lt;/A&gt; in Christof's &lt;A href="https://github.com/ChristofSchwarz/qs-GeoObject-BackgroundImg" target="_self"&gt;Github project link&lt;/A&gt;, I am supposed to convert the coordinates pixel to Lat/Lon projection? I have been trying this conversion in the Area_Coordinates but have been unsuccessful (I cant see any highlighted/coloured box). Does anyone has any good ideas to resolve this?&lt;/P&gt;&lt;P&gt;Some examples of formula I have tried:&lt;BR /&gt;1)&amp;nbsp;//&lt;A href="https://gis.stackexchange.com/questions/228489/how-to-convert-image-pixel-to-latitude-and-longitude" target="_blank"&gt;https://gis.stackexchange.com/questions/228489/how-to-convert-image-pixel-to-latitude-and-longitude&lt;/A&gt;&lt;BR /&gt;//mx = C + px * A&lt;BR /&gt;//my = F + py * D&lt;BR /&gt;='[[' &amp;amp; Round((RangeMax(X,Y)/2 - X/2) * 40075014 / RangeMax(X,Y) - 20037507) &amp;amp; ',' &amp;amp; Round((RangeMax(X,Y)/2 - Y/2) * -40075014 / RangeMax(X,Y) + 20037507) &amp;amp; '],'&lt;BR /&gt;&amp;amp; '[' &amp;amp; Round((RangeMax(X2,Y2)/2 - X2/2) * 40075014 / RangeMax(X2,Y2) - 20037507) &amp;amp; ',' &amp;amp; Round((RangeMax(X2,Y2)/2 - Y2/2) * -40075014 / RangeMax(X2,Y2) + 20037507) &amp;amp; '],'&lt;BR /&gt;&amp;amp; '[' &amp;amp; Round((RangeMax(X3,Y3)/2 - X3/2) * 40075014 / RangeMax(X3,Y3) - 20037507) &amp;amp; ',' &amp;amp; Round((RangeMax(X3,Y3)/2 - Y3/2) * -40075014 / RangeMax(X3,Y3) + 20037507) &amp;amp; '],'&lt;BR /&gt;&amp;amp; '[' &amp;amp; Round((RangeMax(X4,Y4)/2 - X4/2) * 40075014 / RangeMax(X4,Y4) - 20037507) &amp;amp; ',' &amp;amp; Round((RangeMax(X4,Y4)/2 - Y4/2) * -40075014 / RangeMax(X4,Y4) + 20037507) &amp;amp; ']]'&lt;BR /&gt;2)&amp;nbsp;//SET fX2Long = Round((RangeMax($2,$3)/2 - $2/2 + $1) * 40075014 / RangeMax($2,$3) - 20037507);&lt;BR /&gt;//SET fY2Lat = Round((RangeMax($2,$3)/2- $3/2 + $1) * -40075014 / RangeMax($2,$3) + 20037507);&lt;BR /&gt;$(fX2Long(X, vWidth, vHeight))&lt;BR /&gt;$(fY2Lat(Y, vWidth, vHeight))&lt;BR /&gt;='[[' &amp;amp; Round((RangeMax(W,L)/2- L/2 + X) * -40075014 / RangeMax(W,L) + 20037507) &amp;amp; ',' &amp;amp; Round((RangeMax(W,L)/2 - L/2 + Y) * 40075014 / RangeMax(W,L) - 20037507) &amp;amp; '],'&lt;BR /&gt;&amp;amp; '[' &amp;amp; Round((RangeMax(W,L)/2- L/2 + X2) * -40075014 / RangeMax(W,L) + 20037507) &amp;amp; ',' &amp;amp; Round((RangeMax(W,L)/2 - L/2 + Y2) * 40075014 / RangeMax(W,L) - 20037507) &amp;amp; '],'&lt;BR /&gt;&amp;amp; '[' &amp;amp; Round((RangeMax(W,L)/2- L/2 + X3) * -40075014 / RangeMax(W,L) + 20037507) &amp;amp; ',' &amp;amp; Round((RangeMax(W,L)/2 - L/2 + Y3) * 40075014 / RangeMax(W,L) - 20037507) &amp;amp; '],'&lt;BR /&gt;&amp;amp; '[' &amp;amp; Round((RangeMax(W,L)/2- L/2 + X4) * -40075014 / RangeMax(W,L) + 20037507) &amp;amp; ',' &amp;amp; Round((RangeMax(W,L)/2 - L/2 + Y4) * 40075014 / RangeMax(W,L) - 20037507) &amp;amp; ']]'&lt;BR /&gt;3) Adding GeoMakePoint to no. 2 -&amp;nbsp;&lt;BR /&gt;='[[' &amp;amp; GeoMakePoint(Round((RangeMax(W,L)/2- L/2 + X) * -40075014 / RangeMax(W,L) + 20037507), Round((RangeMax(W,L)/2 - L/2 + Y) * 40075014 / RangeMax(W,L) - 20037507)) &amp;amp; '],'&lt;BR /&gt;&amp;amp; '[' &amp;amp; GeoMakePoint(Round((RangeMax(W,L)/2- L/2 + X2) * -40075014 / RangeMax(W,L) + 20037507), Round((RangeMax(W,L)/2 - L/2 + Y2) * 40075014 / RangeMax(W,L) - 20037507)) &amp;amp; '],'&lt;BR /&gt;&amp;amp; '[' &amp;amp; GeoMakePoint(Round((RangeMax(W,L)/2- L/2 + X3) * -40075014 / RangeMax(W,L) + 20037507), Round((RangeMax(W,L)/2 - L/2 + Y3) * 40075014 / RangeMax(W,L) - 20037507)) &amp;amp; '],'&lt;BR /&gt;&amp;amp; '[' &amp;amp; GeoMakePoint(Round((RangeMax(W,L)/2- L/2 + X4) * -40075014 / RangeMax(W,L) + 20037507), Round((RangeMax(W,L)/2 - L/2 + Y4) * 40075014 / RangeMax(W,L) - 20037507)) &amp;amp; ']]'&lt;/P&gt;</description>
      <pubDate>Tue, 04 Feb 2020 07:34:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Converting-Pixels-to-Lat-Lon-for-Floorplan-in-QlikSense/m-p/1671971#M50831</guid>
      <dc:creator>edwardlay</dc:creator>
      <dc:date>2020-02-04T07:34:32Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Pixels to Lat/Lon for Floorplan in QlikSense</title>
      <link>https://community.qlik.com/t5/App-Development/Converting-Pixels-to-Lat-Lon-for-Floorplan-in-QlikSense/m-p/1693163#M52994</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I had the same question and I solved it with this script:&lt;/P&gt;&lt;P&gt;Set vWitdh = 1350;&lt;BR /&gt;Set vHeight = 530;&lt;/P&gt;&lt;P&gt;Zone:&lt;BR /&gt;Load&lt;BR /&gt;*,&lt;BR /&gt;'[[' &amp;amp; X1_calc &amp;amp; ',' &amp;amp; Y1_calc &amp;amp; '],[' &amp;amp; X3_calc &amp;amp; ',' &amp;amp; Y3_calc &amp;amp; '],[' &amp;amp; X4_calc &amp;amp; ',' &amp;amp; Y4_calc &amp;amp; '],[' &amp;amp; X2_calc &amp;amp; ',' &amp;amp; Y2_calc &amp;amp; ']]' as Area_Geometry;&lt;BR /&gt;LOAD&lt;BR /&gt;Zone,&lt;BR /&gt;Area,&lt;BR /&gt;X1,&lt;BR /&gt;Round((RangeMax($(vWitdh),$(vHeight))/2 - $(vWitdh)/2 + X1) * 40075014 / RangeMax($(vWitdh),$(vHeight)) - 20037507) as X1_calc,&lt;BR /&gt;Y1,&lt;BR /&gt;Round((RangeMax($(vWitdh),$(vHeight))/2- $(vHeight)/2 + Y1) * -40075014 / RangeMax($(vWitdh),$(vHeight)) + 20037507) as Y1_calc,&lt;BR /&gt;X2,&lt;BR /&gt;Round((RangeMax($(vWitdh),$(vHeight))/2 - $(vWitdh)/2 + X2) * 40075014 / RangeMax($(vWitdh),$(vHeight)) - 20037507) as X2_calc,&lt;BR /&gt;Y2,&lt;BR /&gt;Round((RangeMax($(vWitdh),$(vHeight))/2- $(vHeight)/2 + Y2) * -40075014 / RangeMax($(vWitdh),$(vHeight)) + 20037507) as Y2_calc,&lt;BR /&gt;X3,&lt;BR /&gt;Round((RangeMax($(vWitdh),$(vHeight))/2 - $(vWitdh)/2 + X3) * 40075014 / RangeMax($(vWitdh),$(vHeight)) - 20037507) as X3_calc,&lt;BR /&gt;Y3,&lt;BR /&gt;Round((RangeMax($(vWitdh),$(vHeight))/2- $(vHeight)/2 + Y3) * -40075014 / RangeMax($(vWitdh),$(vHeight)) + 20037507) as Y3_calc,&lt;BR /&gt;X4,&lt;BR /&gt;Round((RangeMax($(vWitdh),$(vHeight))/2 - $(vWitdh)/2 + X4) * 40075014 / RangeMax($(vWitdh),$(vHeight)) - 20037507) as X4_calc,&lt;BR /&gt;Y4,&lt;BR /&gt;Round((RangeMax($(vWitdh),$(vHeight))/2- $(vHeight)/2 + Y4) * -40075014 / RangeMax($(vWitdh),$(vHeight)) + 20037507) as Y4_calc&lt;BR /&gt;FROM [lib://WAG/CustomMaps/SharedWorkspace/sharedworkspace.xlsx]&lt;BR /&gt;(ooxml, embedded labels, table is Area)&lt;BR /&gt;Where&lt;BR /&gt;Corners = 4;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2020 07:44:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Converting-Pixels-to-Lat-Lon-for-Floorplan-in-QlikSense/m-p/1693163#M52994</guid>
      <dc:creator>pwagner</dc:creator>
      <dc:date>2020-04-14T07:44:54Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Pixels to Lat/Lon for Floorplan in QlikSense</title>
      <link>https://community.qlik.com/t5/App-Development/Converting-Pixels-to-Lat-Lon-for-Floorplan-in-QlikSense/m-p/1702917#M53848</link>
      <description>&lt;P&gt;Pwagner, thanks for sharing your solution. This does not actually work for me.&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2020 03:22:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Converting-Pixels-to-Lat-Lon-for-Floorplan-in-QlikSense/m-p/1702917#M53848</guid>
      <dc:creator>edwardlay</dc:creator>
      <dc:date>2020-05-18T03:22:13Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Pixels to Lat/Lon for Floorplan in QlikSense</title>
      <link>https://community.qlik.com/t5/App-Development/Converting-Pixels-to-Lat-Lon-for-Floorplan-in-QlikSense/m-p/1771911#M59754</link>
      <description>&lt;P&gt;In case you did not find any solition - I was struggling with the same problem and could not get it to work. But finally I understood why:&lt;/P&gt;&lt;P&gt;The location field for the Area Layer in the map object will accept coordinates described as:&lt;/P&gt;&lt;P&gt;[[x1,y1],[x2,y2],[x3,y3],[x4,y4]]&lt;/P&gt;&lt;P&gt;however (as I became aware....) that what is longitude and latitude in the map object may not be what you expect. Try to opposite also:&lt;/P&gt;&lt;P&gt;[[y1,x1],[y2,x2],[y3,x3],[y4,x4]]&lt;/P&gt;&lt;P&gt;/Robert&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2021 13:22:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Converting-Pixels-to-Lat-Lon-for-Floorplan-in-QlikSense/m-p/1771911#M59754</guid>
      <dc:creator>RSvebeck</dc:creator>
      <dc:date>2021-01-05T13:22:17Z</dc:date>
    </item>
  </channel>
</rss>

