olivierdalang / cadinput Goto Github PK
View Code? Open in Web Editor NEWCadInput QGIS plugin
CadInput QGIS plugin
use relative distance: total construction distance vs diff. from previous point distance.
default would be relative.
Hi,
when trying to create line restricted by distance (e.g. 100km), it creates line which is appeared to be 100km according to CADInput, but is about 50km according to Googlestreets (it covers about half of the road drawn in Googlestreets), project is in WGS 84/ EPSG 3857. Is it really a bug or I just don't know how to use the tool appropriately?
thanks!
I just tried the plugin on a big project (around 40 vector layers), and it is unusable. It takes about 1 sec to display the coordinates.
I believe the problem is in the snapping.
Not sure if it might solve this, but instead of doing 4 snapping, you might want to use QgsSnapper instead of QgsMapCanvasSnapper.
Hence, you should be able to run it only once, and with you proper settings (without changing the project snapping settings).
Here is an example:
def updateSnapperList(self, dummy=None):
self.snapperList = []
tolerance = self.settings.value("selectTolerance")
units = self.settings.value("selectUnits")
scale = self.iface.mapCanvas().mapRenderer().scale()
for layer in self.iface.mapCanvas().layers():
if layer.type() == QgsMapLayer.VectorLayer and layer.hasGeometryType():
if not layer.hasScaleBasedVisibility() or layer.minimumScale() < scale <= layer.maximumScale():
snapLayer = QgsSnapper.SnapLayer()
snapLayer.mLayer = layer
snapLayer.mSnapTo = QgsSnapper.SnapToVertex
snapLayer.mTolerance = tolerance
if units == "map":
snapLayer.mUnitType = QgsTolerance.MapUnits
else:
snapLayer.mUnitType = QgsTolerance.Pixels
self.snapperList.append(snapLayer)
def snapToLayers(self, pixPoint, initPoint=None):
self.snapping = self.settings.value("obsDistanceSnapping")
if len(self.snapperList) == 0:
return initPoint
snapper = QgsSnapper(self.mapCanvas.mapRenderer())
snapper.setSnapLayers(self.snapperList)
snapper.setSnapMode(QgsSnapper.SnapWithResultsWithinTolerances)
ok, snappingResults = snapper.snapPoint(pixPoint, [])
self.displaySnapInfo(snappingResults)
if ok == 0 and len(snappingResults) > 0:
return QgsPoint(snappingResults[0].snappedVertex)
else:
return initPoint
Il y a un commit "do not enable parallel or perpendicular if no previous point", ce qui est une bonne idée, mais ça ne semble pas/plus avoir d'effet dans master.
when using coordinates lock ( x + y ), the added node is not exactly at the given coordinates.
Ability to define a user origin.
If you have several measures taken from one point, you may want to enter coordinates from that point. In current version, the only way to do that is to enter in construction mode between each entered point, which is a bit annoying.
Maybe we could even allow for a user axis...
Would this be useful ?
Traceback (most recent call last):
File "/CadInput/CadInputWidget.py", line 300, in maptoolChanged
File "/CadInput/CadInputWidget.py", line 380, in active
RuntimeError: wrapped C/C++ object of type CadInputWidget has been deleted
Hi Olivier,
Are you interested in contributions?
I've some ideas (and little python code) on inquirying, building, editing, etc, of vector features:
have you thought about where to collect contributions from third parties?
Thank you very much, sorry for my bad english, best regards,
giuliano curti
When finishing the drawing (right click) qgis-dev crashes
Hi Olivier,
It looks like this tool is replacing the Improved Polygon Capture Tool? If so, my request from that one still stands--it would be great to have the ability to enter angles in the format N45D15'30"W.
Just testing out the plugin, when it is enabled in plugin manager I get this:
An error has occured while executing Python code:
Traceback (most recent call last):
File "/Users/timlinux/.qgis2/python/plugins/CadInput/CadGhostWidget.py", line 168, in mouseMoveEvent
self.iface.mapCanvas().mouseMoveEvent(event)
RuntimeError: no access to protected functions or signals for objects not created from Python
Python version:
2.7.5 (default, Aug 25 2013, 00:04:04)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)]
QGIS version:
2.1.0-Master Master,
Python path: ['/usr/local/Cellar/qgis-20/HEAD/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing', '/usr/local/Cellar/qgis-20/HEAD/QGIS.app/Contents/MacOS/../Resources/python', u'/Users/timlinux/.qgis2/python', u'/Users/timlinux/.qgis2/python/plugins', '/usr/local/Cellar/qgis-20/HEAD/QGIS.app/Contents/MacOS/../Resources/python/plugins', '/Library/Python/2.7/site-packages/pip-1.5-py2.7.egg', '/Library/Python/2.7/site-packages/psycopg2-2.5.2-py2.7-macosx-10.9-intel.egg', '/Library/Python/2.7/site-packages/setuptools-2.1-py2.7.egg', '/usr/local/lib/python2.7/site-packages', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', '/Library/Python/2.7/site-packages', '/usr/local/lib/python2.7/site-packages/wx-3.0-osx_cocoa', '/Users/timlinux/.qgis2/python/plugins/inasafe-dev', '/Users/timlinux/.qgis2/python/plugins/inasafe-dev/third_party', '/usr/local/Cellar/qgis-20/HEAD/QGIS.app/Contents/Resources/python/plugins/fTools/tools']
Tested with 960ac8c
Tested using QGIS Master
backspace should remove last point
Hello there,
Right-click no longer allows the user to finish digitising a polygon made using the autoTrace tool / plugin.
CadInput seems to hijack the right-click event (it appears to do this around line 180 in CadEventFilter.py). At present, this occurs even when the Enable CAD input button is not toggled.
Please let me know if you'd like more information / data to reproduce and I'll be happy to send something through.
Kind regards,
Pete
Just a minor niggle but the word "parallel" is spelled incorrectly as "parralel".
Thanks for a great plugin.
if you are digitizing a line and click on perpendicular or parallel icons, then when you go back on the canvas the red line from the map tool does not update anymore.
When enable the plugin I can't use the pan pressing the space keyboard
Hi Olivier,
I'll wait when you're ready to TRY to help with (if you are interested in):
all the best
giuliano curti
Snapping should also occur on features that are currently being digitized...
all in the title ;)
I found weird that finishing the feature digitization adds a new construction point.
I suggest to check if there is a right or left click.
thanks again for this awesome plugin!!!
Don't work block the distance.
When I press the button for block the distance the circle does not remain static
Hi, How to add a CADInput(Advanced Digitizing Panel) to plugin to click when we want to show us a Advanced Digitizing Panel(because I'm trying to make my own toolbar), for example (self.iface.viewMenu().actions()[6]), when we want a Split Features, is any chance to do this, but not to go with View menu->Panels->Advanced Digitizing Panel ?
while digitizing snap at useful angles (45/90) with respect to the last digitized segment or maybe other lines on the canvas
I believe that, as in a maptool, the right click should finish the construction and remove the construction objects.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.