Package org.OpenGeoPortal.Solr

Examples of org.OpenGeoPortal.Solr.SolrRecord


    //--generate POST message
    //info needed: geometry column, bbox coords, epsg code, workspace & layername
     //all client bboxes should be passed as lat-lon coords.  we will need to get the appropriate epsg code for the layer
     //in order to return the file in original projection to the user (will also need to transform the bbox)
    String layerName = this.currentLayer.getLayerNameNS();
    SolrRecord layerInfo = this.currentLayer.getLayerInfo();
    BoundingBox nativeBounds = new BoundingBox(layerInfo.getMinX(), layerInfo.getMinY(), layerInfo.getMaxX(), layerInfo.getMaxY());
    BoundingBox bounds = nativeBounds.getIntersection(this.currentLayer.getRequestedBounds());

    String workSpace = layerInfo.getWorkspaceName();
    Map<String, String> describeLayerInfo = getWfsDescribeLayerInfo();
    int epsgCode = 4326;//we are filtering the bounds based on WGS84
    String geometryColumn = describeLayerInfo.get("geometryColumn");
    String nameSpace = describeLayerInfo.get("nameSpace");
    String bboxFilter = "";
View Full Code Here


  OgpHttpClient ogpHttpClient;
 
  @Override
  public File downloadZipFile(String layerId, BoundingBox bounds) throws Exception{

    SolrRecord layerInfo = layerInfoRetriever.getAllLayerInfo(layerId);
   
    //requests too near the poles are problematic
    BoundingBox requestBounds = null;
    Double requestMinY = bounds.getMinY();
    if (requestMinY < -85.0){
       requestMinY = -85.0;
    }
    Double requestMaxY = bounds.getMaxY();
    if (requestMaxY > 85.0){
       requestMaxY = 85.0;
    }
    requestBounds = new BoundingBox(bounds.getMinX(), requestMinY, bounds.getMaxX(), requestMaxY);
    String workspace = layerInfo.getWorkspaceName();
    String layerName = layerInfo.getName();
    String requestString = "request=GetFeature&version=1.1.0&outputFormat=shape-zip";
    requestString += "&typeName=" + workspace + ":" + layerName;
    requestString += "&srsName=EPSG:4326";
    requestString += "&BBOX=" + requestBounds.toString() + ",EPSG:4326";
    HttpClient httpclient = ogpHttpClient.getHttpClient();
    File outputFile = null;
   
      String wfsLocation = ParseJSONSolrLocationField.getWfsUrl(layerInfo.getLocation());
        HttpGet httpget = new HttpGet(wfsLocation + "?" + requestString);

        logger.info("executing request " + httpget.getURI());
       
    try {
View Full Code Here

    errorMap.put("errorStatus", Integer.toString(status));
    return errorMap;
  }

  public Map<String,String> getResponseMap(String layerId) throws Exception {
    SolrRecord solrRecord = layerInfoRetriever.getAllLayerInfo(layerId);
   
    return getResponseMap(solrRecord);
   
  }
View Full Code Here

   
  }

  @Override
  public AugmentedSolrRecord getOgcAugment(String layerId) throws Exception {
    SolrRecord solrRecord = layerInfoRetriever.getAllLayerInfo(layerId);

    return getOgcAugment(solrRecord);
  }
View Full Code Here

  }

  @Override
  public AugmentedSolrRecord getOgcAugment(String layerId, String owsUrl)
      throws Exception {
    SolrRecord solrRecord = layerInfoRetriever.getAllLayerInfo(layerId);
    return getOgcAugment(solrRecord, owsUrl);
  }
View Full Code Here

    } catch (Exception e2) {
      // TODO Auto-generated catch block
      e2.printStackTrace();
    }
      
    SolrRecord firstRecord = layerRecords.get(0);
       //String institution = firstRecord.getInstitution();
    String servicePoint = firstRecord.getLocation();
    servicePoint = ParseJSONSolrLocationField.getWmsUrl(servicePoint);
       String serverName = servicePoint.substring(0, servicePoint.indexOf("/wms"));
       logger.debug(serverName);
       genericProxy.proxyRequest(request, response, servicePoint + "request=getCapabilities&version=1.1.1");
View Full Code Here

        AddWMSLayerToMapRequestJson addLayerToMapRequestJson = new AddWMSLayerToMapRequestJson();

        addLayerToMapRequestJson.setSource("finder:" + dataSetStatus.getId());
        addLayerToMapRequestJson.setVisible(true);
       
      SolrRecord layerInfoMap = layerInfoRetriever.getAllLayerInfo(dataSetStatus.getOgpLayerId());
      String ogpLayerName = /*layerInfoMap.getWorkspaceName().trim() + ":" +*/ layerInfoMap.getName().trim();
      //addLayerToMapRequestJson.setStyles(addLayerToMapRequestJson.new Styles());
      //addLayerToMapRequestJson.getStyles().setType("primitives");
        //System.out.println(layerId);
        addLayerToMapRequestJson.setTitle(dataSetStatus.getTitle());
        //System.out.println(url);
