Q&A - Question

How to Get Shapes of a Layer programmatically

Question
SohT asked on January 27, 2017, keyword: Developer Kernel
I've tried GetShape(_uid), but for a TGIS_LayerSHP , it only returns one TGIS_Shape,all I'm trying to do is to create a  List<TGIS_Shape> of a shapes in TGIS_LayerSHP.
Answers
Tomasz Kosinski (TatukGIS) replied January 27, 2017
Hi,
On a list only in-memory shape resides (all shapes for layers that are fully loaded into memory or edited shapes)

To loop for shapes you can use (C# but same in other languages):

foreach( shp in layer.Loop( query ) )
{
}

Or you can use layer.FindFirst..FindNext but  using .Loop is recomenede way.

See also Enumerators sample (http://docs.tatukgis.com/DK11/doku.php?id=samples:samples:enumerators) which shows how to use enumerators directly (using while) and indirectly (using foreach)
If you would like to answer the question please Sign In.
*
*
Please review our recent Privacy Policy.
If you have any questions or requests, please contact us.
Rules
The Questions and Answers (Q & A) is intended to provide a means of communication between TatukGIS customers.
 
  1. Licensed users (with active maintenance play) of TatukGIS products may contribute to the Q & A content. Read-only access is available to anyone.
  2. Keep the content positive and professional.
  3. Be courteous to others by posting information when a question or issue asked on the Q & A is answered or resolved by other means (such as with help from TatukGIS technical support). Offer others at least a hint how the posted question was answered or the issue was resolved.
  4. The Q & A is not a replacement for TatukGIS technical support. TatukGIS team may or may not regularly follow or contribute content.