<?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 Re: Adding x and y offset to a Point in Qt Maps SDK Questions</title>
    <link>https://community.esri.com/t5/qt-maps-sdk-questions/adding-x-and-y-offset-to-a-point/m-p/1336914#M5098</link>
    <description>&lt;P&gt;Could you give me an example using this method with Qml? I want to define a function&amp;nbsp;that enables a point to be shifted 2km to the north.&amp;nbsp;But the return value of the function&amp;nbsp;is a empty list.&amp;nbsp;&lt;/P&gt;&lt;P&gt;function addNewPoint() {&lt;BR /&gt;var refPointList = [];&lt;BR /&gt;var refPoint = ArcGISRuntimeEnvironment.createObject("Point", {&lt;BR /&gt;x: centerX,&lt;BR /&gt;y: centerY,&lt;BR /&gt;spatialReference: viewPointCenter.spatialReference});&lt;BR /&gt;refPointList.push(refPoint);&lt;BR /&gt;console.log(refPointList);&lt;BR /&gt;var newPointList = GeometryEngine.moveGeodetic(refPointList, 2, linearUnitKm,&lt;BR /&gt;0, angularUnit, Enums.GeodeticCurveTypeGeodesic);&lt;BR /&gt;console.log("newPointList=",newPointList);&lt;BR /&gt;polylineBuilderAddNewPoint.addPoint(newPointList[0]);&lt;BR /&gt;var graphic = ArcGISRuntimeEnvironment.createObject("Graphic", {&lt;BR /&gt;geometry: polylineBuilderAddNewPoint.geometry,&lt;BR /&gt;});&lt;BR /&gt;graphicsOverlayAddNewPoint.graphics.append(graphic);&lt;BR /&gt;}&lt;/P&gt;</description>
    <pubDate>Wed, 11 Oct 2023 13:59:35 GMT</pubDate>
    <dc:creator>lsc</dc:creator>
    <dc:date>2023-10-11T13:59:35Z</dc:date>
    <item>
      <title>Adding x and y offset to a Point</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/adding-x-and-y-offset-to-a-point/m-p/1116747#M4458</link>
      <description>&lt;P&gt;I want to obtain a new Point (geodetic) by adding x and y offset (in meters) to another Point. Is there any class or function to do that like in the case of GeodeticDistanceResult?&lt;/P&gt;</description>
      <pubDate>Mon, 15 Nov 2021 07:07:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/adding-x-and-y-offset-to-a-point/m-p/1116747#M4458</guid>
      <dc:creator>FatmaAkdemir</dc:creator>
      <dc:date>2021-11-15T07:07:42Z</dc:date>
    </item>
    <item>
      <title>Re: Adding x and y offset to a Point</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/adding-x-and-y-offset-to-a-point/m-p/1116818#M4460</link>
      <description>&lt;DIV&gt;&lt;SPAN&gt;Hi Fatma - thank you for your message.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;Yes, you can create a new point by applying an offset to an existing point using the &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/qt/cpp/api-reference/esri-arcgisruntime-geometryengine.html#moveGeodetic" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;GeometryEngine::moveGeodetic&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;method (or &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/qt/qml/api-reference/qml-esri-arcgisruntime-geometryengine.html#moveGeodetic-method" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;GeometryEngine.moveGeodetic&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;method using Qml). This allows you to offset a point/points by a specified distance and azimuth.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;If you would like to apply an offset in the x and y directions, you could use the&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;EM&gt;moveGeodetic&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;method twice, once in the x-direction and then again in the y-direction. Please find an example of this using the C++ api below, where:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;An initial point &lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;initialPoint&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;is created.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;initialPoint&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;is converted from a&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;EM&gt;&lt;SPAN&gt;Point&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;object into a &lt;/SPAN&gt;&lt;EM&gt;&lt;SPAN&gt;QList&amp;lt;Point&amp;gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;called &lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;SPAN&gt;initialPointList&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;for compatability with the &lt;/SPAN&gt;&lt;EM&gt;&lt;SPAN&gt;GeometryEngine::moveGeodetic&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;method arguments.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;initialPointList&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;is offset by 1000m in the y-direction to create a new &lt;/SPAN&gt;&lt;SPAN&gt;&lt;EM&gt;QList&amp;lt;Point&amp;gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;called &lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;SPAN&gt;yOffsetPoint&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;&lt;STRONG&gt;yOffsetPoint&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;is offset by 500m in the x-direction to create a new &lt;/SPAN&gt;&lt;SPAN&gt;&lt;EM&gt;QList&amp;lt;Point&amp;gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;called &lt;/SPAN&gt;&lt;SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;offsetPointList&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;The offset point is converted from the &lt;SPAN&gt;&lt;EM&gt;QList&amp;lt;Point&amp;gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;into a &lt;EM&gt;P&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;EM&gt;oint&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;called &lt;/SPAN&gt;&lt;SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;offsetPoint&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;// Define initial point.
