«It may be impossible to despise your client or users and still deliver a quality product.»
A good story on leading by example by Avdi Grimm. On why code quality matters.
«It may be impossible to despise your client or users and still deliver a quality product.»
A good story on leading by example by Avdi Grimm. On why code quality matters.
«Real artists ship» – Steve Jobs, 1983
Don’t miss this article on how Apple releases its products and why it’s one of its strengths.
«Confucius argued that under law, external authorities administer punishments after illegal actions, so people generally behave well without understanding reasons why they should; whereas with ritual, patterns of behavior are internalized and exert their influence before actions are taken, so people behave properly because they fear shame and want to avoid losing face. In this sense, “rite” is an ideal form of social norm.»
Re-reading some notes on Creation, by Gore Vidal. One of the best novels I’ve read.
«My friends and I have been coddled long enough by a billionaire-friendly Congress. It’s time for our government to get serious about shared sacrifice.»
Warren Buffet, on the the differences between the taxes to labour and the taxes to capital in USA.
Last week I paired together with Francisco Puga to review the status of opencadtools. As Fran is doing a great work in preparing the integration of opencadtools as default CAD tools in gvSIG, I wanted to know first hand how it was going. iCarto and Cartolab were kind enough to sponsor this pairing session. One of the results, apart from working with Fran -which is always motivating and enjoyable, per se-, was a deeper understanding on how snappers work in gvSIG, which is something I had asked myself sometimes. And, as one of the improvements of opencadtools is a followgeometry snapper, it seems a good goal to review that part of the project. Find below the summary:
CADToolAdapter class in extCAD extension maintains a list of snappers and layers to snap to from the editing layer. When the mouse is moved, the snappers are recalculated following this algorithm (note that the code below is the core of the method, some other parts/casts and boilerplate code is missing):
ArrayList snappers = SnapConfigPage.getActivesSnappers();
ILayerEdited layerInEdition =
CADExtension.getEditionManager().getActiveLayerEdited();
ArrayList layersToSnap = layerInEdition.getLayersToSnap();
for (FLyrVect layer : layersToSnap) {
// Getting the set of geometries within the envelope
// The envelope is calculated based on the tolerance the user wants
SpatialCache cache = layer.getSpatialCache();
List geometries = cache.query(envelope);
// Updating the nearest point
for (Feature geomToSnap : geometries){
for (int i=0; i<snappers.size(); i++){
Point2D pointToSnap = snappers[i].getSnapPoint(queryPoint,
geomToSnap,
tolerance,
lastPointEntered);
}
double distance = pointToSnap.distance(queryPoint);
if(minimunDistance > distance){
minimunDistance = distance;
}
}
}
This algorithm is executed every time the user move the mouse and is very quick if you have few layers to snap to. But, as the number of layer to check increases, the editing process becomes very slow. Besides, as a comment of software design, after reviewing this part of code, I like the way the snappers fit in gvsig cad tools. If you want to add a new snapper, just need to implement ISnapperVectorial interface and make getSnapToPoint method to return the nearest point to the position of the mouse. So, designing your own snappers is very easy!
By the way, if you feel like replying how other GIS applications (QGIS, uDig, …) manage the snappers, I’d be more than happy to hear and learn that!
One of those good old texts to revisit from time to time: Who needs an architect? by Martin Fowler. If you are in the software industry, please, make yourself a tea and get 10 minutes of good reading. Will help you to understand what technical leadership means.