Skip to main content
One tag added, Content structured
Source Link
Taras
  • 34k
  • 4
  • 73
  • 148

I need to change the position of a box only if it has a common attribute with a point. In my example if the feature ID_PARENT"ID_PARENT" is the same as CODE"CODE".

box = QgsProject.instance().mapLayersByName('box')[0]
point = QgsProject.instance().mapLayersByName('point')[0]

for bFeat in boiteFeature:
    for pfeat in pointFeature:
        if bfeat['ID_PARENT'] == pfeat['CODE']:
        pfeat.geometry() = bfeat.geometry()
box = QgsProject.instance().mapLayersByName('box')[0]
point = QgsProject.instance().mapLayersByName('point')[0]

for bfeat in box.getFeatures():
    for pfeat in point.getFeatures():
        if bfeat['ID_PARENT'] == pfeat['CODE']:
            pfeat.geometry() = bfeat.geometry()

Here this code is totally false because I'm assigning a value to a function call but I think it illustrates well what I tried to do which is changing the WKT coordinate.

I need to change the position of a box only if it has a common attribute with a point. In my example if the feature ID_PARENT is the same as CODE.

box = QgsProject.instance().mapLayersByName('box')[0]
point = QgsProject.instance().mapLayersByName('point')[0]

for bFeat in boiteFeature:
    for pfeat in pointFeature:
        if bfeat['ID_PARENT'] == pfeat['CODE']:
        pfeat.geometry() = bfeat.geometry()

Here this code is totally false because I'm assigning a value to a function call but I think it illustrates well what I tried to do which is changing the WKT coordinate.

I need to change the position of a box only if it has a common attribute with a point. In my example if the feature "ID_PARENT" is the same as "CODE".

box = QgsProject.instance().mapLayersByName('box')[0]
point = QgsProject.instance().mapLayersByName('point')[0]

for bfeat in box.getFeatures():
    for pfeat in point.getFeatures():
        if bfeat['ID_PARENT'] == pfeat['CODE']:
            pfeat.geometry() = bfeat.geometry()

Here this code is totally false because I'm assigning a value to a function call but I think it illustrates well what I tried to do which is changing the WKT coordinate.

Tweeted twitter.com/StackGIS/status/1392313761567068160
edited tags
Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345

How to change the Changing coordinate of a point using its WKT? and PyQGIS

English usage
Source Link
Vince
  • 20.3k
  • 16
  • 48
  • 65

How to change the coordinatcoordinate of a point using its WKT?

I need to change the position of a box only if it has a common attribute with a point. In my exempleexample if the feature ID_PARENT is the same as CODE.

box = QgsProject.instance().mapLayersByName('box')[0]
point = QgsProject.instance().mapLayersByName('point')[0]

for bFeat in boiteFeature:
    for pfeat in pointFeature:
        if bfeat['ID_PARENT'] == pfeat['CODE']:
        pfeat.geometry() = bfeat.geometry()

Here this code is totally false because I'm assigning a value to a function call but I think it illustrates well what I tried to do which is changing the WKT coordinate.

How to change the coordinat of a point using its WKT?

I need to change the position of a box only if it has a common attribute with a point. In my exemple if the feature ID_PARENT is the same as CODE.

box = QgsProject.instance().mapLayersByName('box')[0]
point = QgsProject.instance().mapLayersByName('point')[0]

for bFeat in boiteFeature:
    for pfeat in pointFeature:
        if bfeat['ID_PARENT'] == pfeat['CODE']:
        pfeat.geometry() = bfeat.geometry()

Here this code is totally false because I'm assigning a value to a function call but I think it illustrates well what I tried to do which is changing the WKT coordinate.

How to change the coordinate of a point using its WKT?

I need to change the position of a box only if it has a common attribute with a point. In my example if the feature ID_PARENT is the same as CODE.

box = QgsProject.instance().mapLayersByName('box')[0]
point = QgsProject.instance().mapLayersByName('point')[0]

for bFeat in boiteFeature:
    for pfeat in pointFeature:
        if bfeat['ID_PARENT'] == pfeat['CODE']:
        pfeat.geometry() = bfeat.geometry()

Here this code is totally false because I'm assigning a value to a function call but I think it illustrates well what I tried to do which is changing the WKT coordinate.

added 2 characters in body
Source Link
Kadir Şahbaz
  • 78k
  • 57
  • 257
  • 404
Loading
Source Link
Cinouna
  • 135
  • 6
Loading