what is the class that draws the polygons?
Hi, there is no particular class that draws polygons, i think.
Can you be more specific and say what you are trying to do? Because nobody is supposed to work on such low-level within OpenJUMP, except you want to improve the renderer (which does drawing).
Hi, Stefan is right, some context would be useful.
On a low level, we can say that drawing is the responsability of a
Renderer (interface com.vividsolutions.jump.workbench.ui.renderer.Renderer)
a simple implementation of renderer for features is
it iterates through styles ans for each style it iterates through layer features
the conversion of JTS geometries to java Shapes is performed
and as you're interested in Polygons
I want to change the design of the buildings taken from a shapefile
I need to enter the third dimension in buildings loaded from a shapefile
So I suppose that you dont want to change your polygon only for rendering but also in the model.
In OpenJUMP, your shapefile is represented as a Layer
The Layer contains a FeatureCollection (layer.getFeatureCollectionWrapper()
A FeatureCollection contains Feature's (fc.iterator or fc.getFeatures())
A Feature contains a Geometry (feature.getGeometry())
Geometry contains Coordinates which have a x, a y and optionally a z value.
Geometry and Coordinate classes are documented within the JTS library
More info about your use case may bring you more precise answers.
Actually, if it is just colours you want to change, then you need to know about styling of a layer (e.g. use of BasicStyle class)
I want to open a shapefile with a single layer with objects has x and y coordinates, add the z with values entered by me and display an object in 3 dimensions.
How to display an object in 3 dimensions? I just insert the z coordinates in the geometry?
Wow, not sure OpenJUMP will fit your needs.
1 - OpenUMP geometry model (JTS) is 2.5D, it means that you can have a z on each coordinate, but z is not used by the engine. Also polygons are nor oriented, and the representation of a vertical face may be invalid (its 2D projection is a line).
2 - currently, to add/change Z on a geometry, the only way is to edit the geometry and to change its WKT representation, which is not very user friendly. If you have to change z on a particular vertex, you'll have to develop a dedicated user interface.
3 - the rendering pipeline uses java awt which is a 2D engine. If you want to display your features in 3D, you'll have to develop a new renderer based on a 3D engine (there are dedicated java project like worldwind you should have a look if you need to display 3D geographic features with java)