Point initialPoint(7.65851, 45.97661, SpatialReference::wgs84());

// Apply 1000m offset in the y-direction (i.e. azimuth = 0 deg).
QList&amp;lt;Point&amp;gt; initialPointList{initialPoint};
QList&amp;lt;Point&amp;gt; yOffsetPoint = GeometryEngine::moveGeodetic(initialPointList, 1000, LinearUnit::meters(), 0.0f, AngularUnit::degrees(), GeodeticCurveType::GreatElliptic);

// Apply 500m offset in the x-direction (i.e. azimuth = 90 deg).
QList&amp;lt;Point&amp;gt; offsetPointList = GeometryEngine::moveGeodetic(yOffsetPoint, 500, LinearUnit::meters(), 90.0f, AngularUnit::degrees(), GeodeticCurveType::GreatElliptic);

// Convert offsetPointList from QList&amp;lt;Point&amp;gt; to Point.
Point offsetPoint = offsetPointList.at(0);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;I hope this helps you achieve your desired result. Let us know if we can provide you with any further information.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 15 Nov 2021 12:30:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/adding-x-and-y-offset-to-a-point/m-p/1116818#M4460</guid>
      <dc:creator>AndrewBladon</dc:creator>
      <dc:date>2021-11-15T12:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: Adding x and y offset to a Point</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/adding-x-and-y-offset-to-a-point/m-p/1116820#M4461</link>
      <description>&lt;P&gt;Thank you very much &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/524044"&gt;@AndrewBladon&lt;/a&gt; !&amp;nbsp; I guess I have overlooked this method of GeometryEngine.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Nov 2021 12:38:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/adding-x-and-y-offset-to-a-point/m-p/1116820#M4461</guid>
      <dc:creator>FatmaAkdemir</dc:creator>
      <dc:date>2021-11-15T12:38:27Z</dc:date>
    </item>
    <item>
      <title>Re: Adding x and y offset to a Point</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/adding-x-and-y-offset-to-a-point/m-p/1336914#M5098</link>
      <description>&lt;P&gt;Could you give me an example using this method with Qml? I want to define a function&amp;nbsp;that enables a point to be shifted 2km to the north.&amp;nbsp;But the return value of the function&amp;nbsp;is a empty list.&amp;nbsp;&lt;/P&gt;&lt;P&gt;function addNewPoint() {&lt;BR /&gt;var refPointList = [];&lt;BR /&gt;var refPoint = ArcGISRuntimeEnvironment.createObject("Point", {&lt;BR /&gt;x: centerX,&lt;BR /&gt;y: centerY,&lt;BR /&gt;spatialReference: viewPointCenter.spatialReference});&lt;BR /&gt;refPointList.push(refPoint);&lt;BR /&gt;console.log(refPointList);&lt;BR /&gt;var newPointList = GeometryEngine.moveGeodetic(refPointList, 2, linearUnitKm,&lt;BR /&gt;0, angularUnit, Enums.GeodeticCurveTypeGeodesic);&lt;BR /&gt;console.log("newPointList=",newPointList);&lt;BR /&gt;polylineBuilderAddNewPoint.addPoint(newPointList[0]);&lt;BR /&gt;var graphic = ArcGISRuntimeEnvironment.createObject("Graphic", {&lt;BR /&gt;geometry: polylineBuilderAddNewPoint.geometry,&lt;BR /&gt;});&lt;BR /&gt;graphicsOverlayAddNewPoint.graphics.append(graphic);&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2023 13:59:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/adding-x-and-y-offset-to-a-point/m-p/1336914#M5098</guid>
      <dc:creator>lsc</dc:creator>
      <dc:date>2023-10-11T13:59:35Z</dc:date>
    </item>
    <item>
      <title>Re: Adding x and y offset to a Point</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/adding-x-and-y-offset-to-a-point/m-p/1338599#M5114</link>
      <description>&lt;P&gt;Here is some sample code I put together that moves the point and displays a graphic at the new point&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;ApplicationWindow {
    id: appWindow
    width: 800
    height: 600
    title: "Untitled172"

    // add a mapView component
    MapView {
        id: mv
        anchors.fill: parent
        // set focus to enable keyboard navigation
        focus: true

        // add a map to the mapview
        Map {
            // add the ArcGISStreets basemap to the map
            initBasemapStyle: Enums.BasemapStyleArcGISStreets

            initialViewpoint: ViewpointExtent {
                extent: Envelope {
                    id: env
                    json: {"spatialReference":{"latestWkid":3857,"wkid":102100},"xmax":-13013797.089479687,"xmin":-13034963.75614633,"ymax":4036739.5261344,"ymin":4020864.5261344174}
                }
            }
        }

        GraphicsOverlay {
            id: graphicsOverlayAddNewPoint

            Graphic {
                geometry: Point {
                    x: -117
                    y: 34
                    spatialReference: SpatialReference {wkid: 4326}
                }
                symbol: SimpleMarkerSymbol {
                    color: "red"
                }
            }
        }

        Component.onCompleted: {
            movePoint()
        }

        function movePoint() {
            var refPointList = [];
            var refPoint = ArcGISRuntimeEnvironment.createObject("Point", {
                                                                     x: -117,
                                                                     y: 34,
                                                                     spatialReference: Factory.SpatialReference.createWgs84()});
            refPointList.push(refPoint);

            var linearUnit = ArcGISRuntimeEnvironment.createObject("LinearUnit", {linearUnitId: Enums.LinearUnitIdKilometers});
            var angularUnit = ArcGISRuntimeEnvironment.createObject("AngularUnit", {angularUnitId: Enums.AngularUnitIdDegrees});

            var movedPoints = GeometryEngine.moveGeodetic(refPointList, 2, linearUnit,
                                                           0, angularUnit, Enums.GeodeticCurveTypeGeodesic);

            var graphic = ArcGISRuntimeEnvironment.createObject("Graphic", {
                                                                    geometry: movedPoints[0],
                                                                    symbol: ArcGISRuntimeEnvironment.createObject("SimpleMarkerSymbol", {color: "purple"})
                                                                });
            graphicsOverlayAddNewPoint.graphics.append(graphic);
        }
    }
}&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 17 Oct 2023 14:00:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/adding-x-and-y-offset-to-a-point/m-p/1338599#M5114</guid>
      <dc:creator>LucasDanzinger</dc:creator>
      <dc:date>2023-10-17T14:00:05Z</dc:date>
    </item>
    <item>
      <title>Re: Adding x and y offset to a Point</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/adding-x-and-y-offset-to-a-point/m-p/1340263#M5118</link>
      <description>&lt;P&gt;Thank you very much!&lt;/P&gt;</description>
      <pubDate>Sat, 21 Oct 2023 06:38:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/adding-x-and-y-offset-to-a-point/m-p/1340263#M5118</guid>
      <dc:creator>lsc</dc:creator>
      <dc:date>2023-10-21T06:38:01Z</dc:date>
    </item>
  </channel>
</rss>