View Full Code Here

    }
   
    private Metadata createLayerInfoObject(String layerId) throws Exception{
      Metadata layerInfo = new Metadata(layerId);
     
      SolrRecord layerInfoMap = layerInfoRetriever.getAllLayerInfo(layerId);
     
      layerInfo.setGeometryType(layerInfoMap.getDataType());
      layerInfo.setAccessLevel(layerInfoMap.getAccess());
      layerInfo.setTitle(layerInfoMap.getLayerDisplayName().trim());
      layerInfo.setOwsName(layerInfoMap.getName().trim());
      layerInfo.setLocation(layerInfoMap.getLocation().trim());
      layerInfo.setDescription(layerInfoMap.getDescription().trim());
      layerInfo.setOriginator(layerInfoMap.getOriginator().trim());
      layerInfo.setWorkspaceName(layerInfoMap.getWorkspaceName().trim());
      layerInfo.setBounds(Double.toString(layerInfoMap.getMinX()), Double.toString(layerInfoMap.getMinY()),
          Double.toString(layerInfoMap.getMaxX()), Double.toString(layerInfoMap.getMaxY()));
      layerInfo.setThemeKeywords(layerInfoMap.getThemeKeywords().trim().split(" "));
      layerInfo.setPlaceKeywords(layerInfoMap.getPlaceKeywords().trim().split(" "));
      return layerInfo;
    }
View Full Code Here

      @RequestParam("width") String width,@RequestParam("height") String height,
      HttpServletRequest request, HttpServletResponse response) throws Exception {

      Set<String> layerIds = new HashSet<String>();
      layerIds.add(layerId);
      SolrRecord layerInfo = null;
      try {
      layerInfo = this.layerInfoRetriever.fetchAllLayerInfo(layerIds).get(0);
    } catch (Exception e) {
      e.printStackTrace();
      //response.sendError(500);
    }
     
      //remove any query string
      String previewUrl = searchConfigRetriever.getWmsUrl(layerInfo);

      /*
       * http://www.example.com/wfs?
   service=wfs&
   version=1.1.0&
   request=GetFeature&
   typeName=layerName&
   maxFeatures=NUMBER_OF_FEATURES&srsName=EPSG:900913
   bbox=a1,b1,a2,b2
   bbox should be determined by the client.  the size of a pixel?
       */
     
      String layerName = layerInfo.getName();
      if (layerInfo.getWorkspaceName() != null && !layerInfo.getWorkspaceName().trim().isEmpty()){
        layerName = layerInfo.getWorkspaceName() + ":" + layerName;
      }
     

      /*
       * http://localhost:8399/arcgis/services/ihs_petroleum/MapServer/WMSServer?&service=WMS&version=1.1.1&request=GetFeatureInfo&layers=pipelines&query_layers=pipelines&styles=&bbox=47.119661,28.931116,48.593202,29.54223&srs=EPSG:4326&feature_count=10&x=389&y=120&height=445&width=1073&info_format=text/plain&xsl_template=http://server:8080/dev-summit-2010/resource/xsl/featureinfo_application_geojson.xsl
 
View Full Code Here

  protected BeanFactory beanFactory;

  public String getClassKey(LayerRequest layer) throws Exception {
    this.readConfigFile();
    SolrRecord record = layer.getLayerInfo();
    JsonNode institutions = this.configContents.path("institutions");
    if (!institutions.isArray()){
      try{
        return this.getDefaultDownloadKey(institutions, layer);
      } catch (Exception e){
        e.printStackTrace();
        logger.error("Class Key not defined for this layer.");
        throw new Exception("Class Key not defined for this layer.");
      }
    }
    ArrayNode jsonArray = (ArrayNode) institutions.path(record.getInstitution());
    Iterator<JsonNode> institutionIterator = jsonArray.getElements();
    String classKey = null;
    while (institutionIterator.hasNext()){
      JsonNode currentNode = institutionIterator.next();
      logger.debug("trying matches...");
      Boolean accessMatch = matchNode(currentNode, "accessLevel", record.getAccess().toLowerCase());
      if (!accessMatch){
        continue;
      }
      logger.debug("access match");
     

      Boolean dataTypeMatch = matchNode(currentNode, "dataType", getGeneralizedDataType(record.getDataType().toLowerCase()));
      if (!dataTypeMatch){
        continue;
      }
      logger.debug("data type match");
     
View Full Code Here

TOP

Related Classes of org.OpenGeoPortal.Solr.SolrRecord

Copyright © 2018 www.massapicom. 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.