
package org.geotools.geopkg;

import java.io.IOException;

import org.geotools.geometry.jts.WKBReader;
import org.geotools.geopkg.geom.GeoPkgGeomReader;
import org.locationtech.jts.geom.Geometry;
import org.locationtech.jts.io.ParseException;

public class RsGeoPkgGeomReader extends GeoPkgGeomReader {

  public RsGeoPkgGeomReader(byte[] bytes) {
    super(bytes);
  }

  @Override
  protected Geometry read() throws IOException {
    try {
      // use the geotools WKBReader to add support for additional geometry types
      WKBReader wkbReader = new WKBReader(getFactory());
      Geometry g = wkbReader.read(input);
      g.setSRID(header.getSrid());
      return g;
    } catch (ParseException e) {
      throw new IOException(e);
    }
  }

}
