Spatial Manager can read parcel boundaries from Oracle and import them into your drawing or map. This example imports 29 parcels from Santa Monica, California. Select a boundary and you can read its parcel ID, zoning and original area in the Spatial Manager palette.
Available for AutoCAD, BricsCAD, ZWCAD, GstarCAD and Desktop.
1. Prepare the Oracle view
The ODBC provider reads polygon geometry as well-known binary (WKB). If your table stores boundaries as SDO_GEOMETRY, create a view that converts them with SDO_UTIL.TO_WKBGEOMETRY and includes the parcel attributes you want to import. In this example, the parcels are stored in the PARCELS table:
CREATE VIEW PARCELS_WKB AS
SELECT ID, PARCEL_ID, ZONING, AREA_ORIG,
SDO_UTIL.TO_WKBGEOMETRY(GEOM) AS GEOM_WKB
FROM PARCELS;
Before connecting, check that every row in the view has a WKB geometry:
SELECT COUNT(*) AS PARCELS,
COUNT(DBMS_LOB.GETLENGTH(GEOM_WKB)) AS WKB_ROWS,
MIN(DBMS_LOB.GETLENGTH(GEOM_WKB)) AS MIN_BYTES_WKB
FROM PARCELS_WKB;
WKB_ROWS should match the PARCELS count. Spatial Manager skips features with a null geometry during the import.
2. Set up the Oracle connection in Windows
- Use the 64-bit Oracle Instant Client with its ODBC driver. Have your Oracle service alias ready. For an Oracle Autonomous Database, set
TNS_ADMINto the wallet folder that contains the network configuration. - Open ODBC Data Source Administrator (64-bit). On the User DSN tab, click Add, select the Oracle driver and click Finish.
- Enter a data source name (
SAMPLEin this example), the TNS service name (sample_low) and an Oracle user with access to the view. Click Test Connection, enter the password and save the connection once the test succeeds.
Oracle ODBC driver configuration with SAMPLE as the data source name and sample_low as the TNS service name
3. Choose the view and geometry field
- Open a blank drawing or map and run the SPM command to open the main palette (for Spatial Manager Desktop, go to the docked panel). Right-click User data sources and choose Create user data source. Select Open Database Connectivity ODBC.
- Choose User Data Source Name (DSN), select
SAMPLE, enter your Oracle credentials and click Connect. Leave the table owner blank if you own the view. - Under Table, choose
PARCELS_WKB. Select Any type (WKB) and set WKB field toGEOM_WKB. Click Next, then Finish to add the source to the palette.
4. Import the boundaries
- Drag the new data source into the drawing or map. In Import parameters, choose Polylines for lines and borders, and Borders for polygons. Enable Import Features data as entities Extended Entity Data (EED) to attach the attributes to each boundary.
- Leave Import only Features in the current view cleared to bring in all 29 parcels.
- Click Next and enable Overwrite source CRS. In the CRS catalog, choose NAD83 / California zone 5 (ftUS) (EPSG:2229), the coordinate system of the sample. Leave Transform the coordinates cleared to keep the original coordinates, then click Finish.
5. Check a parcel
The import report shows 29 features read and 29 written. Close the report, zoom to the extents and select a parcel boundary to see its attributes.
For parcel 14290, the palette shows the same values as Oracle for ZONING (M1) and AREA_ORIG (126989.9375).
Learn more about importing from Excel, CSV or ODBC data providers and accessing ODBC connections.
Note: Some features are available only in the Standard or Professional editions.