当前位置: 首页 > news >正文

网站开发教程视频网站批量收录

网站开发教程视频,网站批量收录,代替wordpress,wordpress更新以后进不去项目场景: 在Gis项目关于tif影像数据是不能直接在地图上面加载,只能通过后端进行处理,或者前端进行处理之后才能叠加到地图上面! 处理方式 1.安装geotiff插件 npm install geotiff -g2.利用插件处理tif文件 import GeoTIFF, { fromBlob, fromUrl, fromArrayBuff…

项目场景:

在Gis项目关于tif影像数据是不能直接在地图上面加载,只能通过后端进行处理,或者前端进行处理之后才能叠加到地图上面!


处理方式

1.安装geotiff插件

npm install geotiff -g

2.利用插件处理tif文件

import GeoTIFF, { fromBlob, fromUrl, fromArrayBuffer } from 'geotiff';
import GeoTIFFImage from 'geotiff/dist-node/geotiffimage';
export default class GeoTiffUtil {tiff: GeoTIFF;img: GeoTIFFImage;constructor() {}async init(blob: string) {//this.tiff = await fromBlob(blob);let response = await fetch(blob);let af = await response.arrayBuffer();this.tiff = await fromArrayBuffer(af);this.img = await this.tiff.getImage();}getBbox(): number[] {return this.img.getBoundingBox();}getEPSGCode() {return this.img.geoKeys;}async getRasters(): Promise<any> {return await this.img.readRasters();}getWidthHeight(): { width: number; height: number } {return { width: this.img.getWidth(), height: this.img.getHeight() };}
}

3上传文件

<Dragger {...uploadProps}><p className="ant-upload-hint" style={{ color: 'white' }}>파일을 드래그 앤 드롭하여 업로드 하세요.</p>
</Dragger>

4核心处理

const uploadProps = {name: 'file',action: '/server/api/file/upload',accept: '.png,.jpg,.tif',headers: {authorization: '',},data: {userAccount: 'userId',},maxCount: 1,onChange(info: { file: any; fileList?: any; }) {const { status } = info.file;const { file } = info;if (status !== 'uploading') {console.log(info.file, info.fileList);}if (status === 'done') {message.success(`${info.file.name} file uploaded successfully.`);if (file.response && file.response.code == 200) {if (file.response.data.fileSuffix == '.tif') {let newUrl = AppConfig.flightUrl1 + file.response.data.fileUrl;// const imageryLayer = new Cesium.ImageryLayer(new Cesium.SingleTileImageryProvider({//     url: newUrl// }));// window.cviewer.flyTo(imageryLayer)// window.cviewer.imageryLayers.add(imageryLayer);console.log(111111111,newUrl)let tiffUtil = new GeoTiffUtil();tiffUtil.init(newUrl).then(() => {let hw = tiffUtil.getWidthHeight();tiffUtil.getRasters().then((rs) => {const [red = [], green = [], blue = []] = rs;let canvas = document.createElement('canvas');canvas.width = hw.width;canvas.height = hw.height;let ctx = canvas.getContext('2d');let imageData = ctx.createImageData(hw.width, hw.height);for (var i = 0; i < imageData.data.length / 4; i++) {imageData.data[i * 4 + 0] = red[i];imageData.data[i * 4 + 1] = green[i] || 0;imageData.data[i * 4 + 2] = blue[i] || 0;imageData.data[i * 4 + 3] = red[i] === 0 ? 0 : 255;}ctx.putImageData(imageData, 0, 0);let temp1 = {key: file.response.fileName,fileNm: file.response.data.fileName,fileNmOriginal: file.name,filePath: canvas.toDataURL(),fielSize: file.size,fielExt: file.response.data.fileSuffix,date:new Date().getFullYear() +'.' +(new Date().getMonth() + 1) +'.' +new Date().getDate(),};console.log(999999,temp1)setData([...data, temp1]);}).catch((res) => {console.log(res);});});} else {let temp = {key: file.response.fileName,fileNm: file.response.data.fileName,fileNmOriginal: file.name,filePath: AppConfig.flightUrl1 + file.response.data.fileUrl,fielSize: file.size,fielExt: file.response.data.fileSuffix,date:new Date().getFullYear() +'.' +(new Date().getMonth() + 1) +'.' +new Date().getDate(),};setData([...data, temp]);}}} else if (status === 'error') {message.error(`${info.file.name} file upload failed.`);}},onRemove: (file) => {setfileListobj(null);},};
http://www.tj-hxxt.cn/news/69108.html

相关文章:

  • 新手如何做代理武汉网站seo服务
  • 抄袭的网站百度浏览器网址
  • 门户网站素材网页设计个人主页模板
  • 网站建设验收百度识图网页版在线使用
  • 医药b2b电子商务网站开发淘宝指数查询
  • 做网站找酷万站长之家seo信息
  • 浙江省网站建设与管理试卷刷网站百度关键词软件
  • 韩雪冬做网站多少钱郑州网络推广平台
  • 网站建设放什么会计科目国内优秀网站案例
  • iis 网站显示建设中北京云无限优化
  • wordpress页面能用js吗沈阳seo
  • 滨海住房和城乡建设局网站安康seo
  • 中国万网网站空间申请网站建设纯免费官网
  • 做网站什么语言好东莞网站推广技巧
  • 合肥网站建站报广告代理品牌推广的三个阶段
  • 专业建站推荐南宁seo内部优化
  • 临沂网站建设选盛誉网络营销课程有哪些
  • 成都幼儿园网站建设本周国内重大新闻十条
  • 南宁手机平台网网站建设传统营销与网络营销的区别
  • 从手机上可以做网站吗跨境电商平台哪个最好最可靠
  • 网站代理合作全网营销策划公司
  • 网页设计的最佳尺寸关键词优化公司靠谱推荐
  • 网络销售模式 自建网站seo推广要多少钱
  • 如何查询网站收录情况哪里有免费的网站推广服务
  • 个人社保缴费比例是多少淘宝seo对什么内容优化
  • 网上做网站怎么赚钱吗信息流优化师前景
  • 做网站vpn多大内存bing搜索引擎下载
  • 优秀的网站设计目前小说网站排名
  • 在线做家装设计的网站深圳网络推广外包公司
  • 怎么自己做购物网站手机百度app安装下载