Examples of createSchema()


Examples of org.geotools.data.shapefile.ShapefileDataStore.createSchema()

            SimpleFeatureBuilder featureBuilder = null;
           
            if(gisExport.type.equals(GisUploadType.STOPS))
            {
              dataStore.createSchema(STOP_TYPE);
              featureBuilder = new SimpleFeatureBuilder(STOP_TYPE);
             
              List<Stop> stops = Stop.find("agency in (:ids)").bind("ids", gisExport.agencies).fetch();
             
              for(Stop s : stops)
View Full Code Here

Examples of org.geotools.data.shapefile.ShapefileDataStore.createSchema()

                    collection.add(feature)
              }
            }
            else if(gisExport.type.equals(GisUploadType.ROUTES))
            {
              dataStore.createSchema(ROUTE_TYPE);
              featureBuilder = new SimpleFeatureBuilder(ROUTE_TYPE);
             
                List<Route> routes = Route.find("agency in (:ids)").bind("ids", gisExport.agencies).fetch();
             
                // check for duplicates
View Full Code Here

Examples of org.geotools.data.shapefile.ShapefileDataStore.createSchema()

        ShapefileDataStoreFactory factory = new ShapefileDataStoreFactory();
        Map<String, Serializable> params = new HashMap<String, Serializable>();
        params.put("url", outputShapeFile.toURI().toURL());
        params.put("create spatial index", Boolean.TRUE);
        ShapefileDataStore dStore = (ShapefileDataStore) factory.createNewDataStore(params);
        dStore.createSchema(featureType);
        dStore.forceSchemaCRS(mapCrs);

        JGrassToolsPlugin.getDefault().writeToShapefile(dStore, newCollection);

        JGrassToolsPlugin.getDefault().addServiceToCatalogAndMap(outputShapeFile.getAbsolutePath(), true, true,
View Full Code Here

Examples of org.geotools.data.shapefile.ShapefileDataStore.createSchema()

            ShapefileDataStoreFactory factory = new ShapefileDataStoreFactory();
            Map<String, Serializable> params = new HashMap<String, Serializable>();
            params.put("url", outputLinesShapeFile.toURI().toURL());
            params.put("create spatial index", Boolean.TRUE);
            ShapefileDataStore dStore = (ShapefileDataStore) factory.createNewDataStore(params);
            dStore.createSchema(featureType);
            dStore.forceSchemaCRS(mapCrs);

            JGrassToolsPlugin.getDefault().writeToShapefile(dStore, newCollection);

            JGrassToolsPlugin.getDefault().addServiceToCatalogAndMap(outputLinesShapeFile.getAbsolutePath(), true, true,
View Full Code Here

Examples of org.geotools.data.shapefile.ShapefileDataStore.createSchema()

            ShapefileDataStoreFactory factory = new ShapefileDataStoreFactory();
            Map<String, Serializable> params = new HashMap<String, Serializable>();
            params.put("url", outputPointsShapeFile.toURI().toURL());
            params.put("create spatial index", Boolean.TRUE);
            ShapefileDataStore dStore = (ShapefileDataStore) factory.createNewDataStore(params);
            dStore.createSchema(featureType);
            dStore.forceSchemaCRS(mapCrs);

            JGrassToolsPlugin.getDefault().writeToShapefile(dStore, newCollection);

            JGrassToolsPlugin.getDefault().addServiceToCatalogAndMap(outputPointsShapeFile.getAbsolutePath(), true, true,
View Full Code Here

Examples of org.geotools.data.shapefile.ShapefileDataStore.createSchema()

            ShapefileDataStoreFactory factory = new ShapefileDataStoreFactory();
            Map<String, Serializable> params = new HashMap<String, Serializable>();
            params.put("url", outputPointsShapeFile.toURI().toURL());
            params.put("create spatial index", Boolean.TRUE);
            ShapefileDataStore dStore = (ShapefileDataStore) factory.createNewDataStore(params);
            dStore.createSchema(featureType);
            dStore.forceSchemaCRS(mapCrs);

            JGrassToolsPlugin.getDefault().writeToShapefile(dStore, newCollection);

            JGrassToolsPlugin.getDefault().addServiceToCatalogAndMap(outputPointsShapeFile.getAbsolutePath(), true, true,
View Full Code Here

Examples of org.geotools.data.shapefile.ShapefileDataStore.createSchema()

        ShapefileDataStoreFactory dataStoreFactory = new ShapefileDataStoreFactory();
        Map<String, Serializable> params = new HashMap<String, Serializable>();
        params.put("url", URLUtils.fileToURL(file)); //$NON-NLS-1$
        params.put("create spatial index", Boolean.TRUE); //$NON-NLS-1$
        ShapefileDataStore ds = (ShapefileDataStore) dataStoreFactory.createDataStore(params);
        ds.createSchema(type);
       
        SimpleFeatureStore featureSource = (SimpleFeatureStore) ds.getFeatureSource();
        List<FeatureId> ids = featureSource.addFeatures(fc);
        return ids.size() >= 0;
    }
View Full Code Here

Examples of org.geotools.data.shapefile.ShapefileDataStore.createSchema()

    ShapefileDataStoreFactory factory = new ShapefileDataStoreFactory();
    Map params = new HashMap();
    params.put( "url", file.toURL() );
    ShapefileDataStore dataStore =
        (ShapefileDataStore) factory.createNewDataStore( params );   
    dataStore.createSchema( featureType );
   
    FeatureStore store = (FeatureStore) dataStore.getFeatureSource();
    store.addFeatures( source.getFeatures() );
    dataStore.forceSchemaCRS( crs );
}
View Full Code Here

Examples of org.geotools.data.shapefile.ShapefileDataStore.createSchema()

        } finally {
            if(pw != null) pw.close();
        }

        try {
            sfds.createSchema(schema);
        } catch (NullPointerException e) {
            LOGGER.warning(
                "Error in shapefile schema. It is possible you don't have a geometry set in the output. \n"
                + "Please specify a <wfs:PropertyName>geom_column_name</wfs:PropertyName> in the request");
            throw new ServiceException(
View Full Code Here

Examples of org.geotools.data.shapefile.ShapefileDataStore.createSchema()

      params.put("create spatial index", Boolean.TRUE);

      ShapefileDataStore newDataStore = (ShapefileDataStore) dataStoreFactory
          .createNewDataStore(params);
      newDataStore.setStringCharset(Charset.forName("UTF-8"));
      newDataStore.createSchema(features.get(0).getFeatureType());

      /*
       * You can comment out this line if you are using the
       * createFeatureType method (at end of class file) rather than
       * DataUtilities.createType
 
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.