Im learning by doing with limited knowledge and experience. The code snippet below I've used to use and offset distance from the boundary to create an inner parcel.
What I'm having trouble with is being able to export the resulting face (boundary) geomentry of the inner lot to gis as a layer.
Any suggestions? Thanks in advance
// inner_parcel_export.cga
// ------------------------------------------------------
// Purpose: Create an inner parcel offset inward from all boundaries by 1 m
// and mark it for export to GIS (e.g., as shapefile or GDB).
// ------------------------------------------------------
// -----------------
// Attributes
// -----------------
attr offsetDist = 1.0 // inward offset distance in meters
attr subparcel = 0 // attribute flag: 1 = inner parcel
attr parcelType = "outer" // attribute tag: outer/inner
// -----------------
// Start Rule
// -----------------
@StartRule
Lot -->
// Assign attributes to the outer parcel
set(subparcel, 0)
set(parcelType, "outer")
// Offset inward by offsetDist to create a new shape
offset(-offsetDist) InnerBoundary
// -----------------
// Inner boundary component handling
// -----------------
InnerBoundary -->
// Split geometry into inside and border parts
comp(f) {
inside : InnerParcel
| border : OuterParcel
}
// -----------------
// Inner parcel definition
// -----------------
InnerParcel -->
set(subparcel, 1)
set(parcelType, "inner")
color("#ffcc99")
// Keep as polygon shape for GIS export (no extrusion)
// -----------------
// Outer parcel definition (optional visualization only)
// -----------------
OuterParcel -->
set(parcelType, "outer")
color("#99ccff")
Solved! Go to Solution.
Hello @Tiwene_Roberts
Thanks for sharing your code snippet—it's awesome that you're diving in and learning by doing with CityEngine. I understand the challenge of exporting that inner parcel boundary as a GIS layer. I'll walk you through a straightforward solution below.
When exporting a Model to FileGDB, it is not possible to only select certain faces of a Model. Therefore, all face geometries in the CGA code, that you do not want to export, have to be NILed.
NIL operation—ArcGIS CityEngine Resources | Documentation
// -----------------
// Outer parcel definition (optional visualization only)
// -----------------
OuterParcel --> NIL
// set(parcelType, "outer")
// color("#99ccff")Then Export to the model to FileGDB and make sure to only export Models:
Export FileGDB (Esri File Geodatabase)—ArcGIS CityEngine Resources | Documentation
Hello @Tiwene_Roberts
Thanks for sharing your code snippet—it's awesome that you're diving in and learning by doing with CityEngine. I understand the challenge of exporting that inner parcel boundary as a GIS layer. I'll walk you through a straightforward solution below.
When exporting a Model to FileGDB, it is not possible to only select certain faces of a Model. Therefore, all face geometries in the CGA code, that you do not want to export, have to be NILed.
NIL operation—ArcGIS CityEngine Resources | Documentation
// -----------------
// Outer parcel definition (optional visualization only)
// -----------------
OuterParcel --> NIL
// set(parcelType, "outer")
// color("#99ccff")Then Export to the model to FileGDB and make sure to only export Models:
Export FileGDB (Esri File Geodatabase)—ArcGIS CityEngine Resources | Documentation
Hello Thomas,
Thank you kindly for your solution it worked perfectly not to mention a better understanding of the application. ✌