Guiseppe,
Attached is a demo JEQL script to perform the "block" replacement. (In
case the attachment doesn't work, the script is also included below.
If you have any issues getting this to work with Shapefile input, just
let me know.
--
Martin Davis
Senior Technical Architect
Refractions Research, Inc.
(250) 383-3022
/*==================================================
A demo of replacing point locations with geometric "blocks".
The blocks are named, and are linked to the data table by joining on
the name column.
The blocks and data points are given explicitly here for demo purposes.
They can be read from any data format supported by JEQL (eg Shapefile)
Author: Martin Davis
Date: 2010-Feb-11
===================================================*/
tblock = select * from table (
( "Triangle", POLYGON ((0 0, 20 20, 40 0, 0 0)) )
( "Square", POLYGON ((0 0, 0 20, 20 20, 20 0, 0 0)) )
) t(name, geometry) ;
tdata = select * from table (
( POINT(100 100), "Triangle" )
( POINT(200 200), "Square" )
( POINT(300 300), "Triangle" )
( POINT(400 400), "Square" )
) t(location, blockType) ;
tout = select Geom.translate(p.geometry, dx, dy) geom, blockType
with {
cent = Geom.centroid(b.geometry);
dx = Geom.x(d.location) - Geom.x(cent);
dy = Geom.y(d.location) - Geom.y(cent);
}
from tblock b
join tdata d on d.blockType == b.name;
// data can be printed for a quick preview
Print tout;
ShapefileWriter tout file: "output.shp";
/*==================================================
A demo of replacing point locations with geometric "blocks".
The blocks are named, and are linked to the data table by joining on
the name column.
The blocks and data points are given explicitly here for demo purposes.
They can be read from any data format supported by JEQL (eg Shapefile)
Author: Martin Davis
Date: 2010-Feb-11
===================================================*/
tblock = select * from table (
( "Triangle", POLYGON ((0 0, 20 20, 40 0, 0 0)) )
( "Square", POLYGON ((0 0, 0 20, 20 20, 20 0, 0 0)) )
) t(name, geometry) ;
tdata = select * from table (
( POINT(100 100), "Triangle" )
( POINT(200 200), "Square" )
( POINT(300 300), "Triangle" )
( POINT(400 400), "Square" )
) t(location, blockType) ;
tout = select Geom.translate(p.geometry, dx, dy) geom, blockType
with {
cent = Geom.centroid(b.geometry);
dx = Geom.x(d.location) - Geom.x(cent);
dy = Geom.y(d.location) - Geom.y(cent);
}
from tblock b
join tdata d on d.blockType == b.name;
// data can be printed for a quick preview
Print tout;
ShapefileWriter tout file: "output.shp";
------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Jump-pilot-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel