MCPcopy Create free account
hub / github.com/MapServer/MapServer / msSDELayerNextShape

Function msSDELayerNextShape

mapsde.c:1647–1690  ·  view source on GitHub ↗

-------------------------------------------------------------------- */ msSDELayerNextShape */ -------------------------------------------------------------------- */ Recursively gets the shapes for the SDE layer */ -------------------------------------------------------------------- */

Source from the content-addressed store, hash-verified

1645/* Recursively gets the shapes for the SDE layer */
1646/* -------------------------------------------------------------------- */
1647int msSDELayerNextShape(layerObj *layer, shapeObj *shape) {
1648#ifdef USE_SDE
1649 long status;
1650
1651 msSDELayerInfo *sde=NULL;
1652
1653 if(!msSDELayerIsOpen(layer)) {
1654 msSetError( MS_SDEERR,
1655 "SDE layer has not been opened.",
1656 "msSDELayerNextShape()");
1657 return(MS_FAILURE);
1658 }
1659
1660 sde = layer->layerinfo;
1661
1662 /* fetch the next record from the stream */
1663 status = SE_stream_fetch(sde->connPoolInfo->stream);
1664
1665 if(status == SE_FINISHED)
1666 return(MS_DONE);
1667 else if(status != MS_SUCCESS) {
1668 sde_error( status,
1669 "msSDELayerNextShape()",
1670 "SE_stream_fetch()");
1671 return(MS_FAILURE);
1672 }
1673
1674 /* get the shape and values (first column is the shape id, */
1675 /* second is the shape itself) */
1676 status = sdeGetRecord(layer, shape);
1677 if(status != MS_SUCCESS)
1678 return(MS_FAILURE); /* something went wrong fetching the record/shape */
1679
1680 if(shape->numlines == 0) /* null shape, skip it */
1681 return(msSDELayerNextShape(layer, shape));
1682
1683 return(MS_SUCCESS);
1684#else
1685 msSetError( MS_MISCERR,
1686 "SDE support is not available.",
1687 "msSDELayerNextShape()");
1688 return(MS_FAILURE);
1689#endif
1690}
1691
1692/* -------------------------------------------------------------------- */
1693/* msSDELayerGetExtent */

Callers

nothing calls this directly

Calls 4

msSDELayerIsOpenFunction · 0.85
msSetErrorFunction · 0.85
sde_errorFunction · 0.85
sdeGetRecordFunction · 0.85

Tested by

no test coverage detected