Got Pacman instead of circle when buffering point QGIS 2.14 standalone C++ application The Next CEO of Stack OverflowCan I “undo” buffering of a point layer in QGIS?Standalone QGIS application - handling QgsVectorLayer load errorsHow to develop C++ standalone QGIS C++ ApplicationQGIS Standalone C++ Application with Qt: “The program has unexpectedly finished”OpenStreetMap heavily pixellated when loaded in QGIS and standalone applicationStandalone QGIS application in C++How to use QGIS plugins functionality in standalone applicationProblems with layer labeling QGIS standalone C++ applicationzoomScale() doesn't work in QGIS 2.14 standalone c++ applicationQGIS 2.14 c++ standalone application crashes using QgsMapToolIdentify
"and that skill is always a class skill for you" - does "always" have any meaning in Pathfinder?
Why didn't Khan get resurrected in the Genesis Explosion?
Why don't programming languages automatically manage the synchronous/asynchronous problem?
Help understanding this unsettling image of Titan, Epimetheus, and Saturn's rings?
If a black hole is created from light, can this black hole then move at speed of light?
Would this house-rule that treats advantage as a +1 to the roll instead (and disadvantage as -1) and allows them to stack be balanced?
What benefits would be gained by using human laborers instead of drones in deep sea mining?
Why did we only see the N-1 starfighters in one film?
What's the best way to handle refactoring a big file?
What happens if you roll doubles 3 times then land on "Go to jail?"
Why is the US ranked as #45 in Press Freedom ratings, despite its extremely permissive free speech laws?
Different harmonic changes implied by a simple descending scale
How to count occurrences of text in a file?
What does "Its cash flow is deeply negative" mean?
If/When UK leaves the EU, can a future goverment conduct a referendum to join the EU?
SOQL: Aggregate, Grouping By and WHERE Clauses not working
FBX seems to be empty when imported into Blender
A "random" question: usage of "random" as adjective in Spanish
How do scammers retract money, while you can’t?
multiple labels for a single equation
Is HostGator storing my password in plaintext?
Extending anchors in TikZ
Non-deterministic sum of floats
How should I support this large drywall patch?
Got Pacman instead of circle when buffering point QGIS 2.14 standalone C++ application
The Next CEO of Stack OverflowCan I “undo” buffering of a point layer in QGIS?Standalone QGIS application - handling QgsVectorLayer load errorsHow to develop C++ standalone QGIS C++ ApplicationQGIS Standalone C++ Application with Qt: “The program has unexpectedly finished”OpenStreetMap heavily pixellated when loaded in QGIS and standalone applicationStandalone QGIS application in C++How to use QGIS plugins functionality in standalone applicationProblems with layer labeling QGIS standalone C++ applicationzoomScale() doesn't work in QGIS 2.14 standalone c++ applicationQGIS 2.14 c++ standalone application crashes using QgsMapToolIdentify
QgsVectorLayer *circleLayer = new QgsVectorLayer("Polygon", "Circle", "memory");
QgsFeature circleFeature = QgsFeature();
circleFeature.setGeometry(QgsGeometry::fromPoint(geometryPoint)->buffer(10000,20));
QgsVectorDataProvider *circleDataProvider = circleLayer->dataProvider();
QgsFeatureList circleFeatureList = QgsFeatureList();
circleFeatureList.append(circleFeature);
if(!circleDataProvider->addFeatures(circleFeatureList))
qDebug()<<"Error adding feature!";
return;
circleLayer->updateExtents();
QgsSingleSymbolRendererV2 *circleLayerRenderer = new QgsSingleSymbolRendererV2(QgsSymbolV2::defaultSymbol(circleLayer->geometryType()));
circleLayer->setRendererV2(circleLayerRenderer);
QgsMapLayerRegistry::instance()->addMapLayer(circleLayer, TRUE);
mainLayerSet.push_front(circleLayer);
mpMapCanvas->setLayerSet(mainLayerSet);
mpMapCanvas->refresh();
mpMapCanvas->zoomToFullExtent();
makes Pacman (cuts off last segment of circle) instead of circle in my standalone application. Is this a way to fix this?
qgis buffer c++ qt circle
add a comment |
QgsVectorLayer *circleLayer = new QgsVectorLayer("Polygon", "Circle", "memory");
QgsFeature circleFeature = QgsFeature();
circleFeature.setGeometry(QgsGeometry::fromPoint(geometryPoint)->buffer(10000,20));
QgsVectorDataProvider *circleDataProvider = circleLayer->dataProvider();
QgsFeatureList circleFeatureList = QgsFeatureList();
circleFeatureList.append(circleFeature);
if(!circleDataProvider->addFeatures(circleFeatureList))
qDebug()<<"Error adding feature!";
return;
circleLayer->updateExtents();
QgsSingleSymbolRendererV2 *circleLayerRenderer = new QgsSingleSymbolRendererV2(QgsSymbolV2::defaultSymbol(circleLayer->geometryType()));
circleLayer->setRendererV2(circleLayerRenderer);
QgsMapLayerRegistry::instance()->addMapLayer(circleLayer, TRUE);
mainLayerSet.push_front(circleLayer);
mpMapCanvas->setLayerSet(mainLayerSet);
mpMapCanvas->refresh();
mpMapCanvas->zoomToFullExtent();
makes Pacman (cuts off last segment of circle) instead of circle in my standalone application. Is this a way to fix this?
qgis buffer c++ qt circle
Have you tried to add the vector layer without set a layer renderer ?
– J. Monticolo
yesterday
yes, same result.
– Wolf Schulz
yesterday
What are your CRS, units ?
– J. Monticolo
yesterday
EPSG:3857, meters. Tested on EPSG:4326 with degrees, no difference.
– Wolf Schulz
yesterday
add a comment |
QgsVectorLayer *circleLayer = new QgsVectorLayer("Polygon", "Circle", "memory");
QgsFeature circleFeature = QgsFeature();
circleFeature.setGeometry(QgsGeometry::fromPoint(geometryPoint)->buffer(10000,20));
QgsVectorDataProvider *circleDataProvider = circleLayer->dataProvider();
QgsFeatureList circleFeatureList = QgsFeatureList();
circleFeatureList.append(circleFeature);
if(!circleDataProvider->addFeatures(circleFeatureList))
qDebug()<<"Error adding feature!";
return;
circleLayer->updateExtents();
QgsSingleSymbolRendererV2 *circleLayerRenderer = new QgsSingleSymbolRendererV2(QgsSymbolV2::defaultSymbol(circleLayer->geometryType()));
circleLayer->setRendererV2(circleLayerRenderer);
QgsMapLayerRegistry::instance()->addMapLayer(circleLayer, TRUE);
mainLayerSet.push_front(circleLayer);
mpMapCanvas->setLayerSet(mainLayerSet);
mpMapCanvas->refresh();
mpMapCanvas->zoomToFullExtent();
makes Pacman (cuts off last segment of circle) instead of circle in my standalone application. Is this a way to fix this?
qgis buffer c++ qt circle
QgsVectorLayer *circleLayer = new QgsVectorLayer("Polygon", "Circle", "memory");
QgsFeature circleFeature = QgsFeature();
circleFeature.setGeometry(QgsGeometry::fromPoint(geometryPoint)->buffer(10000,20));
QgsVectorDataProvider *circleDataProvider = circleLayer->dataProvider();
QgsFeatureList circleFeatureList = QgsFeatureList();
circleFeatureList.append(circleFeature);
if(!circleDataProvider->addFeatures(circleFeatureList))
qDebug()<<"Error adding feature!";
return;
circleLayer->updateExtents();
QgsSingleSymbolRendererV2 *circleLayerRenderer = new QgsSingleSymbolRendererV2(QgsSymbolV2::defaultSymbol(circleLayer->geometryType()));
circleLayer->setRendererV2(circleLayerRenderer);
QgsMapLayerRegistry::instance()->addMapLayer(circleLayer, TRUE);
mainLayerSet.push_front(circleLayer);
mpMapCanvas->setLayerSet(mainLayerSet);
mpMapCanvas->refresh();
mpMapCanvas->zoomToFullExtent();
makes Pacman (cuts off last segment of circle) instead of circle in my standalone application. Is this a way to fix this?
qgis buffer c++ qt circle
qgis buffer c++ qt circle
edited yesterday
Vince
14.8k32849
14.8k32849
asked yesterday
Wolf SchulzWolf Schulz
635
635
Have you tried to add the vector layer without set a layer renderer ?
– J. Monticolo
yesterday
yes, same result.
– Wolf Schulz
yesterday
What are your CRS, units ?
– J. Monticolo
yesterday
EPSG:3857, meters. Tested on EPSG:4326 with degrees, no difference.
– Wolf Schulz
yesterday
add a comment |
Have you tried to add the vector layer without set a layer renderer ?
– J. Monticolo
yesterday
yes, same result.
– Wolf Schulz
yesterday
What are your CRS, units ?
– J. Monticolo
yesterday
EPSG:3857, meters. Tested on EPSG:4326 with degrees, no difference.
– Wolf Schulz
yesterday
Have you tried to add the vector layer without set a layer renderer ?
– J. Monticolo
yesterday
Have you tried to add the vector layer without set a layer renderer ?
– J. Monticolo
yesterday
yes, same result.
– Wolf Schulz
yesterday
yes, same result.
– Wolf Schulz
yesterday
What are your CRS, units ?
– J. Monticolo
yesterday
What are your CRS, units ?
– J. Monticolo
yesterday
EPSG:3857, meters. Tested on EPSG:4326 with degrees, no difference.
– Wolf Schulz
yesterday
EPSG:3857, meters. Tested on EPSG:4326 with degrees, no difference.
– Wolf Schulz
yesterday
add a comment |
2 Answers
2
active
oldest
votes
I am working on QGIS 3.6, I've translated your code in Python 3 (few changes from PyQgis 2.x, for example fromPoint, QgsPoint and QgsMapLayerRegistry.instance()) and it's working perfectly :
circleLayer = QgsVectorLayer("Polygon?crs=epsg:3857", "Circle", "memory")
circleFeature = QgsFeature()
circleFeature.setGeometry(QgsGeometry.fromPointXY(QgsPointXY(1000, 1000)).buffer(10000, 20))
circleDataProvider = circleLayer.dataProvider()
if not circleDataProvider.addFeature(circleFeature):
raise Exception("Error adding feature!")
else:
QgsProject.instance().addMapLayer(circleLayer, True)
Can you try this in your QGIS installation with the few code modification ?
I've tried to do this before and it really works fine in QGIS Desktop application.
– Wolf Schulz
yesterday
I have few ideas left : that the first and last pair of coordinates ofQgsGeometry.fromPointXY(QgsPointXY(1000, 1000)).buffer(10000, 20).asWkt()are the same,circleLayer.getFeature(1).geometry().asWkt()equalsQgsGeometry.fromPointXY(QgsPointXY(1000, 1000)).buffer(10000, 20).asWkt(), and finally, is there working on an updated version of QGIS, like 2.18 if you want to stay in 2.x versions ?
– J. Monticolo
yesterday
add a comment |
Found what is the reason of this issue. moveVertex() function makes this cut and didn't work. How can I make circle move to other coordinates?
Thank you for the follow up but add the complete code in your original post, mostly the buggy part withmoveVertex()function. You make a buffer from thegeometryPointobject, if you want to move the buffer, a solution is to modify the coordinates ofgeometryPoint.
– J. Monticolo
11 hours ago
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "79"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f317016%2fgot-pacman-instead-of-circle-when-buffering-point-qgis-2-14-standalone-c-appli%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
I am working on QGIS 3.6, I've translated your code in Python 3 (few changes from PyQgis 2.x, for example fromPoint, QgsPoint and QgsMapLayerRegistry.instance()) and it's working perfectly :
circleLayer = QgsVectorLayer("Polygon?crs=epsg:3857", "Circle", "memory")
circleFeature = QgsFeature()
circleFeature.setGeometry(QgsGeometry.fromPointXY(QgsPointXY(1000, 1000)).buffer(10000, 20))
circleDataProvider = circleLayer.dataProvider()
if not circleDataProvider.addFeature(circleFeature):
raise Exception("Error adding feature!")
else:
QgsProject.instance().addMapLayer(circleLayer, True)
Can you try this in your QGIS installation with the few code modification ?
I've tried to do this before and it really works fine in QGIS Desktop application.
– Wolf Schulz
yesterday
I have few ideas left : that the first and last pair of coordinates ofQgsGeometry.fromPointXY(QgsPointXY(1000, 1000)).buffer(10000, 20).asWkt()are the same,circleLayer.getFeature(1).geometry().asWkt()equalsQgsGeometry.fromPointXY(QgsPointXY(1000, 1000)).buffer(10000, 20).asWkt(), and finally, is there working on an updated version of QGIS, like 2.18 if you want to stay in 2.x versions ?
– J. Monticolo
yesterday
add a comment |
I am working on QGIS 3.6, I've translated your code in Python 3 (few changes from PyQgis 2.x, for example fromPoint, QgsPoint and QgsMapLayerRegistry.instance()) and it's working perfectly :
circleLayer = QgsVectorLayer("Polygon?crs=epsg:3857", "Circle", "memory")
circleFeature = QgsFeature()
circleFeature.setGeometry(QgsGeometry.fromPointXY(QgsPointXY(1000, 1000)).buffer(10000, 20))
circleDataProvider = circleLayer.dataProvider()
if not circleDataProvider.addFeature(circleFeature):
raise Exception("Error adding feature!")
else:
QgsProject.instance().addMapLayer(circleLayer, True)
Can you try this in your QGIS installation with the few code modification ?
I've tried to do this before and it really works fine in QGIS Desktop application.
– Wolf Schulz
yesterday
I have few ideas left : that the first and last pair of coordinates ofQgsGeometry.fromPointXY(QgsPointXY(1000, 1000)).buffer(10000, 20).asWkt()are the same,circleLayer.getFeature(1).geometry().asWkt()equalsQgsGeometry.fromPointXY(QgsPointXY(1000, 1000)).buffer(10000, 20).asWkt(), and finally, is there working on an updated version of QGIS, like 2.18 if you want to stay in 2.x versions ?
– J. Monticolo
yesterday
add a comment |
I am working on QGIS 3.6, I've translated your code in Python 3 (few changes from PyQgis 2.x, for example fromPoint, QgsPoint and QgsMapLayerRegistry.instance()) and it's working perfectly :
circleLayer = QgsVectorLayer("Polygon?crs=epsg:3857", "Circle", "memory")
circleFeature = QgsFeature()
circleFeature.setGeometry(QgsGeometry.fromPointXY(QgsPointXY(1000, 1000)).buffer(10000, 20))
circleDataProvider = circleLayer.dataProvider()
if not circleDataProvider.addFeature(circleFeature):
raise Exception("Error adding feature!")
else:
QgsProject.instance().addMapLayer(circleLayer, True)
Can you try this in your QGIS installation with the few code modification ?
I am working on QGIS 3.6, I've translated your code in Python 3 (few changes from PyQgis 2.x, for example fromPoint, QgsPoint and QgsMapLayerRegistry.instance()) and it's working perfectly :
circleLayer = QgsVectorLayer("Polygon?crs=epsg:3857", "Circle", "memory")
circleFeature = QgsFeature()
circleFeature.setGeometry(QgsGeometry.fromPointXY(QgsPointXY(1000, 1000)).buffer(10000, 20))
circleDataProvider = circleLayer.dataProvider()
if not circleDataProvider.addFeature(circleFeature):
raise Exception("Error adding feature!")
else:
QgsProject.instance().addMapLayer(circleLayer, True)
Can you try this in your QGIS installation with the few code modification ?
answered yesterday
J. MonticoloJ. Monticolo
1,191217
1,191217
I've tried to do this before and it really works fine in QGIS Desktop application.
– Wolf Schulz
yesterday
I have few ideas left : that the first and last pair of coordinates ofQgsGeometry.fromPointXY(QgsPointXY(1000, 1000)).buffer(10000, 20).asWkt()are the same,circleLayer.getFeature(1).geometry().asWkt()equalsQgsGeometry.fromPointXY(QgsPointXY(1000, 1000)).buffer(10000, 20).asWkt(), and finally, is there working on an updated version of QGIS, like 2.18 if you want to stay in 2.x versions ?
– J. Monticolo
yesterday
add a comment |
I've tried to do this before and it really works fine in QGIS Desktop application.
– Wolf Schulz
yesterday
I have few ideas left : that the first and last pair of coordinates ofQgsGeometry.fromPointXY(QgsPointXY(1000, 1000)).buffer(10000, 20).asWkt()are the same,circleLayer.getFeature(1).geometry().asWkt()equalsQgsGeometry.fromPointXY(QgsPointXY(1000, 1000)).buffer(10000, 20).asWkt(), and finally, is there working on an updated version of QGIS, like 2.18 if you want to stay in 2.x versions ?
– J. Monticolo
yesterday
I've tried to do this before and it really works fine in QGIS Desktop application.
– Wolf Schulz
yesterday
I've tried to do this before and it really works fine in QGIS Desktop application.
– Wolf Schulz
yesterday
I have few ideas left : that the first and last pair of coordinates of
QgsGeometry.fromPointXY(QgsPointXY(1000, 1000)).buffer(10000, 20).asWkt() are the same, circleLayer.getFeature(1).geometry().asWkt() equals QgsGeometry.fromPointXY(QgsPointXY(1000, 1000)).buffer(10000, 20).asWkt(), and finally, is there working on an updated version of QGIS, like 2.18 if you want to stay in 2.x versions ?– J. Monticolo
yesterday
I have few ideas left : that the first and last pair of coordinates of
QgsGeometry.fromPointXY(QgsPointXY(1000, 1000)).buffer(10000, 20).asWkt() are the same, circleLayer.getFeature(1).geometry().asWkt() equals QgsGeometry.fromPointXY(QgsPointXY(1000, 1000)).buffer(10000, 20).asWkt(), and finally, is there working on an updated version of QGIS, like 2.18 if you want to stay in 2.x versions ?– J. Monticolo
yesterday
add a comment |
Found what is the reason of this issue. moveVertex() function makes this cut and didn't work. How can I make circle move to other coordinates?
Thank you for the follow up but add the complete code in your original post, mostly the buggy part withmoveVertex()function. You make a buffer from thegeometryPointobject, if you want to move the buffer, a solution is to modify the coordinates ofgeometryPoint.
– J. Monticolo
11 hours ago
add a comment |
Found what is the reason of this issue. moveVertex() function makes this cut and didn't work. How can I make circle move to other coordinates?
Thank you for the follow up but add the complete code in your original post, mostly the buggy part withmoveVertex()function. You make a buffer from thegeometryPointobject, if you want to move the buffer, a solution is to modify the coordinates ofgeometryPoint.
– J. Monticolo
11 hours ago
add a comment |
Found what is the reason of this issue. moveVertex() function makes this cut and didn't work. How can I make circle move to other coordinates?
Found what is the reason of this issue. moveVertex() function makes this cut and didn't work. How can I make circle move to other coordinates?
answered 13 hours ago
Wolf SchulzWolf Schulz
635
635
Thank you for the follow up but add the complete code in your original post, mostly the buggy part withmoveVertex()function. You make a buffer from thegeometryPointobject, if you want to move the buffer, a solution is to modify the coordinates ofgeometryPoint.
– J. Monticolo
11 hours ago
add a comment |
Thank you for the follow up but add the complete code in your original post, mostly the buggy part withmoveVertex()function. You make a buffer from thegeometryPointobject, if you want to move the buffer, a solution is to modify the coordinates ofgeometryPoint.
– J. Monticolo
11 hours ago
Thank you for the follow up but add the complete code in your original post, mostly the buggy part with
moveVertex() function. You make a buffer from the geometryPoint object, if you want to move the buffer, a solution is to modify the coordinates of geometryPoint.– J. Monticolo
11 hours ago
Thank you for the follow up but add the complete code in your original post, mostly the buggy part with
moveVertex() function. You make a buffer from the geometryPoint object, if you want to move the buffer, a solution is to modify the coordinates of geometryPoint.– J. Monticolo
11 hours ago
add a comment |
Thanks for contributing an answer to Geographic Information Systems Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f317016%2fgot-pacman-instead-of-circle-when-buffering-point-qgis-2-14-standalone-c-appli%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Have you tried to add the vector layer without set a layer renderer ?
– J. Monticolo
yesterday
yes, same result.
– Wolf Schulz
yesterday
What are your CRS, units ?
– J. Monticolo
yesterday
EPSG:3857, meters. Tested on EPSG:4326 with degrees, no difference.
– Wolf Schulz
yesterday